Commit 658aeb2c authored by Ben Noordhuis's avatar Ben Noordhuis
Browse files

stream_wrap: don't call Number::New()

Replace call to Number::New() with a call to Integer::NewFromUnsigned().

Profiling a Real World(TM) application with perf(1) suggests that the
conversion of its argument from integer to double is disproportionally
costly: over 60% of CPU cycles accountable to WriteStringImpl() are
attributable to the conversion.

After changing it to Integer::NewFromUnsigned(), WriteStringImpl()
has dropped from the 'most costly functions' top ten altogether.
parent 90655a99
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment