![]() As a phenomenological workaround, TeXworks checks if all lines are properly laid out and if not, "reloads" the document into Qt up to a couple of times. However navigating to one of those lines that were not laid out correctly resulted in the immediate crash of TeXworks ( #469). Naturally, this has a tendency to occur mostly for large documents where the layout process took some time (and some breaks). by a syntax highlighter or spell checker) before the layout process was complete. Unfortunately, there was a very long standing bug ( QTBUG-20345) in this process (dating back almost a decade now) resulting in the failure to lay out some lines if paragraph styling was changed (e.g. Historically, it has done so incrementally (a few paragraphs at a time, "taking a break" every now and then to allow the program to do other things, such as process user input). When you load (or edit) a document, the underlying Qt framework used for displaying, handling windows, etc. In the following, I will try to detail my hypothesis regarding how it came to this bug. If I am correct, there is no easy way of "fixing this" immediately. Unfortunately, it seems to be related to #469 and several (related) Qt bugs. I think I may finally have reproduced the issue. It is only after I finished the whole document and returned to edit the parts in the middle that I noticed the lag. This is probably why I didn't notice it when I was writing my long document - because at that point I would mostly be adding text to the end. This is something I didn't observe before: At the beginning and at the end of the document, there's no lag at all when I type it only happens in the middle of the document. Yes the syntax highlighting appears all the way to the end. ![]() The situation has not changed over the last 20 minutes or so. For example, it doesn't happen while I am writing these comments in Safari. The sluggish behavior is limited to the TeXworks editor. TeXworks is essentially using 0% CPU and 60MB memory. In my Mac Activity Monitor, I see about 30% CPU load and less than 9GB out of 16GB physical memory used. ![]() I downloaded a random moderately large TeX file from arXiv (e.g., this 79-page paper, you can just click on "other formats" and select "source") and I got sluggish response when I jumped to the middle of the file and started typing. You might need a “real” document with plenty of symbols and equations and multiple environments to trigger the issue. Perhaps for a file with just thousands of lines of "lorem ipsum", the variety of LaTeX syntax isn’t rich enough to cause problem.
0 Comments
Leave a Reply. |