I'm thinking about the differences between two methods of passing a list to a procedure:
First one is classical:
proc myproc1 {l} {}
set l [list 1 2 3]
myproc1 $l
Second one uses upvar:
proc myproc2 {lname} {upvar $lname l}
set l [list 1 2 3]
myproc2 l
My tests show that first one is faster than second one. At least for lists of thousends of elements.
Does the second method also has advantages regarding the memory consuption or are the two methods identical from this point of view?
Thanks
Alex
Speed and Memory with upvar
- From
- meshparts <alex…@meshparts.de>
- Message-ID
- <11dn…@tota-refugium.de>
- Date
- Newsgroups
- comp.lang.tcl