Overview
| Artifact ID: | d3494e6d687be67973984a4d5cee0ecad4e8006f |
|---|---|
| Ticket: | 3519865fffffffffffffffffffffffffffffffff
[package require] is too slow |
| User & Date: | twylite on 2012-04-25 17:22:41 |
Changes
- icomment:
Effectively sebres is talking about caching. This can be done, and I've done some investigation, but it can be tricky to right for all environments. Background: I use Tcl on a variety of systems including an Atom-based notebook (Windows 7 32-bit) with a 4500rpm HDD. tclsh loads quickly on the notebook, but wish86t.exe takes upwards of 25 seconds to display a console! I have a company project that uses Wub and a bunch of our own packages, and can take over 110 seconds to load. I have found a number of performance killers: (1) we're using a trofs VFS; trofs itself isn't slow but each new source/open causes a CreateFile() which gets the anti-virus involved. (2) missing packages cause a re-[glob] of all library paths (profile [package require ip] from tcllib on a system that doesn't have md5 or critcl if you want to see the effect). (3) [glob] is slow on slow drives (including USB disks, network drives, etc). A caching solution could monitor and cache calls to [package ifneeded], and the [glob] calls done to locate Tcl modules. This would avoid the need to use [glob] and [file exists] in most cases, and improve performance. The catch is that the cache is specific to both the Tcl installation, and the environment in which it is invoked. Two different users on the same PC, or two different users running a network install of Tcl, require different caches. The best approach I know of at the moment is to have a VERSION file in the install (which _must_ be changed if the install changes), and a cache file stored in the users local profile on any given machine. If the local cache is missing or disagrees with the VERSION file, then the cache must be regenerated. I _think_ this handles the problem for Windows. I don't know if it can adapted to improve the performance of portable installs. And I don't know the impact on non-Windows systems.
- login: "twylite"
- mimetype: "text/plain"
- username: "twylite"