Sigil-Ebook / Sigil

Sigil is a multi-platform EPUB ebook editor
GNU General Public License v3.0
5.97k stars 578 forks source link

[Bug]: Sigil will lag (not responding) when there are more than 300 xhtml files. #766

Closed TimeLimit67 closed 3 months ago

TimeLimit67 commented 3 months ago

Bug Description

I edited an EPUB containing more than 300 xhtml files. Whenever I click save after finishing an important editing process (I do this all the time so that if Sigil suddenly or abruptly closes for no reason, which happens sometimes and I dunno why), saving will load slowly. I mean very slowly. At first I thought that's because there are too much files so it's acting like that. However, the "not responding" issue will occur everytime.

Screenshot (25)

Platform (OS)

Windows (Default)

OS Version / Specifics

Windows 11 Home Single Language

What version of Sigil are you using?

2.2.1

Any backtraces or crash reports

No response

kevinhendricks commented 3 months ago

"saving will load slowly" - Huh? Saving does not load, it writes out files. What exactly are you trying to say. Your image shows the Sigil status bar with the message "Epub saved". I can see no issue in it.

If Sigil is crashing often, please report those. Sigil is rock steady on all platforms and has been for some time. If you are experiencing frequent crashes then it is most likely something specific to your setup. We need to track down what system extension or antivirus/defender code that is interfering with Sigil's operation.

Next, 300 xhtml files is not a particularly large epub unless each file in itself are large. We have tested with epubs with thousands of files.

Instead of using Save, learn to use the much much faster Checkpoint system. Saving makes every file in the epub be written to disk into a temporary folder that when all is written will zip it up to create an epub, then swap the created epub with the previous file to keep atomicity. Checkpoints simply writes out the changed files as it is actually a git repository behind the scenes.

So launch your Microsoft box into safe mode to disable all 3rd party extensions, then run your test epub again. If the problem is not present any longer then the issue is a 3rd party extension or antivirus software on your system.

Also for your next crash, please report the very last command in Sigil you used and the sequence of steps you used before the crash.

kevinhendricks commented 3 months ago

Also, the "Not Responding" message is based on a OS timer, perhaps your OS is not getting any signals to indicate activity from Sigil. As soon as the "Epub saved." message shows up in the Sigil status bar, have you tried moving the mouse or otherwise interacting with Sigil?

My guess is it is your OS generating the Not Responding message due to a timer timing out and that Sigil happily saved the file (as indicated by the Status Bar message in your screenshot) and is waiting for you to continue.

kevinhendricks commented 3 months ago

I did a quick google search for erroneous "Not Responding" issues and found this is a huge issue on many Windows boxes that have either of the two following conditions:

A. Too many tasks running in the background

or

B. Use of multiple antivirus defender apps that grab control of newly created files to "scan" them for threats causing issues and greatly slowing down the file saving process.

Neither of these things can Sigil control or workaround. You should be telling all Windows anti-virus and defender programs to treat Sigil as "trusted" and to turn off all scanning of files in the folder and its subfolders that Sigil uses as its workspace. See the workspace folder inside your Sigil Preferences folder and disable-scanning of all files inside it at all times.

So your issue is most likely caused by either A. or B. and is not under the control of Sigil.

Closing this as not a bug in Sigil.