Nice. I've seen v8-juice many times. In my case, I really coded for speed. It got to the point in HTTP serving where an extra syscall or string copy was killing my requests/second performance by 10%. That's like from 45,000 requests/second down to 40,000.
I'm even questioning whether I even need HandleScope at all. Every nanosecond counts! ;-) On Apr 12, 2012, at 6:31 AM, Stephan Beal wrote: > On Thu, Apr 12, 2012 at 3:24 PM, Michael Schwartz <[email protected]> wrote: > If you check out the silkjs repository, you'll see I do near zero error > checking in the C++ code. So it does crash, just like a C/C++ program will > if you pass garbage to an OS call (for example). > > Sorry, i didn't mean to imply that that was explicitly an error, only that > leaving out the IsObject() check "might severely shorten the app's lifetime." > > However, you can do something like this (which silkjs does do). Wrap the > calls to C++ with JavaScript that does the error checking before calling the > C++ function. > > That's a fine solution. Nowadays i mostly use C++ templates which validate > the args and dispatch to an appropriate native overload: > > http://code.google.com/p/v8-juice/wiki/V8Convert_Overloading > > Happy Hacking! > > -- > ----- stephan beal > http://wanderinghorse.net/home/stephan/ > http://gplus.to/sgbeal > > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
