Tcl Source Code

View Ticket
Login
Ticket UUID: 1041072
Title: More efficient Tcl_AppendResult
Type: Patch Version: None
Submitter: dkf Created on: 2004-10-05 22:50:27
Subsystem: 45. Parsing and Eval Assigned To: dkf
Priority: 7 High Severity:
Status: Closed Last Modified: 2004-11-23 07:21:07
Resolution: Accepted Closed By: dkf
    Closed on: 2004-11-23 00:21:07
Description:
This makes Tcl_AppendResultVA (and hence
Tcl_AppendResult) more suitable for the Tcl_Obj world :^)

Does not touch the rest of the file.
User Comments: dkf added on 2004-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...

dgp added on 2004-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.

dgp added on 2004-11-18 06:08:01:

File Added - 109141: undo.patch

dgp added on 2004-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.

dgp added on 2004-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.

dgp added on 2004-10-27 01:16:31:
Logged In: YES 
user_id=80530

backport?

dkf added on 2004-10-06 06:22:40:
Logged In: YES 
user_id=79902

Accepted with minor modifications (thanks jenglish and dgp!)

dkf added on 2004-10-06 05:50:28:

File Added - 103960: result.diff

Attachments: