You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it might be a special case and I guess there is no hurry in fixing this: if there are some hundred functions in IJ1Helper.getAdditionalMacroFunctions(); the auto-completion pull down becomes laggy and actually hinders typing. I assume the same happens if macros are thousands of lines long.
At least for the case of getAdditionalMacroFunctions I can see a way out: We cache the pulldown content. As long as the return value of IJ1Helper.getAdditionalMacroFunctions() doesn't change, we don't need to regenerate it.
Furthermore, we should ensure that the pulldown opens after e.g. < 500 ms in all cases. Therefore we might explore how to interrupt its content generation.
Cheers,
Robert
The text was updated successfully, but these errors were encountered:
Agree! I haven't personally hit that wall (yet), but can I see that becoming an issue at some point. Did you stumble upon a working example?
Additional functions usually see little change on a regular basis, so polling them on each call is definitely overkill (although they can be updated on the fly).
Perhaps checking (and/or logging) for changes and keeping a cached list might be an alternative, though I'd have to take a closer look into the source. It's been a while since my last dive.
Dear @ndefrancesco, dear future-self,
it might be a special case and I guess there is no hurry in fixing this: if there are some hundred functions in
IJ1Helper.getAdditionalMacroFunctions();
the auto-completion pull down becomes laggy and actually hinders typing. I assume the same happens if macros are thousands of lines long.At least for the case of
getAdditionalMacroFunctions
I can see a way out: We cache the pulldown content. As long as the return value ofIJ1Helper.getAdditionalMacroFunctions()
doesn't change, we don't need to regenerate it.Here might be a starting point:
https://github.com/imagej/imagej-legacy/blob/master/src/main/java/net/imagej/legacy/plugin/MacroAutoCompletionProvider.java#L341
Furthermore, we should ensure that the pulldown opens after e.g. < 500 ms in all cases. Therefore we might explore how to interrupt its content generation.
Cheers,
Robert
The text was updated successfully, but these errors were encountered: