feat: reduce allocations#1156
Conversation
Public API changes for crate: brush-coreChanged itemsPerformance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is Test Summary: bash-completion test suite
|
72ad32c to
980cb74
Compare
lu-zero
left a comment
There was a problem hiding this comment.
I read it twice and it looks very nice.
| { | ||
| if let Some(pattern) = pattern { | ||
| if !pattern.is_empty() { | ||
| let regex = pattern.to_regex(false, false)?; |
There was a problem hiding this comment.
Probably we could cache them in the future
|
Thanks for putting this all togther, @Elsie19! I've read through everything other than There are 2 API surface changes flagged by the PR -- I think both of them are warranted, and they're relatively low impact, so I'm supportive of making them. I'll spend some more time looking through |
|
It does crash with #1069 so once it lands I'd re-roll that branch and if we have time would be nice to land it as follow up. |
@lu-zero Any more info on what the crash is? Is there anything you'd recommend get adjusted in this PR before we merge? I just finished reviewing the latest changes (for this PR) and it's looking pretty good to me. |
|
Just I managed to typoing clash with crash... It works but on the portage-repo it seems to not speed up anything :/ |
Some of the things I did:
with_capacitywhere applicableextendIntoIteratorbounds for looser constraintsCowwhen appropriateVecin function arguments with&[]map_or_elsewithmap_orwhen default value is staticI also replaced these functions entirely:
and
Where the new functions take a closure over their respective argument and can transform it at the call site. You may want to pull out that specific commit and merge it outside of this PR, but I added it here anyways.
Feel free to pick and choose which ones to keep and leave! If you need I can merge likewise commits into one to make the merge cleaner.