View Single Post
Old 06-05-2021, 02:10 AM   #34
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by DiapDealer View Post
I'd love to hear from those who were experiencing performance issues with the 1.4 and 1.5 series. There were a lot of performance-based changes in 1.6.
Absolutely fantastic performance improvements. Reports, Syntax Highlighting, Preview.

But there have been a few regressions introduced along the way too.

One Spellcheck List issue was already adjusted for next release—1.6.1:

- "In spellcheck do FindSelectedWord only if double-clicked to speed paging"

* * *

The Issue

When used on a very large EPUB (~1.6 million words), Tools > Spellcheck > Spellcheck was sluggish, with noticeable delays between clicks/highlights.

These were the timings in my VM:

- Sigil 1.6.0: ~1.4 seconds
- Sigil 1.5.1: ~1.4 seconds
- Sigil 0.9.14: <0.5 seconds
- Calibre 5.19: Instant

Note: In your typical-sized ebook, these steps barely take a perceivable amount of time.

VM Note: Windows 10 + 2 cores + on an external hard drive.

* * *

If you need an enormous EPUB (~1.3 million words) to poke around in, there's the same one I mentioned in my "monolithic single file" report:

https://mises.org/library/complete-l...orum-1969-1984

If you want it even bigger, just EPUB Merge it with another large ebook.

The Steps

While in Spellcheck List (Tools > Spellcheck > Spellcheck)...

Sigil pre-1.6.1

1. Single-click a word in the list. It jumps to the word within Code View.

2. Press Page Down/Up OR single-click any word.

(#.## seconds delay to find/jump within Code View.)

Page Down multiple times, and the delay hits every single time as Sigil searches through Code View.

Sigil 1.6.1+

To mitigate some of this, we settled on:

1. Double-click a word jumps to the word within Code View.

2. Press Page Down/Up OR single-click another word. No jump in Code View.

This allows you to easily make all your adjustments directly in Spellcheck List window (sort columns, Change Selected Word To, Add To Dictionary, [...]) without the need to mess with the code.

Side Note: This double-click jump + single-click stay is the way Calibre's Spellcheck List already works.

* * *

Note: KevinH tested this and couldn't reproduce. No/barely any slowness. Also seems like it would be a huge amount of overhaul for fractional gains.

Here was his explanation to me via PM:

Quote:
Originally Posted by KevinH
As for lookup speed, my tests were not consistent with what you are seeing at all. The longest pause was clicking on a word that was misspelled only near the end of the book when current CV was open at the top of the book timed repeatedly to be was well under 1 second. Double-clicking on random misspelled words was often instantaneous depending on how far forward in the book it first appears.

All of these tests were done with your posted test case.

There really is no way to speed this up without doing the check in parallel across all xhtml files at once, but then sorting it to keep order, and then needing to cache the results for next time. Unfortunately a single IgnoreAll or ReplaceAll would invalidate the cache as would any other changes made.

It is just not worth the overhead unless I wanted to build a list of all places with that word and show the list with some limited context for each time the word was found. And then walk that list. The first find would then take longer while the follow-on for the next in the list would be much faster.

So a sub one second worst case lookup on a huge complex epub with random lookups generally much faster is okay in my book versus the added code complexity and overhead/bookkeeping needed for just incremental improvements unnoticeable with normal length epubs.
Any of you who have an under-powered device sitting around... maybe test some of these steps too. It'll probably be more noticeable compared to our super fast CPUs/SSDs.

... Although at this point, we're niggling over 1 second... Plus, now with Sigil 1.6.1's already-pushed fix, this 1 second will be buried out of the way.

Last edited by Tex2002ans; 06-05-2021 at 02:34 AM.
Tex2002ans is offline   Reply With Quote