From: SourceForge.net <no...@so...> - 2003-08-02 02:30:45
|
Bugs item #781585, was opened at 2003-08-01 13:22 Message generated for change (Comment added) made by msofer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=781585&group_id=10894 >Category: 46. Bytecode Compiler Group: 8.4.4 Status: Open Resolution: None Priority: 5 Submitted By: Franco Violi (effevi) Assigned to: Jeffrey Hobbs (hobbs) Summary: Interpreter 10 time slower then 8.3.3 Initial Comment: This small program show something wrong on 8.4.4 against 8.3.3. Try as is on 8.4.4 and the do the same uncommenting the append statement. #!/usr/bin/tngsh set buffout [string repeat x 3000000] proc goappend {} { global buffout switch x { x { append buffout "1" } } # # uncomment this line to see the code much more slower !! # # append buffout "x" # return 1 } for {set i 0} {$i < 3000} {incr i} { goappend puts "append $i" } ---------------------------------------------------------------------- >Comment By: miguel sofer (msofer) Date: 2003-08-01 23:30 Message: Logged In: YES user_id=148712 Verified in 8.4.3 and 8.4.2 too. The following script isolates a bit the probable causes: - [switch] is innocent; what seems to cause the problem is that append is called "mixed" (once bytecompiled, once invoked) - it is not obvious that it is caused by the new variable tclObjTypes (but they remain a prime suspect tomy eyes) - [global] is innocent, although it is important that this a global variable. The behaviour is identical if we use [global buffout] instead of the fully qualified name ::buffout set buffout [string repeat x 300000] proc goappend {w} { set append append if {$w == 0} { $append ::buffout "1" $append ::buffout "1" } elseif {$w == 1} { $append ::buffout "1" append ::buffout "1" } else { append ::buffout "1" append ::buffout "1" } } puts [info patch] puts [time {goappend 0} 3000] puts [time {goappend 1} 3000] puts [time {goappend 2} 3000] Output: 8.4.3 13 microseconds per iteration 2273 microseconds per iteration 11 microseconds per iteration 8.4.2 8 microseconds per iteration 2231 microseconds per iteration 7 microseconds per iteration 8.3.4 13 microseconds per iteration 13 microseconds per iteration 12 microseconds per iteration ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=781585&group_id=10894 |