Overview
| Artifact ID: | 1a82157f5dd478e8b6a88e43c7465715b2319599 |
|---|---|
| Ticket: | 3519865fffffffffffffffffffffffffffffffff
[package require] is too slow |
| User & Date: | basilik99 on 2012-04-20 15:46:45 |
Changes
- assignee changed to: "mistachkin"
- cmimetype changed to: "text/plain"
- comment changed to:
Hi, As we find at multiple places on the Net, a problem with Tcl is the slowness of [package require] commands. My Tcl distribution is on a network drive and I cannot change that. Here is my loading time: % time {package require tdom; package require md5} 8310807 microseconds per iteration And I also computed 8 seconds on my watch. Very slow... For small scripts that run often, this is big problem. It tends developpers to avoid using any packages. Tclx is a good example: re-code yourself its simple functions if you can to avoid its long loading time! I searched the Internet to see if it could be possible to load packages in background, i.e. when the main Tcl code is interrupted by the OS (during [glob] or [read] commands, or anything that makes the OS interrupt our process). I didn't find anything. I tried the [after] command, but that is not true multiprocessing so [after idle] command is not executed while accessing the I/Os. I would like them to be loaded in background for situations where I don't need these packages right away. I could start doing work while the packages load, then wait for the [package require] cpmpletion and then use the package commands. The overral script time would be smaller. I looked a bit at the Thread package. But I don't think a children thread can load a package for the main program. I doubt that the tdom package for example will be visible in the main script. I also looked at the threaded version of tclsh (base-tcl8.6-thread-win32-ix86.exe), but I didn't understand its benefits... Is there a solution to this problem? Is loading a package into another process possible? Thanks, Etienne - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "basilik99"
- subsystem changed to: "49. Threading"
- title changed to: "Running [package require] in background"
- type changed to: "RFE"