Subject: 8.1 slower then 8.0??? - DN [1]


John McLaughlin <johnmcl@mailexcite.com> - 08 May 1999 - comp.lang.tcl

 I was playing with the newly released 8.1 the other day and I decided to
 take a peek at performance.  I honestly expected it to be the same or
 perhaps a hair better but I am suprised to find that it appears as if it
 actually may be quite a bit worse!

 First my setup:

 Linux Redhat 5.2
 tcl 8.0.3 (as it comes with RedHat)
 tcl 8.1 (./configure with no options then compile)
 450MHz PII

 For the most simple things 8.1 seems a hair faster, but as the work
 get's more complicated it seems to slow down quite a bit!

                      8.0           8.1
                    ------       -------
 Empty Proc          6us            5us
 Factorial 10       480us         512us

 String Reversal
 of len 128        1.4ms           1.7ms
 of len 4096       41ms           532ms (Yes that's correct 10x
 slower?!?)

 I tried recompiling 8.1 with -O4 but it didn't change the results at
 all, I realize that this is not an exhaustive test but for the few test
 cases *I* have run 8.1 ends up being slower.  Has anyone done research
 on 8.1 performance and is this known or did I do something wrong?

 The other question it begs is what *is* the performance of 8.1 (in
 general) compared to 8.0?

 -John

 (for reference my fact & string reversal scripts were, I really have not
 tried to optimize them I just tossed them together)

 proc fact { n } {
         if { $n == "1" } {
      return 1
     }

     return [ expr $n*[fact [ expr $n - 1 ] ] ]
 }

 proc tclStrrev s {
     set length [ string length $s ]

     for { set i $length } {$i >= 0 } { incr i -1 } {
  append rev [ string index $s $i]
     }
     return $rev
 }

Last modified
1999-09-27

(195.108.246.50)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated