-
Notifications
You must be signed in to change notification settings - Fork 502
improv: shlex.split() function heap allocs & perf for large compile commands #4458
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
improv: shlex.split() function heap allocs & perf for large compile commands #4458
Conversation
8758d75
to
e636a80
Compare
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.
Good news! I hunted through some historical testing I did of this, and this is identical to some changes I had tested out, but you were able to perform some better benchmarking, so I'm excited to take this!
Before approving and merging though, could you please add a CHANGELOG entry? Please credit yourself following the pattern people have used before.
@borjamunozf Oh, and there are some formatting errors that the linter is complaining about, that's why the builds are failing. Could you fix this as well? It's simple enough that I could fix it, but then we would need a different approver, so it'd be best if you could make those changes. Thanks! |
There it goes! Thanks :) |
@microsoft-github-policy-service agree |
Could you try again? It seems like the license/cla still hasn't reported. |
@microsoft-github-policy-service agree |
Don't know, it seems that it's not picking it up. Not sure if I'm missing something. Is the only step required as far as I recall, right? |
It does redirect to my home, but perhaps you can trigger this? https://cla-assistant.io/check/microsoft/vscode-cmake-tools?pullRequest=4458 Mentioned in the COMMON_ISSUES cla |
Did you also try that link? I attempted it and nothing seemed to happen |
0b05a04
to
369c025
Compare
Finally. I'm dumb, the commits were pushed with my company email account. Sorry for the bother! |
The macOS pipeline is failing always in the same tests. I have read that you mentioned about a flaky test, could be this? |
@borjamunozf I will force merge this, other builds are failing due to this, and we recently tried to fix this but it doesn't seem to have worked. Thanks for this contribution, merging. |
…ommands (microsoft#4458) * direct improve shlex heap allocs & perf for large compile commands * Fix lint issues & update CHANGELOG
This change addresses item #4283
The following changes are proposed:
The shlex (and CompileDatabase infoByFilePath) is only responsible for an average usage in the heap of ~4GB across our different projects. It also takes an avg of 35-40sg to parse.
The purpose of this change
Other Notes/Information
Probably there could be room to improve or optimize further, but I think this is a almost direct and easy change to apply.
Tests seems to pass ok.
Some dummy file to bench:
Heap stats with current split: 4GB + time 48.452s

Heap stats after optimized split: 600Mb + time ~16s
