-
Notifications
You must be signed in to change notification settings - Fork 86
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
The highlight is really slow (especially un-highlighting) #32
Comments
Hi @Mazyod, I'm glad you like the plugin! Highlighting is instantaneous on my machine (mostly the same as yours). The only thing that sometimes takes a second or two at most is un-highlighting, which is a known issue. Are you working with very large source files? Admittedly I didn't test the highlight feature with source files that have more than a few hundred lines of code. If you want, you can try profiling the plugin by cloning the source, setting the executable to Xcode.app in the Xcode scheme's Profiling section, then launching profiling with Time Profiler to take a look at what might be the issue. I'm going to try profiling it on my machine soon to optimize that. |
Thanks for the prompt reply @fortinmike! Admittedly, the unhighlight is more glaring of an issue. Sorry, I quickly skimmed the issues, and didn't find anything related to that, my bad. Yeah, our source files are 500 - 800 lines on average 😞 I am using it mainly to highlight |
Thanks for reporting this, I'll take a look as soon as I find some free time. Maybe I didn't add an issue for this, no need to apologize. I'd also gladly accept a pull request if you think this is a show-stopper and want to contribute. Michaël Fortin
|
I'd really love to contribute, but I don't have much time myself to learn the code base ^^; Mazyad Alabduljaleel On Thursday, July 3, 2014 at 5:36 PM, fortinmike wrote:
|
Same here with extremely slow highlight times, several seconds with spinning beach ball, essentially makes this feature unusable, unfortunately (especially after being used to Eclipse/IntelliJ automatic instantaneous highlight of a word under the cursor). |
One possible suggestion on limiting the effect is to only highlight the symbol in the current scope (don't know if there's an easy way to detect the scope though). |
@dtrembovetski Because XcodeBoost has no true internal model of the code itself, there is no way to reliably check for a symbol's scope. Issue #1 (using Clang to make sense of source code) would probably be the best solution. Any hints on how to get started using Clang (admittedly a pretty complex subject) would be appreciated. The But this is not the cause of the slowdown, AFAIK. Rather, it seems to be linked to the way the highlighting attributes are applied and removed from the NSTextView subclass (i.e. the code editor). If some of you want to take a look,
Unfortunately I have no time at all to fix this at the moment, but be assured I will come back to this eventually. With that said, a pull request or some experimentation results would be awesome! |
I changed the enumeration code in the
Significantly improved the unhighlight performance. Since you can specify your own attribute names, it might be worth assigning more dynamic attribute names, instead of storing and enumerating the ranges. i.e.:
How does that sound? |
OK, scratch that. I found your fix, pretty straight forward. It was clear from the profiling that the It's already working on the remove all method, I just wanted to apply it on the highlight as well before submitting a PR :) |
Great, thanks @Mazyod ! Actually, I read a bit about these exact methods (begin/endEditing) after reading @dtrembovetski's comments. Seems like I was on the right track! Thanks a lot for your time. Many will benefit! I'm waiting for your PR. |
Haha, yup. No problem, I am happy to be able to contribute, even a little, to this great project :) |
Thanks again, I'll take a look at your PR after my workday. It'll be available for everyone soon enough! :) |
Hi,
Thanks for this wonderful plugin, it's truly a life saver.
The only feature that I extensively use is the highlight feature, and honestly it is really slow. It takes about a good second or two to highlight, and then same amount to remove, which really harms productivity.
Is it just me? Can I somehow profile it? (MBP RD 2012)
Thanks,
Maz
The text was updated successfully, but these errors were encountered: