-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colorizer makes loading files really slow #30
Comments
Seems to go through the file for several passes, setting highlights for each color class (hex, rgb, rgba). A consolidated one-pass matcher would speed this up considerably. That, and vim pattern matching (at least under classic vim) seems very slow compared to most cmdline utils (grep, awk, etc). Outsourcing the regex to a faster program may also be an improvement. I might work on this. I tried hexokinase per @lilydjwg 's suggestion, but it has its own issues. |
@mauromorales, is this any better? |
@BourgeoisBear thanks for reaching out, tbh I haven't used this plugin for a long time now. You could run the profiler and compare your results between the two implementations to get a good idea of the progress done. |
I can generate 58K worth of text and run a profiler well enough, but I was wondering if your 58K pathological case is something you can share? Sometimes the devil is in the details. |
@BourgeoisBear sorry but I have no clue which file this was, it's been too long since I opened this issue. I vaguely recall that it was not a file with hex numbers specifically, so if you tested with a large file with random text and numbers, I think you've covered the issue I was having |
FWIW, the King James Bible (114,567 lines) took ~3 to 4 sec with my pure vimscript implementation. Just changed it to use |
Same
|
Try vim-hexokinase? |
I switched to |
I was trying colorizer with a file that was ~58K lines long and it was taking more than 15 seconds to load. Looking into Vim profiler it seems that most of the time was spent on the function
PreviewColorInLine()
The text was updated successfully, but these errors were encountered: