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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: faster direct read approach #1537

Merged
merged 1 commit into from Jul 10, 2022
Merged

Conversation

jimmywarting
Copy link
Contributor

This will saves some memory and make decoding responses faster and avoids some unnecessary overhead that needs to clone the hole body using Blob that in turns requires everything to be immutable and requires a lots of data being copied.

using body.text() became like 2x faster, compared to the prev commit 馃憤

closes #1533

@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2022

Codecov Report

Merging #1537 (c358cbd) into main (aa8782c) will increase coverage by 0.00%.
The diff coverage is 97.36%.

@@           Coverage Diff           @@
##             main    #1537   +/-   ##
=======================================
  Coverage   94.90%   94.90%           
=======================================
  Files          50       50           
  Lines        4609     4632   +23     
=======================================
+ Hits         4374     4396   +22     
- Misses        235      236    +1     
Impacted Files Coverage 螖
lib/fetch/body.js 98.73% <97.36%> (+0.21%) 猬嗭笍
lib/fetch/file.js 91.66% <0.00%> (-1.20%) 猬囷笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update aa8782c...c358cbd. Read the comment docs.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

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.

Switch out body.text() blob reading method to use TextDecoder directly instead
5 participants