GNU nano - Bugs: bug #56432, [Task] nano shouldn't compile each...
You are not allowed to post comments on this tracker with your current authentication level.
bug #56432: [Task] nano shouldn't compile each color regex twice
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Mon 03 Jun 2019 02:38:49 PM UTC | ||
Severity: | 1 - Wish | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Wed 05 Jun 2019 10:32:16 AM UTC, comment #7: |
Benno Schulenberg <bens> |
Tue 04 Jun 2019 08:45:32 PM UTC, comment #6: Looks good.
|
Brand Huntsman <brand> |
Tue 04 Jun 2019 04:02:13 PM UTC, comment #5: Forgot to say: for my test case (opening four files, using only the standard syntaxes), startup time goes down from an average 42 ms to an average 40 ms. (But the variation is something like -5 to +10 ms, so the speedup drowns mostly in the noise.) |
Benno Schulenberg <bens> |
Tue 04 Jun 2019 03:58:24 PM UTC, comment #4: Attached is a version that passes NULL to nregcomp() when the compiled regex should be discarded.
|
Benno Schulenberg <bens> |
Tue 04 Jun 2019 03:43:27 PM UTC, comment #3: Attached is what I had yesterday, when I ran into bug #56434. It's clumsy, with several allocations and frees. Your version is more compact, but I don't like the extra boolean parameter. I propose to pass NULL when the result of the compilation should not be kept -- it saves the declaring of a dummy variable in grab_and_store(). Coming up. |
Benno Schulenberg <bens> |
Tue 04 Jun 2019 01:33:59 AM UTC, comment #2: The second patch was for testing purposes only and I do not approve of it, but forgot to remove the sign-off header before uploading. If you decide to apply it, please don't put my name anywhere on the commit. |
Brand Huntsman <brand> |
Tue 04 Jun 2019 12:58:15 AM UTC, comment #1: First patch fixes this but I saw no change in startup time, but maybe slower systems will. It did decrease memory by 35k because the regex strings are no longer stored.
|
Brand Huntsman <brand> |
Mon 03 Jun 2019 02:38:49 PM UTC, original submission:
Currently, the regex of each color command of a syntax gets compiled (to check its validity) when the syntax gets parsed, and then gets compiled again when the syntax is activated. Since commit cba9d8d0 from last month, these two things happen right after each other, so... doing the compilation twice is a pure waste of time.
|
Benno Schulenberg <bens> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 8 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2019-06-19 | bens | Open/Closed | Open | Closed | |
2019-06-05 | bens | Status | In Progress | Fixed | |
2019-06-04 | bens | Attached File | - | Added 0001-rcfile-compile-the-color-regexes-just-once.patch, #47028 | |
2019-06-04 | bens | Attached File | - | Added compile-color-regexes-just-once.diff, #47027 | |
2019-06-04 | brand | Attached File | - | Added 0001-rcfile-only-compile-syntax-color-regexes-once.patch, #47022 | |
Attached File | - | Added 0002-rcfile-only-compile-syntax-header-and-magic-regexes-once.patch, #47023 | |||
2019-06-03 | bens | Status | None | In Progress | |
Assigned to | None | bens |
Powered by Savane 3.13-d3ae.
Corresponding source code
Pushed to master, commit 57b3f83c. Thanks.