This repository has been archived by the owner. It is now read-only.

buffer: strip high bits when converting to ascii #4379

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants
Member

bnoordhuis commented Dec 6, 2012

Fixes #4371.

Reviewers: @indutny @piscisaureus

bnoordhuis added some commits Dec 6, 2012

buffer: strip high bits when converting to ascii
Consider the following example:

  console.log(Buffer('ú').toString('ascii'));

Before this commit, the contents of the buffer was used as-is and hence it
prints 'ú'.

Now, it prints 'C:'. Perhaps not much of an improvement but it conforms to what
the documentation says it does: strip off the high bits.

Fixes #4371.
buffer: speed up ascii character scanning
Speed up ASCII character scanning and conversion by 25% to 30% by scanning and
converting whole words instead of individual bytes.

wrong masks?

missed ~, nvm

Owner

indutny commented Dec 6, 2012

LGTM

Member

bnoordhuis commented Dec 7, 2012

what about https://codereview.chromium.org/11469014 ?

Left a comment. AllocateRawAsciiString and SeqAsciiString don't exist in v8 HEAD so they probably won't take the patch as-is.

Owner

indutny commented Feb 25, 2013

Is still relevant?

isaacs commented Mar 8, 2013

Yes, it is. I'm running tests again now, about to push if everything is fine.

isaacs commented Mar 8, 2013

Landed on master. Thanks, @bnoordhuis!

@isaacs isaacs closed this Mar 8, 2013

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.