Barrier crossing between JS and C++ is slow. Buffer is implemented by 
Node.js and therefore each call to .slice() is expensive because of that 
barrier crossing.
I advise you measure and choose the best option for your use case.

On Monday, 15 September 2014 02:52:36 UTC+2, Michael Monashev wrote:
>
> Hi! 
>
> I  rewite  some code from Strings to Buffers with zero data copying (I 
> use slice). But the new code was 10 times slower! I Buffer slower than 
> String? 
>
> -- 
>  Michael 
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/4704e569-ed9c-4e81-9b5b-1f8448e753aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to