-
Notifications
You must be signed in to change notification settings - Fork 534
plumbing: Use ReadBytes() rather than ReadSlice() #314
Conversation
Codecov Report
@@ Coverage Diff @@
## master #314 +/- ##
=======================================
Coverage 77.34% 77.34%
=======================================
Files 117 117
Lines 8011 8011
=======================================
Hits 6196 6196
Misses 1156 1156
Partials 659 659
Continue to review full report at Codecov.
|
Can you provide a test for it? To avoid duplicate this bug again? A slice with more than 4096 chars without a newline should be enough for test the issue. Thanks! |
I am not sure what the original reason for using Or is this deemed not an issue? I haven't looked into how much garbage is generated with the change, so this is just a quick observation that might be unimportant. |
@mcuadros the existing test suite seems to rely heavily on a set of external fixtures: github.com/src-d/go-git-fixtures Do I issue a PR against that repo to get a fixture added? @hansrodtang it will result in an extra copy per line but we're already doing at least one copy per line, so I don't think it's a major issue - we're not changing the scaling behaviour fundamentally by this change. |
Ah, never mind, I found a way to add tests without changing fixtures. Wdyt @mcuadros ? I verified that the tests fail without the fix. |
If accepted, will this fix end up in |
@hansrodtang thanks for pointing the extra memory usage, once we have a stable API, we will take care of the performance reviewing the code base to improve this from the root. @lupine yep, I need update the v4 branch, but I will do it ASAP. |
@lupine v4 has been updated, https://github.com/src-d/go-git/tree/v4. |
@mcuadros https://gitlab.com/gitlab-org/es-git-go at the moment. i'm starting to see uses for it elsewhere too, though :D |
Thanks so much for the merge! |
Fixes #249