-
Notifications
You must be signed in to change notification settings - Fork 899
Filters stream rebound #948
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
Filters stream rebound #948
Conversation
Rebound of #946 |
Hmmm.... The |
@Therzok Tests are failing on AppVeyor. Looks like a memory issue. They pass when ran from Visual Studio, but launching |
w00t! The test runner is safe now (courtesy of @ammeep the CrashTamer™). |
One thing I'm going to add to this is some kind of smoother buffer growing algorithm (eg. if we're at 90% of asize, grow the buffer by 50%). Should have something working tomorrow |
[Fact] | ||
public void FilterStreamsAreCoherent() | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 the new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💀'd it
These changes look great. I'll pull this down and give it a test with a custom filter implementation of my own. |
/cc @ethomson |
I've taken this for a spin locally and it works just perfectly ✨ |
|
||
public override void Write(byte[] buffer, int offset, int count) | ||
{ | ||
AutoGrowBuffer(count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? git_buf
knows how to grow itself (that is much of the point for it existing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocating a page would be better yes (assuming you do mean 4kB). The difference in allocations is surprising, since you're also growing by 1.5 and the size is ensured anyhow. The one difference seems to be that you assume there is going to be a next request and preallocate for it. How large is the difference in reallocs? What's the difference in memory consumption?
Warning: This relies on a libgit2 private build from libgit2/libgit2#2892 which isn't merged yet.
Besides the minor fixes, this tries to provide a more stream-like approach. Unfortunately, something's not working and I can't find why.
Ideas?