-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 optimizations #1403
Conversation
Nice! Do you think it would be beneficial if we'd do the same for the |
@mofux Not sure yet, I'll give it a try. Also I would try to omit API changes as much as possible, lets see how far we can get with that 😀 |
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.
Looks good! I think all the new buffer local can be declared const is the only comment
@Tyriar Sure thing. The second change is abit smelly, it maps |
@jerch Thanks! Did you see any noticeable performance improvements by getting rid of the |
@mofux Well yes it is ~5 - 10% boost, varies from run to run. |
Hmm weird thing I just observed in chrome - performance is degrading with some time: My test loop is "reload page", "run command once", "reset performance stats", "record", "run command again", "get timings from last run" - and that several times. I run it by hand (no selenium whatsoever), and with several runs the times get worse. After relaunching chrome it is back to normal. The degrading seems to keep going, therefore I think it is not only GC stuff related from the dev console. Do we have any long running perf data? Is this known to happen for long running sessions? A chrome bug maybe? Note that I reload the page in between. |
@jerch I remember seeing a similar effect a while ago with another project. I think the Chrome dev tools cause this because they remain connected to the process while the page reloads. You might try to close the dev-tools before you reload. You could also try to run each test in a fresh new tab. |
@mofux Ah yepp changing the tab worked, thanks. The hot sh*t happens in Therefore the last commit prefetches the row, which kinda makes the |
Guess I am done, cannot squeeze more out of it. Summary
1 & 2, 1 & 3 are stacking, 2 & 3 are not stacking since they kinda address the same problem. Imho 1. is worth to be included, although local method code gets a little longer with all those prefetching. I am unsure about 2 and 3, if I had to vote for one I'd say 3 since it is only a local change. |
Is everything using export interface IBuffer {
readonly lines: ICircularList<LineData>;
} That will achieve the same effect without a getter. |
Final PR up for review - contains now the local @Tyriar : The readonly flag did not work due to an assignment to it in Linkifier.test.ts. - Fixed with a workaround for MockBuffer. |
@jerch good workaround, it's fine to cast or do more dodgy stuff in tests 👍 |
PR to gather some low hanging fruit performance optimizations.
As benchmark I use the command
ls -lh /usr/lib
on ubuntu and track the second run to avoid the altas rendering stuff.JS timings:
.buffer
local where appropriate: 3.2sBuffer.lines
: 2.9saddChar
: 2.9s