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

Improve performance for 0.27 change on RenderContext #167

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

sunng87
Copy link
Owner

@sunng87 sunng87 commented Jul 9, 2017

From 0.27, RenderContext now owns Context. During the render process, we need to clone the RenderContext, so Context and its wrapped data are cloned again and again. This patch made data in Context an Rc, the clone cost will be pretty cheap.

Address issue #166 .

Benchmark:

test large_loop_helper ... bench:   3,242,381 ns/iter (+/- 313,516)

Compared with 0.27:

test large_loop_helper ... bench: 496,376,347 ns/iter (+/- 148,433,745)

0.26:

test large_loop_helper ... bench:   3,148,455 ns/iter (+/- 72,797)

Signed-off-by: Ning Sun <sunng@about.me>
@sunng87 sunng87 merged commit d989a94 into master Jul 11, 2017
@sunng87 sunng87 deleted the feature/helper-perf-tune branch July 11, 2017 14:27
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.

1 participant