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

util: improve inspect performance #14881

Closed
wants to merge 6 commits into from

Commits on Sep 14, 2017

  1. Configuration menu
    Copy the full SHA
    8876924 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    424f8af View commit details
    Browse the repository at this point in the history
  3. util: refactor inspect for performance

    The main optimizations are
    - Removed visibleKeys
    - Removed proxy cache
    - Removed Object.assign
    - No key concatenating anymore
    - No key recalculating anymore
    - Improved indentation logic
    - Improved string escape logic
    - Added many fast paths
    - Optimized code branches a lot
    - Optimized (boxed) primitive handling
    - Inline code if possible
    - Only check extra keys if necessary
    - Guard against unnecessary more expensive calls
    
    This also fixes a bug with special array number keys as e.g. "00".
    
    Besides that there were lots of smaller optimizations, the
    code got a bit cleaned up and a few more tests got in.
    
    Fixes nodejs#15288
    BridgeAR committed Sep 14, 2017
    Configuration menu
    Copy the full SHA
    c5fc61f View commit details
    Browse the repository at this point in the history
  4. util: fix out of bounds indices in util.inspect

    This fixes a issue brought up in 15288.
    
    Ref nodejs#15288
    BridgeAR committed Sep 14, 2017
    Configuration menu
    Copy the full SHA
    ee5415e View commit details
    Browse the repository at this point in the history
  5. test: improve util inspect tests

    Remove unnecessary code parts and outdated code
    BridgeAR committed Sep 14, 2017
    Configuration menu
    Copy the full SHA
    3587261 View commit details
    Browse the repository at this point in the history
  6. test: fix actual and expected order

    In addition use the newer common.expectsError version.
    BridgeAR committed Sep 14, 2017
    Configuration menu
    Copy the full SHA
    5c1e1fd View commit details
    Browse the repository at this point in the history