Performance and CCV8

Xavier Mendez edited this page Jun 5, 2013 · 2 revisions

You may know about CCV8 (now called v8-juice), a fantastic library for automatic
wrapping of normal C++ functions to V8 functions. Both have different use cases,
and some people may prefer the other library, but you should be aware of the differences (correct me if wrong):

CCV8 is to Node as Boost.Python is to Python.
Boost.Python allows you to just define your library to Python.
No wrapping code, no type-converting hassles, it does that for you.
CCV8 is similar to it in that way. More complete, more sophisticated.

V8U doesn't aim to provide that. With V8U, you still have to write
the same code
. But instead of writing (all the code) by hand, the utilities do the sistematic stuff for you.

Instead of writing this again and again:

static Handle<Value> MyFunction(const Arguments& args) {
  HandleScope scope;

You write this:

static V8_CB(MyFunction) {

The macro expands to the necessary code, so there's no impact on performance in most cases.

V8U is simpler than CCV8, but provides different layers
of abstraction so the user can choose what he feels more
comfortable with.