Artifacts Associated With Ticket 738900
Ticket change [3d0a150fd2] (rid 121023) by dgp on 2003-05-16 18:13:44:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
If a Tcl_Obj is a single value, we lose it's intrep when converting to the "list" objType. We can avoid loss of intrep by just making the object into the first element of the objPtr array of the List struct, so long as we're careful about string reps that would be broken into multiple elements. Here's a patch that almost works. It makes test append-4.8 fail. Comments?
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "14. List Object"
- title initialized to: "limit shimmer of singleton lists"
- type initialized to: "Patch"
Add attachment "shimmer.patch" [7a89b7a00e] (rid 90341) by dgp on 2003-05-17 01:13:44.
Ticket change [bde9e714eb] (rid 101989) by dgp on 2003-05-17 01:13:44:
- icomment:
File Added - 50519: shimmer.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [97fa100ddd] (rid 110533) by kennykb on 2007-04-20 12:03:38:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=99768 Originator: NO Is this still an issue after so long? (I know that you have been in the code a good bit more recently than I have.) Don's patch no longer applies. Avoiding shimmer of singletons sounds like a good idea, if we can make it go.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
Ticket change [0fb073a421] (rid 94836) by msofer on 2007-04-21 00:52:59:
- assignee changed to: "dgp"
- icomment:
File Added - 225855: listDiff Logged In: YES user_id=148712 Originator: NO Attached a current patch with three shortcuts: - it avoids most work for empty strings - it avoids computing the string rep for numbers - it avoids losing the internal rep for singletons that do not have a string rep I am a bit mystified as to why the qualification about not having a string rep is necessary; without it, failures at: append-4.8, appendComp-4.8, opt-[3.1/3.2/5.1], safe-7.2 File Added: listDiff
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
Ticket change [b16ba505ad] (rid 98137) by msofer on 2007-04-21 02:50:28:
- icomment:
File Deleted - 225855: File Added - 225875: listDiff Logged In: YES user_id=148712 Originator: NO New patch after first comments File Added: listDiff
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Add attachment "listDiff" [c40540380e] (rid 111775) by msofer on 2007-04-21 02:50:28.
Add attachment "listDiff2" [d8f5ea0db9] (rid 107530) by msofer on 2007-04-21 04:35:55.
Ticket change [9018ff4645] (rid 120388) by msofer on 2007-04-21 04:35:55:
- assignee changed to: "msofer"
- closedate changed to: "2007-04-20T21:35:55"
- closer changed to: "msofer"
- icomment:
File Added - 225892: listDiff2 Logged In: YES user_id=148712 Originator: NO Mystery solved: a string that contains backslashes or braces needs full parsing. Updated patch, committed. File Added: listDiff2
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "msofer"
Ticket change [1d212915a9] (rid 90743) by hobbs on 2007-04-25 02:21:57:
- icomment:
Logged In: YES user_id=72656 Originator: NO This patch causes Tk's border-1.1, bitmap-1.1 and cursor-1.1 to fail.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "8"
- status changed to: "Open"
- username: "hobbs"
- icomment:
Ticket change [371816b1ec] (rid 107219) by msofer on 2007-04-25 05:35:29:
- icomment:
Logged In: YES user_id=148712 Originator: NO * generic/tclListObj.c: reverting [Patch 738900] (committed on 2007-04-20). Causes some Tk test breakage of unknown importance, but the impact of the patch itself is likely to be so small that it does not warrant investigation at this time.
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- resolution changed to: "Postponed"
- username: "msofer"
- icomment:
Add attachment "aspect-singleton-list-738900.patch" [a4d9149d24] (rid 148370) by aspect on 2016-08-19 13:10:47.
Ticket change [d5c3ef48f9] (rid 148371) by aspect on 2016-08-19 13:17:17:
- closer changed to: "nobody"
- comment changed to:
If a Tcl_Obj is a single value, we lose it's intrep when converting to the "list" objType. We can avoid loss of intrep by just making the object into the first element of the objPtr array of the List struct, so long as we're careful about string reps that would be broken into multiple elements. Here's a patch that almost works. It makes test append-4.8 fail. Comments?
- icomment:
Attached aspect-singleton-list-738900.patch which is against trunk [632e9e93f1]. This handles numeric types and tclEndOffsetType and doesn't cause any new test failures in Tcl. I have some failures in the Tk test suite, but none of those mentioned below - they seem to be related to my desktop/wm/fonts. Not sure what test cases should be added to verify this patch? There's probably some synergy between this and branch [pyk-emptystring] which could be exploited.
- login: "aspect"
- mimetype: "text/plain"
- severity changed to: "Minor"
Ticket change [839f620292] (rid 148379) by ferrieux on 2016-08-19 17:12:23:
- icomment:
To verify, you can simply parse [::tcl::unsupported::representation]'s output on typical shimmering paths. Sure, that's exactly what we try to discourage, but who reads the test suite ? ;-) Now looking at the current implementation, there's still a problem with canonicity, and I believe that may be the reason for the ill-understood breakage mentioned earlier: beware of any existing string rep for the incoming number ! Demo script: set x " 1.3 ";expr {log($x)};llength $x;puts A[lindex $x 0][lindex $x 0]B Output with trunk: A1.31.3B Output with patch: A 1.3 1.3 B As you can see, the problem is that you keep the intrep (possibly noncanonical, e.g. with extra space) of the incoming number both for the "boxed" number and the list: % tcl::unsupported::representation $x value is a list with a refcount of 6, object pointer at 0x1c325d0, internal representation 0x1c411d0:(nil), string representation " 1.3 " % tcl::unsupported::representation [lindex $x 0] value is a double with a refcount of 2, object pointer at 0x1c366e0, internal representation 0x3ff4cccccccccccd:(nil), string representation " 1.3 " While I think only the list (the toplevel object that we are delicately shimmering) should keep that intrep (and be sure to set isCanonical to FALSE), and the boxed number should have no string rep. - login: "ferrieux"
- mimetype: "text/plain"
- icomment:
Ticket change [b539eb8383] (rid 148381) by ferrieux on 2016-08-19 17:18:07:
- icomment:
TYPO ALERT!!! Wherever I wrote "intrep" in the previous comment, of course I meant "strep" (string representation)... Sorry...
- login: "ferrieux"
- mimetype: "text/plain"
- icomment:
Ticket change [759a3e7deb] (rid 148383) by ferrieux on 2016-08-19 21:25:26:
- icomment:
The attached patch shimmer-alex.patch avoids the pitfall by using a new "TclDupShaved" utility that duplicates an object (with an intrep) *without* carrying along its strep. That's faster than first duplicating, then freeing the strep. Output with trunk: A1.31.3B Output with patch: A1.31.3B As you can see, EIAS is back :P % tcl::unsupported::representation $x value is a list with a refcount of 4, object pointer at 0x13cdfb0, internal representation 0x13f7b50:(nil), string representation " 1.3 " % tcl::unsupported::representation [lindex $x 0] value is a double with a refcount of 2, object pointer at 0x13d0200, internal representation 0x3ff4cccccccccccd:0x13ce040, string representation "1.3"
- login: "ferrieux"
- mimetype: "text/plain"
- icomment:
Add attachment "shimmer-alex.patch" [597bf65e91] (rid 148385) by ferrieux on 2016-08-19 21:35:42.
Ticket change [f011afb84b] (rid 148386) by aspect on 2016-08-20 03:18:14:
- icomment:
Well spotted with the stringrep problem - your patch looks good to me and I like DupShaved; that will likely prove useful for other related micro-optimisations. When I get some more time I'll try to come up with some suitable tests - hopefully I've contacted Andreas correctly and will be able to put these on a branch that's a little bit easier to integrate than random patchsets. fwiw, my timezone is utc+10
- login: "aspect"
- mimetype: "text/plain"
- icomment: