RE: [tcltk-perl] Re: [Activetcl] why simple Tcl script have very different execution time...
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-10-19 03:44:55
|
> I noticed this as well. What I came to recognize is that > when executing > a script, you must wait for the scripting engine to load, > then compile, > then execute your script. > When you are already inside an interpreter allot of that time > is cut down. Suppose loading of external moduels takes some amount of time, but how could it be explained that after changing 1000000 with 10000000 in that script there is 35 seconds of deifference in execution time?? Time for loading modules should be added to total execution time, not multiplied. I would rather suspect some tricks with pre-compilations and different number of memory allocations, but I am no knowledgable here, in Tcl source code... > You may wish to try writing a script that launches and loads > all of the > required extensions, then sources your application files. > > You will notice a speed increase even on your one liner. interesting to note, I invoked tclsh, and then typing source a.tcl and for {set i 0} {$i < 1000000} {incr i} {} differs in execution time also... Thanks for your ideas on the matter! > > Konovalov, Vadim wrote: > > >why simple Tcl script have very different execution time > when invoked from > >file and from tclsh? > > > >Give following simple script: > > > >for {set i 0} {$i < 1000000} {incr i} {} > > > >If invoked from file: > > tclsh a.tcl > > > >finishes execution in about 6 seconds on my PC. > > > >When I input same string from within "tclsh" shell it > finishes in 3 seconds. > > > >Same behaviour (but larger execution time) when I replace > 1000000 with > >10000000 --- 60 and 25 seconds appropriately > > > >How this could be explained? Better yet, how can I speed up > worse case to be > >in line with best one? > > > >I used ActiveTCL version 8.4.6 > > > >Thanks in advance. > > > >Vadim. > >_______________________________________________ > >ActiveTcl mailing list > >Act...@li... > >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on > ITManagersJournal > Use IT products in your business? Tell us what you think of > them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to > find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Tcltk-perl mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcltk-perl > |