-
Notifications
You must be signed in to change notification settings - Fork 335
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
diff-so-fancy slurps entire git log -p output? very slow #140
Comments
I don't think you should use As per readme:
|
I agree with @stevemao. d-s-f is designed to process small diffs (commits) in to human readable form, not to parse hundreds of thousands of lines. My guess for the slowness is that we remove all the leading |
Ah, the recommended config changed on Feb 12: 5f7422a Updated my config to match and all is fine. Thanks. |
That said.... it's interesting that Feb 7th's d-s-f could handle being the core.pager and today's can't. |
This reverts commit a6b5801. Too goddamn slow: so-fancy/diff-so-fancy#140
I agree that it would be better if it still could be used with It would be helpful to find the commit that caused this (using git-bisect) and then improve upon that. @bronson |
I think @bronson found it at a6b5801. That's the commit where we switched most of the backend from sed to Perl so we could do fancier things with the output display. We can investigate the slowness, but I can't make any guarantees as this use case is a little outside the scope of the project. |
It should still be possible to not read the whole input, but process it in chunks (e.g. 8kb). |
If I use a 60MB
The rest of the time is spent looping through each line one by one... I imagine the problem is the second one (depending on how much input we're talking). As a work around you can completely disable the line pre-processing by commenting out line 22 https://github.com/so-fancy/diff-so-fancy/blob/master/lib/diff-so-fancy.pl#L22 That will get you output at the 1 second mark. |
@scottchiefbaker Looks like the |
@blueyed agreed, the problem appears to be that this script slurps the entire file before processing. Moving the while(my $line = <>) {
...
} It seems like this script goes out of its way to slurp though... not sure if there's a reason for that. |
This actually ended up not being too insane to solve, and it will give us other performance improvements. Can you test the branch I just posted here: https://github.com/scottchiefbaker/diff-so-fancy/tree/pipeline If I use my 60MB input now, I get output on the screen immediately. I moved back to processing the input line by line instead of buffering the whole input. This is a little more complex code wise, but it should perform a lot better. |
Also, most importantly, we still pass all tests. |
@scottchiefbaker looks great! It appears nobody uses And, if anyone needs a line number in the future, maybe they could use |
True... I'll reopen this since we have a fix and wait for feedback on whether it does what you want or not. |
@scottchiefbaker just tried it out, everything appears to work perfect. Even |
How big is rails/rails? |
Dunno, doesn't matter! :) Now d-s-f blocks before getting very far. Excellent. Over 57,000 commits, gotta be hundreds of MB if one lets it run to completion. |
@stevemao @paulirish what do you guys think? Should we merge this even though it's outside the scope of regular d-s-f? |
It's not out of the scope. being smart on processing the lines will give performance boost on |
Thanks, @scottchiefbaker! |
This is merged so I'm closing this issue now. |
Love it, great job! |
Any chance this problem slipped in again? EDIT: in case somebody wonders again if this is supported, the help text disagrees:
BTW, |
@Blaisorblade this should be fixed on the |
Thanks for clearing up @scottchiefbaker |
Using Feb 7th's diff-so-fancy,
git log -p
andgit log --stat
would display immediately.Using today's diff-so-fancy,
git log --stat
takes many seconds to complete andgit log -p
hangs for a few minutes and then bombs out.A guess: it looks like some change in the past 1.5 months made it so diff-so-fancy is now trying to slurp the entire output before displaying the results.
My repo has 4200 commits, so tiny. This issue appears reproducible in any moderately-sized project. For example,
git log --stat
on rails/rails shows a blank screen for 10 seconds before showing the log. Revert to Feb 7th and it displays immediately.The text was updated successfully, but these errors were encountered: