[Xotcl] OO scripting benchmark

Gustaf Neumann neumann@wu-wien.ac.at
Thu, 27 Sep 2001 21:35:12 +0200


 Dear XOTclers,

 here are some more or less useless benchmarks, which compare XOTcl with
 OTcl, ITcl, stoop and classytcl. everything was done on the same machine
 with tcl 8.3.2 and the forthcoming XOTcl 0.9 version.

 The short summary: XOTcl compares very well with OTcl, methodcalls are
 faster than in itcl, but object creation is still slower. For the memory
 consumption for objects, XOTcl is now better than itcl or OTcl. 
 The xotcl numbers are with uwe's new "namespace on demand" code,
 where the namespace is only allocated when needed (e.g. when procs or
 children are added).

 The first benchmarks are from  http://www.bagley.org/~doug/shootout.
 Methcall measures the speed of the method invocation, objinst creates
 objects and does a few operations on it. The reported times are from the
 unix time command (user/system/elapsed time)

XOTcl
  methcall:  0.700u 0.000s 0:00.70 101.4%	0+0k 0+0io 282pf+0w
  objinst:   2.390u 0.010s 0:02.40 100.0%	0+0k 0+0io 282pf+0w
OTcl
  methcall:  1.370u 0.000s 0:01.36 100.7%	0+0k 0+0io 330pf+0w
  objinst:   3.090u 0.000s 0:03.09 100.0%	0+0k 0+0io 330pf+0w
itcl
  methcall:  1.060u 0.000s 0:01.06 100.0%	0+0k 0+0io 285pf+0w
  objinst:   2.010u 0.020s 0:02.03 100.0%	0+0k 0+0io 286pf+0w
stooop
  methcall:  2.350u 0.010s 0:02.57 91.8%	0+0k 0+0io 259pf+0w
  objinst:   4.780u 0.010s 0:04.81 99.5%	0+0k 0+0io 259pf+0w
classytcl
  methcall:  1.040u 0.030s 0:01.07 100.0%	0+0k 0+0io 284pf+0w
  objinst:   2.990u 0.050s 0:03.07 99.0%	0+0k 0+0io 284pf+0w


These folowing numbers compare the speed and memory consumption 
for creating 10000 objects. The memory consumption is not only 
the XOTclObject structure, but as well everything allocated
by Tcl as well. The test compares the memory size reported
by ps before and after the creation of 10000 objects.

        Memory per object     creation time
itcl         299                    33
OTcl         277                    72
XOTcl        210                    40
ClassyTcl    175                    16
Stooop       124                    96


 all the best

-gustaf neumann