Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: make base64 decoding 10-15% faster #2193

Merged
merged 2 commits into from
Jul 25, 2015

Commits on Jul 25, 2015

  1. src: make base64 decoding 50% faster

    Make the inner loop execute fewer compare-and-branch executions per
    processed byte, resulting in a 50% or more speedup.
    
    This coincidentally fixes an out-of-bounds read:
    
        while (unbase64(*src) < 0 && src < srcEnd)
    
    Should have read:
    
        while (src < srcEnd && unbase64(*src) < 0)
    
    But this commit removes the offending code altogether.
    
    Fixes: nodejs#2166
    PR-URL: nodejs#2193
    Reviewed-By: Trevor Norris <[email protected]>
    bnoordhuis committed Jul 25, 2015
    Configuration menu
    Copy the full SHA
    8fd3ce1 View commit details
    Browse the repository at this point in the history
  2. test: fix valgrind uninitialized memory warning

    parallel/test-buffer called `Buffer.prototype.toString()` on a buffer
    with uninitialized memory.  Call `Buffer.prototype.fill()` on it first.
    
    PR-URL: nodejs#2193
    Reviewed-By: Trevor Norris <[email protected]>
    bnoordhuis committed Jul 25, 2015
    Configuration menu
    Copy the full SHA
    ac70bc8 View commit details
    Browse the repository at this point in the history