Repository navigation
Faster regexes - #3077
Faster regexes#3077Palloxin wants to merge 56 commits into
Conversation
[Medium impact] The PR appears safe to merge, with a small, non-blocking search-preview issue. Findings
SummaryThis PR replaces many regex operations with string operations and simplifies several remaining patterns.
Reviews (16) · Last reviewed commit: "fixed mist" · Reviewed by Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
Ignore that (specific) one. It's Unrelated to your PR! |
|
The test failure appears to be related to https://github.com/Acode-Foundation/canvas-view. |
|
Regarding the linting error, I made all commits from mobile with github web page editor. If a dev could fix it in my stead, idk what npm even is :) |
|
Microbenchmarks like jsbench/measurethat time a function in a tight loop; that doesn't show any effect in Acode. These strings are tiny and the code runs a handful of times per action, so a faster Most of this PR changes build steps: Cordova hooks, plugin install scripts and build utilities, plus a vendored library. Those run during builds and gain nothing at runtime, and a wrong regex there can break the build. A few changes also produce different output, which can break things:
Lint also fails.(This is not a big deal tho) Performance PRs need a profile from Acode showing the code is an actual bottleneck, with before/after numbers from the app. See Performance Changes in CONTRIBUTING.md. Closing this. |
|
I am not capable of producing such data. However for those who know regex and that replaceAll dynamic can know without doubt its objevtive per improvement. Little things accumulate, a better practice to always give fast code is good. Lint failed, yes, it is the single quotrs I used, I was fixing it |
|
Since I dont know what regex does what, I fished for every regex in the code and every replace => replaceAll dynamic in there, improving them objectively. Objevtively it is an inprovement. Edit: nvm this pr is a mess, I make it again |



Faster regex improvements