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

[BUG] Investigate the performance overhead of result types #58

Closed
38 opened this issue Oct 17, 2019 · 1 comment
Closed

[BUG] Investigate the performance overhead of result types #58

38 opened this issue Oct 17, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@38
Copy link
Member

38 commented Oct 17, 2019

See discussion under #56 for detials

Just realized a different thing, I tried your benchmark with a CPU profiler.
The result is so shocking: 25% of the time is spend to handle the Result types.
I try to remove one question mark from the rasterizer, it turns out a 10% speed up.

--

Local repo:

test sine_640_480                                  ... bench:   4,188,667 ns/iter (+/- 338,945)
test sine_640_480_2_horizontal_subgraphs_draw_both ... bench:   4,609,418 ns/iter (+/- 407,366)
test sine_640_480_2_horizontal_subgraphs_draw_one  ... bench:   2,298,113 ns/iter (+/- 461,527)
test sine_640_480_2_horizontal_subgraphs_fake_blit ... bench:     270,355 ns/iter (+/- 53,794)

0.2.8:

test sine_640_480                                  ... bench:   7,277,665 ns/iter (+/- 3,636,985)
test sine_640_480_2_horizontal_subgraphs_draw_both ... bench:   8,129,140 ns/iter (+/- 937,515)
test sine_640_480_2_horizontal_subgraphs_draw_one  ... bench:   4,303,821 ns/iter (+/- 255,423)
test sine_640_480_2_horizontal_subgraphs_fake_blit ... bench:     288,119 ns/iter (+/- 102,912)

--

Update, I refactored two question mark to is_err it turns out 50% speed up.

image

@38 38 added the bug Something isn't working label Oct 17, 2019
@38 38 changed the title [BUG] Investigate the performance overheap of result types [BUG] Investigate the performance overhead of result types Oct 17, 2019
@38
Copy link
Member Author

38 commented Oct 17, 2019

Related Rust issue: rust-lang/rust#37939

@38 38 closed this as completed Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant