Re: Obviating init.tcl



I imagine this would make [interp create] a *lot* more lightweight.

I've done some quick tests, using a critcl interface to prevent the
init search and evaluation from occurring. The results are
significantly faster [interp create].

Here's the data:

Normal interp create: 11162.625 microseconds per iteration
Fast interp create: 3780.4 microseconds per iteration
Reverted interp create :11232.925 microseconds per iteration

Here's the code:

lappend auto_path lib/preinit/
package require preinit

puts "Normal interp create: [time {interp create} 40]"
preinitscript {
proc tclInit {} {}
}
puts "Fast interp create: [time {interp create} 40]"
preinitscript {}
puts "Reverted interp create :[time {interp create} 40]"

.



Relevant Pages

  • Re: interp questions
    ... > Is the interp command cross-platform? ... > interp, but if anyone has experience or feedback on just how much, I ... 206 microseconds per iteration ...
    (comp.lang.tcl)
  • Re: How expensive are interps to create and initialize?
    ... >>5456 microseconds per iteration ... > Thanks, that's useful info. ... > a better way or well known Tcl design pattern to solve my problem. ... and let the interp cache them automatically. ...
    (comp.lang.tcl)