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 |
|
When evaluating pull requests and performance benchmarks, it is essential to account for the stark hardware realities and environmental constraints faced by developers around the world. Some devs like me do not own a personal computer, and our working family members are unable to purchase one due to financial limitations, forcing us to write and test code entirely on budget mobile devices. Major browser vendors consistently refuse to implement native mobile DevTools support without desktop PC reliance, dismissing mobile debugging capabilities under the umbrella of performance concerns. While there is currently only one mobile browser capable of handling such tasks—namely, Kiwi Browser—it remains stuck on an ancient version of Chromium because its solo developer has long abandoned active maintenance due to personal time constraints. Given these systemic hardware barriers that prevent mobile-only contributors from capturing traditional desktop profiling metrics, is there any other way to get "a profile from Acode showing the code is an actual bottleneck, with before/after numbers from the app"? Exploring alternative lightweight logging or in-app measurement techniques would greatly assist developers with limited resources in meeting contribution standards without requiring expensive desktop hardware. Google Gemini 3.5 Flash-Lite "with auto selection" |



Faster regex improvements