Tcl Source Code

View Ticket
Login
Ticket UUID: 1077262
Title: redo refcounting of encodings
Type: RFE Version: None
Submitter: dgp Created on: 2004-12-02 02:36:16
Subsystem: 38. Init - Library - Autoload Assigned To: dgp
Priority: 7 High Severity:
Status: Closed Last Modified: 2005-07-06 04:11:55
Resolution: Fixed Closed By: dgp
    Closed on: 2005-07-05 21:11:55
Description:
encodings are freed too easily.

Once an encoding has been used
by a program at all, it should be kept
loaded, since it's likely to be needed
again.

As is, the [encoding convertfrom]
command will load an encoding
from a disk file, +count, use it,
-count, and destroy it, all before
returning.  Makes for many too many
disk reads.

Changing the refcounts
should not be too hard, but
there's also work to do updating
the tests in the test suite that
actually insist on this rapid
purge of encoding data.
User Comments: dgp added on 2005-07-06 04:11:55:
Logged In: YES 
user_id=80530


heh.  oh well.  Committing for 8.4.12 anyway.

Closing;  will open Tcl_GetEncodingFromObj()
RFE separately.

dgp added on 2005-06-03 02:59:12:
Logged In: YES 
user_id=80530

this slipped 8.4.10;

raising priority so it makes 8.4.11

dgp added on 2005-04-28 04:57:19:

File Added - 132026: 1077262-84.patch

dgp added on 2005-04-28 04:57:17:
Logged In: YES 
user_id=80530


Here's the corresponding patch
for the 8.4 branch.

dgp added on 2005-04-09 03:03:46:
Logged In: YES 
user_id=80530

patch committed.

Leaving report open as a prompt
to consider moving the new
TclGetEncodingFromObj to
the public interface.

dgp added on 2005-04-09 02:57:23:

File Added - 129104: 1077262.patch

Logged In: YES 
user_id=80530


attached patch uses a Tcl_ObjType
to cache Tcl_Encoding as an
internal rep, and updates the
[encoding convert*] commands to
use it, fixing the worst of these
problems.

hobbs added on 2004-12-03 01:10:57:
Logged In: YES 
user_id=72656

Perhaps a cache (quasi like REs have) of the last 10 used
encodings get an extra refcount?  That way we have a pointer
to free on exit, and we don't keep all used encodings loaded.

Attachments: