synctex: Forward search very slow with many boxes
I have a file where forward search in a specific figure takes ~11 seconds, so much that forward search request will hit timeout and will start a new process:
> zathura main.pdf --synctex-forward 44:0:fig.tex -l debug
debug: ../zathura/dbus-interface.c:577: iterate_instances_call_synctex_view(): Found name: org.pwmt.zathura.PID-126716
debug: ../zathura/dbus-interface.c:505: call_synctex_view(): Filename from 'org.pwmt.zathura.PID-126716': [...]/main.pdf
error: Failed to run SynctexView on 'org.pwmt.zathura.PID-126716': Timeout was reached
debug: ../zathura/main.c:208: main(): No instance found. Starting new one.
This is when invoking forward search inside cryptocode pseudocode, with a normal usage of cryptocode.
Interestingly, this gives me about 11000 lines of output:
synctex view -i 44:0:fig.tex -o main.pdf
whereas invocations in "normal" places in the document are just 27 lines.
So maybe the underlying problem is synctex outputs tons of boxes... Maybe I should report this to https://github.com/jlaurens/synctex/ (or cryptocode?).
But I also think that zathura should handle this more nicely, even if this means simply bailing out after too many boxes. I think it would be nice to jump to some document position first and only then try to draw the boxes.
Not sure if I want to share the sources but I'm sure I could a minimal test case, or I could run a profiler if this helps.