Skip to content

lib: add SafeArray to primordials and use it for FreeList - #36600

Open
ExE-Boss wants to merge 1 commit into
nodejs:mainfrom
ExE-Boss:lib/primordials/safe-array
Open

lib: add SafeArray to primordials and use it for FreeList#36600
ExE-Boss wants to merge 1 commit into
nodejs:mainfrom
ExE-Boss:lib/primordials/safe-array

Conversation

@ExE-Boss

Copy link
Copy Markdown
Contributor

Refs: #36304 (comment)
Refs: #36565

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@Lxxyx

Lxxyx commented Dec 22, 2020

Copy link
Copy Markdown
Member

Run Benchmark on my computer, seems the performance issues still exists.

                           confidence improvement accuracy (*)    (**)   (***)
 misc/freelist.js n=100000        ***    -92.46 %      ±1.94% ±2.61% ±3.46%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case there are 1 comparisons, you can thus
expect the following amount of false-positive results:
  0.05 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.01 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)

@aduh95

aduh95 commented Dec 22, 2020

Copy link
Copy Markdown
Contributor

@ExE-Boss

Copy link
Copy Markdown
Contributor Author

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark confirmed very poor performance results…

                            confidence improvement accuracy (*)   (**)  (***)
 misc/freelist.js n=100000        ***    -91.36 %       ±3.89% ±5.24% ±6.96%

@targos targos added the lib / src Issues and PRs related to general changes in the lib or src directory. label Dec 27, 2020
@ExE-Boss

ExE-Boss commented Mar 7, 2021

Copy link
Copy Markdown
Contributor Author

If I had to guess, I’d say V8 is doing some inlining shenanigans when it detects a push or pop method on an ordinary array with %Array.prototype% in its [[Prototype]] internal slot.


By inlining the methods in #37649, I hope to make FreeList faster and resilient to mutation of %Array.prototype%.pop and %Array.prototype%.push

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

@github-actions github-actions Bot added the stale label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory. stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants