Slow Itcl class variable lookup
From: David N. Welton (davidw_at_dedasys.com)
Date: 02/27/04
- Next message: arenaTR: "Text Widget"
- Previous message: Don Libes: "Re: SSH via Expect disconnects"
- Next in thread: David N. Welton: "Re: Slow Itcl class variable lookup"
- Reply: David N. Welton: "Re: Slow Itcl class variable lookup"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 27 Feb 2004 17:20:35 GMT
proc timeprint {script} {
return [lindex [uplevel [list time $script 1]] 0]
}
::itcl::class Book {
public variable idnum
public variable title foo
public variable category bar
public variable subcategory
...
}
set i 0
while {$i < 10000} {
lappend cl [Book \#auto]
incr i
}
foreach c $cl {
puts [timeprint { set ttl [$c cget -title] }]
puts [timeprint { set cat [$c cget -category] }]
}
Reports values like these:
100
93
101
92
100
93
100
93
Which seems ok. The problem is that for similar code in my program,
I'm getting much larger numbers:
374
364
369
389
372
364
366
427
381
367
368
and since I'm dealing with a lot of objects, this slows things down a
lot:-/ Any ideas on what could be causing this, or how to speed it up?
-- David N. Welton Consulting: http://www.dedasys.com/ Personal: http://www.dedasys.com/davidw/ Free Software: http://www.dedasys.com/freesoftware/ Apache Tcl: http://tcl.apache.org/
- Next message: arenaTR: "Text Widget"
- Previous message: Don Libes: "Re: SSH via Expect disconnects"
- Next in thread: David N. Welton: "Re: Slow Itcl class variable lookup"
- Reply: David N. Welton: "Re: Slow Itcl class variable lookup"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|