Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Adding constants in ExecEnv

Closed / Out of Date441372ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 22 years ago
Descriptionplain2001-07-15 00:42:01
The patch defines 4 "constant" Tcl_Obj in the execution
environment: "zero", "one", "minus one" and "empty
object".
The purpose is to avoid some unnecessary object
creation/destruction, especially of boolean values.

There is a zero-to-minimal positive effect in tclbench
results; it may be larger for threaded builds.
msoferplain2001-07-15 07:42:02
File Added - 8425: bench.const3
msoferplain2001-07-15 07:51:16
File Added - 8426: patch.txt
hobbsplain2001-07-17 01:50:49
Logged In: YES 
user_id=72656

My guess is this has minor benchmark effects because it 
only minorly affect small obj allocations.  However, it may 
be a more notable effect on mem usage (any good ways to 
check that in a practical manner?).

Anyway, this should be run through purify or efence before 
getting commited.
msoferplain2001-07-17 18:40:17
Logged In: YES 
user_id=148712

I do not expect a large memory effect either: most of the
things that are changed involve relatively short lived
Tcl_Obj. Boolean values for instance are typically consumed
right after creation.

One exception could be when setting large numbers of
variables to {} via the idiom
   foreach varName $someList {.} break
which sets the first variable to "." and the rest per
default to {}. This idiom is used in both implementations of
set operations in the wiki (soon in tcllib and tclbench?),
(see http://mini.net/tcl/271.html).
msoferplain2001-09-14 22:56:14
Logged In: YES 
user_id=148712

Mhh ... the idiom is actually
  foreach $varNameList {{}} break
which sets the variables whose names are in $varNameList to
the empty object {}
hobbs Ticket [441372ffff]: 1 change [History diff]2002-06-20 05:42:50
hobbsplain2002-06-20 05:42:51
Logged In: YES 
user_id=72656

pushing this back to miguel due to the number of changes he 
has made to TEBC recently.
msoferplain2005-04-05 21:12:27
Logged In: YES 
user_id=148712

Parts of this have been incorporated into 8.5a3
Log in (anonymous is fine) to add a comment.

Attachments: