Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Added Call Overhead info to README

  • Loading branch information...
commit 5be394574e6277d406324fd46e50c79b2eb255a8 1 parent cde4f99
@rbranson rbranson authored
Showing with 5 additions and 0 deletions.
  1. +5 −0
@@ -26,6 +26,7 @@ WARNING: node-ffi assumes you know what you're doing. You can pretty easily crea
* Linux, OS X, or Solaris.
* You will need node.js 0.2.3+
+* libffi installed -- with development headers (comes with OS X and most Linux distros)
@@ -73,6 +74,10 @@ In addition to the basic types, there are type aliases for common C types.
Internally, V8 stores integers that will fit into a 32-bit space in a 32-bit integer, and those that fall outside of this get put into double-precision floating point numbers. This is problematic because FP numbers are imprecise. To get around this, the methods in node-ffi that deal with 64-bit integers return strings and can accept strings as parameters.
+# Call Overhead
+There is non-trivial overhead associated with FFI calls. Comparing a hard-coded binding version of `strtoul()` to an FFI version of `strtoul()` shows that the native hard-coded binding is 5x faster. So don't just use the C version of a function just because it's faster. There's a significant cost in FFI calls, so make them worth it.
See LICENSE file.
Please sign in to comment.
Something went wrong with that request. Please try again.