Summary
[colorize egg] slow on big files
Metadata
- Id: 07ad336251e26f09132693a053cc47edaad8698d
- Trac id: 1799
- Type: enhancement
- Reporter: curium
- Owner:
- Cc: sjamaan
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: fixed
- Priority: minor
- Milestone: someday
- Version: 5.3.0
- Changetime: 2022-03-22 14:17:50 UTC
- Created: 2022-03-22 13:39:19 UTC
- Keywords: colorize
Attachments
- 07ad336251e26f09132693a053cc47edaad8698d/attachments/colorize.diff
Description
When trying to colorize big files such as chicken's runtime.c, according to chicken profiler, 96% of time is spent on append at line 296. One enhancement could be to cons tokens and then return the reversed result. Time to colorize runtime.c goes from 10m to 02s.
Another thing which I would like is to have htmlize exported: if someone is using html-colorize, they could need that function to handle a case where the text doesn't need colorization.
Tentative diff attached.
Changes and comments
[2022-03-22 13:40:43 UTC] curium attached colorize.diff (description=Diff that replaces append with cons, returns reversed result, exports htmlize.)
[2022-03-22 14:17:50 UTC] sjamaan changed status from new to closed
[2022-03-22 14:17:50 UTC] sjamaan set resolution to fixed
[2022-03-22 14:17:50 UTC] sjamaan wrote:
Thanks a bunch, this is a great improvement! I'm a bit embarrassed I overlooked that though ;)
Should be available as 0.5 soonish.