Skip to content

Commit

Permalink
util: refactor inspect for performance
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BridgeAR committed Sep 14, 2017
1 parent 424f8af commit c5fc61f
Show file tree
Hide file tree
Showing 4 changed files with 558 additions and 505 deletions.
Loading

0 comments on commit c5fc61f

Please sign in to comment.