Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: danielsan/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Mar 9, 2016

  1. util: Use of let and const. Optimized array use.

    Because accessing properties is more expensive than accessing variables
    and they will be used in any case I moved the variables declared on lines
    25 and 26 to lines 14 and 15. In this way the code avoids to access the
    same properties more than once.
    
    The push method is more expensive than array index attribution.
    Since the new array length is always known, the creation of the array
    with a predefined length for future positioning attribution is less
    expensive than using the push method.
    
    Benchmarks added proving that the new approach is in average 2 to 3
    times faster than the original one.
    danielsan committed Mar 9, 2016
    Configuration menu
    Copy the full SHA
    757ffdc View commit details
    Browse the repository at this point in the history
Loading