Version 8 of Slow Starpack Start

Updated 2010-11-11 20:12:28 by MHo

MHo, 2010-07-13: I notice the following symptom with starpacks on MS windows:

  • Starting them from a local drive (like c:\) is very fast ;-)
  • Starting them from a mapped network drives is relatively slow
  • Starting other programs from the same network drive is not very slow

I don't know the reason yet, as I have only started to analyse what's going on a few hours ago... It seems that the phenomen has nothing or little to do with the size of the executable. Sure, an antivirus engine is active and accessing the network drive for the first time always gives a little delay but... it seems that something's going on inside the starpack which slows down the whole "bootstrap" under certain circumstances. Well, maybe the reason is my ugly coding and not the tclkit itself...

Maybe someone can confirm the behaviour in general?

I have to take a deeper look at the output of FileMon and ProcMon.


AMG: I once encountered a program that ran super-slow when run off a network share, yet was fine when running off a local hard disk. It was slow because it did many thousands (tens? hundreds?) of open/read all/close cycles on configuration files stored in the same directory as the program. The tricky part was that these reads were being done deep inside a Windows API call, so it wasn't obvious that they were taking place. Replacing the Windows API call with my own caching implementation made the program fast again.

Perhaps something similar is happening with Starpacks.

AK: IIRC the metakit system tries to access its database (our container for the virtual filesystem) via memory mapping for speed, and falls back on plain read/write calls when the access is over a network, i.e. memory mapping not possible.

AMG: Yeah, that could be it. Maybe metakit needs some caching.

MHo It seems that the starpack reads itself several times (because of the contained VFS) in thousands of separate IO-chunks, each of which are sometimes only 4k or 512 byte in size.


uz - 2010-07-15 20:26:31

I observed the same behaviour with Freewrap: starting from a local network drive is very slow (in the order of 10 to 30 sec) compared to launching from a local drive.

Martyn Smith - 2010-07-16 I use Freewrap as well and have slow startup problems, but not from a network drive, for some reason Freewrap is accessing a non existing /net or /users/martyn directory, which do not exist. The users/martyn is the internal virtual ZIP directory where my code is but for some reason freewrap tries to access this on the external filesystem causing a long timeout.


MHo - 2010-11-11: Unfortunally, again I trapped into the above mentioned quirks. It do makes a difference if a user waits 10 seconds for a program to start or just 1 second. Definitely, starting starpacks from network locations on MS Windows is super slow. And again unfortunally, I can't help an other way that recoding in another language (what is the last thing on my mind). I wonder if this behaviour will change with tclkit 8.6 (which is, on the other hand, much bigger then 8.5 which is much bigger than 8.4 which...).