Skip to content

Add ability to compile the CLI with mimalloc #526

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

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Add ability to compile the CLI with mimalloc #526

merged 1 commit into from
Sep 20, 2024

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Sep 12, 2024

Showcase of #525

With the current implementation it would be almost a 1-1 copy of the default allocator with the key words changed.

If we go worward with #525 we could consider adding this too, since it's virtually free.

@saghul saghul marked this pull request as draft September 12, 2024 12:31
Copy link
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

Seems basically fine to me.

@dgod
Copy link

dgod commented Sep 13, 2024

Does let opaque the last param of memory functions help to reduce a wrapper call?

@saghul
Copy link
Contributor Author

saghul commented Sep 13, 2024

Yes and no. You could cast the function to ignore it, but it throws compile warnings, so I thought we can ignore it. I don't think there is much gain anyway, since the functions are called indirectly anyway mf->js_malloc()...

Some (unscientific) benchmark results:

| Benchmark (Higher scores are better)  | QuickJS           | QuickJS (mimalloc) |
|---------------------------------------|-------------------|--------------------|
| Richards                              | 1217              | 1229               |
| DeltaBlue                             | 1192              | 1297               |
| Crypto                                | 1195              | 1191               |
| RayTrace                              | 1477              | 2186               |
| EarleyBoyer                           | 2441              | 3246               |
| RegExp                                | 275               | 315                |
| Splay                                 | 2461              | 3765               |
| NavierStokes                          | 2156              | 2119               |
| Score                                 | 1318              | 1553               |

Running the V8 benchmark suite (version 7) on an M1 MacBook Pro.

Fixes: #142
@saghul saghul marked this pull request as ready for review September 20, 2024 07:48
@saghul saghul merged commit 6ce2dcc into master Sep 20, 2024
50 checks passed
@saghul saghul deleted the mimalloc branch September 20, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants