Yesterday I did the following test:
Test performance with tiny cacheThis test avoids the pre-fill cost, and explores responsiveness in a worst case scenario of performing only on-demand caching, to get a feel for its actual impact.
1. Set tag cache size to 8000 kb (my tag file is >320000 kb), closed SlickEdit.
2. Dumped the OS disk cache by doing a full clean build of my product (takes ~10 hours and reads ~15GB of unique disk files and writes ~120GB of unique disk files -- i.e. "unique" meaning I count multiple reads/write of the same file as only 1 read/write).
3. Started SlickEdit.
>>>> SlickEdit started in about 1 second.4. Move insertion point up/down/left/right using arrow keys.
>>>> During the first 5-10 seconds there were some brief pauses of up to 1 sec.5. Page up/down a few times.
>>>> Syntax coloring caused pauses of up to ~2.5 sec.6. Ran "type MyWorkspace.vtg > nul" to prime the tag file into the OS disk cache.
7. Moved cursor, page up/down, do a bunch of tag lookups.
>>>> SlickEdit responded instantly to everything.Overall feelThe responsiveness was a little slow, but was a lot better than sitting there for 30 seconds staring at a shaded window whose title bar says "(Not responding)".
Here is my reasoning for why it makes sense to use an incremental/async pre-fill:
- Making tag-related background operations asynchronous (such as syntax coloring, filling the Preview toolbar, etc) will solve performance for the background operations.
- It's not clear to me how to make tag-related user actions (e.g. press Ctrl+.) asynchronous, so I don't think that threading/async work will solve those -- they'll still be best served by having a tag cache.
- If we're going to have a tag cache for the foreseeable future, we're going to need pre-fill in order for the cache to add value.
- If we're going to need pre-fill, we're back to the problem of synchronous pre-fill causing editor startup to take a long time.
- Even with threading, to solve startup time we still need to make the pre-fill be asynchronous.
- The pre-fill can be made async without any threading, and all tag-related operations gain from that. In fact if the whole tag file is cached then the need for threading goes down.
So it feels like pre-fill and threading are only loosely related, and pre-fill reduces the need for threading. Combine async (idle) pre-fill with a dynamically sized tag cache that is big enough for the whole tag file(s), and tag lookups become super fast without any threading. Seems like a less complicated solution path than hooking up threading.
I've said my piece(s

), so I'll let this lie. I can work around the problem by cranking the SE tag cache to its minimum limit, and writing a daemon to frequently read the entire tag file to force it to stay resident in the OS disk cache. It just seems like users shouldn't have to go to this degree of manual tuning and creating external processes to get decent performance in the editor.