note: A lot of this assumes a repo has already been forked.
First make sure all your commits have your name/email:
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR EMAIL"
// Demonstrates how to pass a template function to a non-template function | |
// pointer by specifying the template parameter when it's assigned. | |
// This allows the void* to be safely cast when the function is called. | |
#include <cstdio> | |
struct A { int val = 42; }; | |
struct B { int foo = 0; int val = 45; }; | |
void (*cbp)(void*); |
Notes:
On process.nextTick()
:
libuv: | |
$ ./gyp_uv.py -f make -Dlibrary=shared_library | |
$ BUILDTYPE=Release make -j6 -C out | |
node: | |
$ ./configure --shared-libuv --shared-libuv-includes=$LIBUV_PATH/include --shared-libuv-libpath=$LIBUV_PATH/out/Release | |
$ make -j6 | |
binary build: | |
$ CONFIG_FLAGS="--shared-libuv --shared-libuv-includes=$LIBUV_PATH/libuv/include --shared-libuv-libpath=$LIBUV_PATH/out/Release" DISTTYPE=custom CUSTOMTAG="$(date +'%s')" make -j6 binary |
native-stream.js uses the reference implementation, compiled with babel to run | |
on latest io.js. | |
stream-bluebird.js is exactly the same as native-stream.js except it uses the | |
latest bluebird Promise implementation. | |
node-stream.js uses the node stream implementation and forced to be async by | |
using process.nextTick() (which is functionally equivalent to the microtask | |
processor) |
Here is a collection of tips and tricks I've picked up about doing performance analysis on Node. Included is a build script that should get a base install of Ubuntu fully functional and ready for all the things we'll be going through.
The script pulls a lot of code from the latest master
of each repository. So
it's possible that something may fail, but to date I haven't had any issues.
First, go ahead and run the script. Then go take a nice long break. It'll
#include <stdio.h> | |
#include <assert.h> | |
#include "uv.h" | |
#define ITER 1e6 | |
#define ACCESS_ONCE(type, var) \ | |
(*(volatile type*) &(var)) | |
static uv_mutex_t mutex; |
diff --git a/test/addons/async-hello-world/binding.cc b/test/addons/async-hello-world/binding.cc | |
index da2bd41..5ddd61f 100644 | |
--- a/test/addons/async-hello-world/binding.cc | |
+++ b/test/addons/async-hello-world/binding.cc | |
@@ -44,13 +44,11 @@ void AfterAsync(uv_work_t* r) { | |
v8::Local<v8::Function>::New(isolate, req->callback); | |
callback->Call(isolate->GetCurrentContext()->Global(), 2, argv); | |
+ printf("did rethrow: %s\n", !try_catch.ReThrow().IsEmpty() ? "true" : "false"); | |
+ |
'use strict'; | |
Error.stackTraceLimit = Infinity; | |
const dgram = require('dgram'); | |
const print = process._rawDebug; | |
// Problem doesn't exist with localhost, so plug in a Google server's IP. | |
const HOST = '172.217.5.110'; | |
const client = dgram.createSocket('udp4'); | |
const message = Buffer.alloc((1 << 16) - 29); |
{ | |
"targets": [{ | |
"target_name": "addon", | |
"sources": [ "main.cc" ] | |
}] | |
} |