Re: package command sloow



rene schrieb:
Hi,

the following pkgIndex.tcl file takes some seconds for the first
"package require ..." command.

package ifneeded pkgA 0.1 "
if {[catch {package require pkgB}]} {source [file join $dir
pkgb.tcl]}
source [file join $dir pkga.tcl]
package provide pkgA 0.1"

A simple "catch {package require pkgB}" or "source [file join $dir
pkgb.tcl]" is fast. Is there a better way to go?

Yes, if you can influence your Tcl installation. Don't put your packages
into /usr/lib/..., the standard package command scans all subdirs of
/usr/lib for pkgIndex.tcl files...
Tcl modules (for Tcl 8.5) reduce some of this time too.

Michael

.



Relevant Pages

  • Re: Ran ccmclean on site server, what are implications???
    ... i ran the synctool command line in a cmd running under system account using ... The sync tool only has to retrieve the files from the distribution share ... only created the package folder. ... baffles me that the advanced client that resides on the sms ...
    (microsoft.public.sms.setup)
  • Re: What are the core packages for a desktops Linux desktop distribution?
    ... Your use of the term package is a bit confusing ... You'll need the mount command as well. ... As for Gnome, if you are going for minimalism, I ... wouldn't install it - you don't need it. ...
    (comp.os.linux.misc)
  • Re: Life on the Command Line
    ... Gutsy as the IM package or the ICQ package. ... There are a lot of games you can play in the Command Line, ... terminals in one window (like tabbing, except it can be used everywhere, ...
    (Ubuntu)
  • Re: now do you "link" .tcl files?
    ... I think from the position of a newbie, this is how linking in Tcl ... At the time of the call, Tcl looks up the command named "foo" using ... pkgIndex.tcl for a Tcl-only package usually contains ...
    (comp.lang.tcl)
  • Re: perl menubased user interface
    ... actually use a perl package OR a hash for this, In a "perl package" ... sub map_method { ... # and they're all shell commands. ... Do whatever you want to wrap a shell command. ...
    (comp.lang.perl.misc)