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

[8_4] improve error handling and performance of mimalloc #254

Merged
merged 8 commits into from Jan 18, 2024

Conversation

jingkaimori
Copy link
Contributor

by register error handler to avoid checking NULL pointer at every allocation. Thus lolly must be initialized by init_tbox before any invocation. Therefore many tests are rewritten.

Such optimization cannot be performed on jemalloc or fast_alloc.

by register error handler to avoid checking NULL pointer at every allocation. Thus lolly must be initialized by `init_tbox` before any invocation. Therefore many tests are rewritten.

Such optimization cannot be performed on jemalloc or fast_alloc.
@da-liii
Copy link
Contributor

da-liii commented Jan 18, 2024

I do not think it is a perf pr, but it is a pr for better error handling.

@da-liii
Copy link
Contributor

da-liii commented Jan 18, 2024

You can disable wasm CI on windows, it is better to do wasm development on linux.

I think wasm dev env on Windows is nice to have but it is not necessary. What's your idea on wasm dev env, if you agree my idea, just disable the ci in this pr.

@da-liii
Copy link
Contributor

da-liii commented Jan 18, 2024

I do not think it is a perf pr

Could you provide the benchmark result? Null check here is not the bottle neck of performance here.

but it is a pr for better error handling.

For error handling, this pr is important for developer to finding bugs for the memory allocator.

Copy link
Contributor

@da-liii da-liii left a comment

Choose a reason for hiding this comment

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

CI failed

@da-liii da-liii changed the title improve performance of mimalloc [8_4] improve error handling and performance of mimalloc Jan 18, 2024
Copy link
Contributor

@da-liii da-liii left a comment

Choose a reason for hiding this comment

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

LGTM

@jingkaimori
Copy link
Contributor Author

Performance

Before this pr:

ns/alloc & free alloc & free/s err% total benchmark
18.10 55,251,393.84 0.4% 0.09 basic type, fast collect
19.69 50,795,585.86 1.1% 0.09 basic type, bulk collect
18.85 53,062,126.91 0.4% 0.02 char, bulk collect
19.69 50,795,800.88 0.3% 0.02 int, bulk collect
20.37 49,087,420.23 1.8% 0.02 long, bulk collect
21.94 45,585,777.24 0.8% 0.03 double, bulk collect
22.71 44,042,456.68 0.3% 0.01 struct
7.28 137,449,849.42 1.6% 17.64 large array of basic type
6.42 155,811,536.60 3.3% 3.87 large array of complex structure
68.53 14,592,923.76 1.4% 0.08 `frequent allocation of array, space reused

After this pr:

ns/alloc & free alloc & free/s err% total benchmark
15.11 66,180,341.43 1.5% 0.07 basic type, fast collect
16.09 62,167,966.54 1.0% 0.08 basic type, bulk collect
15.70 63,686,892.08 0.5% 0.02 char, bulk collect
16.22 61,638,462.40 0.5% 0.02 int, bulk collect
16.89 59,213,005.33 1.5% 0.02 long, bulk collect
17.69 56,534,438.90 0.6% 0.02 double, bulk collect
19.29 51,832,998.20 7.0% 0.01 〰️ struct (Unstable with ~52,283.3 iters. Increase minEpochIterations to e.g. 522833)
7.36 135,847,019.41 0.3% 17.66 large array of basic type
7.21 138,732,639.50 1.8% 4.28 large array of complex structure
67.95 14,717,605.94 1.4% 0.08 frequent allocation of array, space reused

@jingkaimori jingkaimori merged commit 0e3e5dd into main Jan 18, 2024
12 checks passed
@jingkaimori jingkaimori deleted the jingkaimori/mimalloc branch January 18, 2024 10:29
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.

None yet

2 participants