Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor(allocator): Use & instead of a thread-local #9235

Merged
merged 8 commits into from
Jul 14, 2024
Merged

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jul 14, 2024

Description:

This is a part of #9230. I profiled the performance, and thread_local took too long to get the address of the thread-local variable. So, I inlined the reference into the allocator.

Benchmark result


Gnuplot not found, using plotters backend
common/allocator/alloc/std/1000000
                        time:   [4.9478 ms 4.9653 ms 4.9922 ms]
Found 17 outliers among 100 measurements (17.00%)
  4 (4.00%) high mild
  13 (13.00%) high severe

common/allocator/alloc/no-scope/1000000
                        time:   [5.4821 ms 5.4938 ms 5.5068 ms]
Found 17 outliers among 100 measurements (17.00%)
  2 (2.00%) high mild
  15 (15.00%) high severe

common/allocator/alloc/scoped/1000000
                        time:   [3.1401 ms 3.1456 ms 3.1518 ms]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe

common/allocator/alloc/cached-no-scope/1000000
                        time:   [5.0992 ms 5.1090 ms 5.1198 ms]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe

common/allocator/alloc/cached-scoped/1000000
                        time:   [3.0191 ms 3.0230 ms 3.0273 ms]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) low mild
  1 (1.00%) high mild
  8 (8.00%) high severe

@kdy1 kdy1 added this to the Planned milestone Jul 14, 2024
@kdy1 kdy1 self-assigned this Jul 14, 2024
@kdy1 kdy1 marked this pull request as ready for review July 14, 2024 08:10
@kdy1 kdy1 requested a review from a team as a code owner July 14, 2024 08:10
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_allocator

Copy link

codspeed-hq bot commented Jul 14, 2024

CodSpeed Performance Report

Merging #9235 will not alter performance

Comparing kdy1:ptr2 (8f7e866) with main (037dad5)

Summary

✅ 178 untouched benchmarks

@kdy1 kdy1 merged commit 8d5670e into swc-project:main Jul 14, 2024
155 of 156 checks passed
@kdy1 kdy1 deleted the ptr2 branch July 14, 2024 15:37
@kdy1 kdy1 modified the milestones: Planned, v1.7.0 Jul 17, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Aug 17, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant