Overview
| Artifact ID: | 606bc9f71345ff83067939b0998874d7393e7753 |
|---|---|
| Ticket: | 3519865fffffffffffffffffffffffffffffffff
[package require] is too slow |
| User & Date: | twylite on 2012-04-25 18:46:13 |
Changes
- icomment:
It really _is_ a caching problem: 1. Each pkgIndex.tcl is a proper Tcl script and can take actions that are specific to the absolute or relative location of the script, or to the environment. It is not possible - without imposing unenforceable rules on what pkgIndex.tcl can do - to automate the combination of multiple pkgIndex.tcl files. A simple [file dirname [info script]] - common in pkgIndex files - won't work in a merged script without an emulation layer to Do The Right Thing. 2. Various scripts modify auto_path, or use catch { package require somePkg } to attempt to load package that may or may not be present. Either will cause a rescan for pkgIndex files. 3. Nothing is stopping a pkgIndex from using [glob] to discover files for which to issue [package ifneeded] commands. I've been using this sort of "magic indexing" to do something akin to Tcl Modules, long before there were Tcl Modules. 4. Merging pkgIndex files doesn't avoid the [glob] calls in ::tcl::tm::UnknownHandler. Combining multiple pkgIndex files into one can work in simple cases, and can result in a limited performance improvement in simple cases. But it is not a general solution, and it doesn't work for every package out there. It is certainly possible to build a better makeIndex with a different packaging mechanism, but that doesn't solve the problem for developers who are experiencing slow startup performance with Tcl _right now_. - login: "twylite"
- mimetype: "text/plain"
- username: "twylite"