-
Notifications
You must be signed in to change notification settings - Fork 348
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
Performance issue with the redundancy operations #293
Comments
Agreed, this seems like a worthwhile change. Which files did you benchmark on? The diffing logic usually takes the majority of the time. |
I tried this: 23f6a9f and I only saw a ~0.3% improvement, measuring on elisp_before.el, load_before.js and Session_before.kt. Would love a PR if you're doing something different :) |
FWIW I also noticed that column numbers could be u32. |
Wilfred
added a commit
that referenced
this issue
Jun 13, 2022
It's reasonable to assume that a single column won't exceed four billion, and this is a small speedup (1% instruction count reduction on the sample file in #293).
Wilfred
added a commit
that referenced
this issue
Jun 15, 2022
This function is hot for textual diffs, such as the sample files in issue #293. For those files, this produces a 21% reduction in instruction count.
Wilfred
added a commit
that referenced
this issue
Jun 15, 2022
This is a small performance reduction (0.2% increase in instruction count for the file in #293) but simplifies the code and ensures we're splitting with the same logic everywhere.
Wilfred
added a commit
that referenced
this issue
Jul 4, 2022
This file pair exposed a bunch of perf issues, so it's useful to keep it around.
Wilfred
pushed a commit
that referenced
this issue
Mar 16, 2023
* Fix C# raw_string_literal * Add test for C# raw string literal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
difftastic/src/display/hunks.rs
Lines 579 to 580 in f028b46
The struct LineNumber store a usize which is 8 byte. But under normal circumstances, it is very unlikely that a file will have more than 2^32 (4,294,967,295) lines of code. If we replace LineNumber with u32, we can reduce the redundant loading of 0's of the 4 high bytes then improve performance.
According to my tests, if we replace all the LineNumber within hunks.rs file with u32, the average execution time decreased from 4.2s to 3.8s, which is a 10% speedup.
Hope this information helps!
The text was updated successfully, but these errors were encountered: