On Fri, Aug 31, 2012 at 11:35 AM, Paolo Tagliani
<[email protected]> wrote:
> Hello everyone,
>
> I have to write a server program that implements some fuzzy logic and I
> choose to write it in Node.js to take advantage of its event orientation. I
> have to work with difficult mathematic computational problem, and I don't
> know what's the best way to obtain performance:
>
> Write all in Node.js and use the power of the V8 engine for the mathematical
> task.
> Write a module in C++ that implements all the mathematical function and call
> it from Node.
>
> Anyone that have experience in these type of computation on both platform?

It depends on the exact nature of the number crunching you'll be doing.

V8 is pretty good at optimizing integer math in the range -2^n to
2^n-1 where n=30 on 32 bits architectures and n=31 on 64 bits
architectures.

Floating point math is mostly compiled down to FPU instructions but
the values are often allocated on the heap. IME it's not an area where
V8 shines but YMMV.

V8 ships with a number of benchmarks that you may find interesting.
They're designed to run in a browser but here is a quick way to run
them from the command line:

  $ echo 'function load(){}' > bench.js
  $ cat 
benchmarks/{base,crypto,deltablue,earley-boyer,navier-stokes,raytrace,regexp,richards,splay,run}.js
>> bench.js
  $ out/x64.release/d8 bench.js

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to