Skip to content
Tcl Source Code View Ticket
Login

View Ticket

More efficient Tcl_AppendResult

Closed / Accepted1041072fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-10-05 22:50:27
This makes Tcl_AppendResultVA (and hence
Tcl_AppendResult) more suitable for the Tcl_Obj world :^)

Does not touch the rest of the file.
dkfplain2004-10-06 05:50:28
File Added - 103960: result.diff
dkf Closed ticket [1041072fff]. [History diff]2004-10-06 06:22:39
dkfplain2004-10-06 06:22:40
Logged In: YES 
user_id=79902

Accepted with minor modifications (thanks jenglish and dgp!)
dgpplain2004-10-27 01:16:31
Logged In: YES 
user_id=80530

backport?
dgp Open ticket [1041072fff]. [History diff]2004-11-18 05:33:13
dgpplain2004-11-18 05:33:14
Logged In: YES 
user_id=80530


This patch killled the performance
of Tk test canvPs-3.1.  See Tk
Bug 1041475.
dgpplain2004-11-18 06:07:58
Logged In: YES 
user_id=80530


The [$canvas postscript] command
creates the postscript description
of the $canvas contents directly
in the interp result with calls to
Tcl_AppendResult().

The canvPs-3.1 test makes tens of
thousands of T_AR calls.

WIthout this patch, those tens of
thousands of calls happen in 
the blink of an eye.  With this patch,
they take > 30 seconds.

Since the intent of this patch
was to make things more efficient,
I think it's not working and should
be reverted.

Attached is an "undo" patch that
will do that.
dgpplain2004-11-18 06:08:01
File Added - 109141: undo.patch
dgpplain2004-11-18 23:00:20
Logged In: YES 
user_id=80530


As an alternative to an undo,
simply removing the final
Tcl_GetStringResult() call
from Tcl_AppendResultVA
also restores the lost performance.

That is, that monumental runtime
price is paid solely to maintain
interp->result.
dkfplain2004-11-23 07:21:07
Logged In: YES 
user_id=79902

Since that only adversely affects ancient apps that insist
on fiddling with interp->result directly (Expect is such an
app still AIUI), I've just removed the call to
Tcl_GetStringResult(). Anyone who really wants it in (and
who has read this thread carefully so they understand the
consequences) can define the preprocessor symbol
USE_DIRECT_INTERP_RESULT_ACCESS when building tclResult.c...
Log in (anonymous is fine) to add a comment.

Attachments: