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

refactor: Remove lifetime from Context, ResponseFuture, InterceptorFuture #405

Merged
merged 8 commits into from
Nov 7, 2022

Conversation

Xuanwo
Copy link

@Xuanwo Xuanwo commented Aug 11, 2022

This PR will fix #403

The benchmark seems can't reflect the actual improvement. (I guess the test case(64K) is not suitable to measure the different between an Arc::new)

Before:

download 64K: isahc     time:   [201.80 ms 204.40 ms 207.00 ms]

After

download 64K: isahc     time:   [200.32 ms 203.57 ms 206.90 ms]

Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo requested a review from sagebind as a code owner August 11, 2022 11:28
Signed-off-by: Xuanwo <github@xuanwo.io>
@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #405 (683bd9e) into master (352fbbc) will increase coverage by 0.14%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
+ Coverage   51.94%   52.09%   +0.14%     
==========================================
  Files          52       52              
  Lines        5796     5787       -9     
==========================================
+ Hits         3011     3015       +4     
+ Misses       2785     2772      -13     
Impacted Files Coverage Δ
src/interceptor/mod.rs 0.00% <0.00%> (ø)
src/request.rs 53.94% <ø> (ø)
src/lib.rs 16.51% <50.00%> (-0.09%) ⬇️
src/cookies/interceptor.rs 86.84% <94.44%> (+12.92%) ⬆️
src/client.rs 82.24% <97.22%> (-0.11%) ⬇️
src/default_headers.rs 100.00% <100.00%> (ø)
src/interceptor/context.rs 75.00% <100.00%> (ø)
src/interceptor/obj.rs 100.00% <100.00%> (ø)
src/redirect.rs 86.77% <100.00%> (+8.41%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Xuanwo
Copy link
Author

Xuanwo commented Aug 18, 2022

Hi, @sagebind, can you take a look into this PR? Thanks!

Signed-off-by: Xuanwo <github@xuanwo.io>
src/body/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo requested a review from sagebind August 31, 2022 14:27
@Xuanwo
Copy link
Author

Xuanwo commented Aug 31, 2022

@sagebind I did some refactor on this PR, PTAL

Copy link
Owner

@sagebind sagebind left a comment

Choose a reason for hiding this comment

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

Apologies for my prolonged absence, this looks fantastic! Thanks so much for your work on this.

@sagebind sagebind merged commit 7a56ada into sagebind:master Nov 7, 2022
@Xuanwo Xuanwo deleted the static-response-future branch November 7, 2022 01:44
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.

Make ResponseFuture 'static
2 participants