Artifacts Associated With Ticket 2981677fffffffff
Ticket change [d262380510] (rid 113527) by dkf on 2010-04-03 23:42:51:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The attached patch shrinks the size of the activation record (stack frame size) of TclExecuteByteCode. This should make it a bit less unfriendly. It also shortens that function quite a bit in terms of number of lines of source code. (Note that it keeps math operations on pairs of longs directly in TEBC if it can; I've not studied whether that is worth it.) Benchmarking with tclbench is inconclusive on this machine at least, but with the state of my sandboxes I could be way off base.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dkf"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to: "Shrink TEBC Activation Record"
- type initialized to: "Patch"
Ticket change [2e2a4f2068] (rid 119176) by dkf on 2010-04-04 06:42:51:
- icomment:
File Added - 369350: tebc.stacksize.patch
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [b08d9a0882] (rid 98002) by msofer on 2010-04-04 19:42:45:
- icomment:
Do we have any way to measure the size of the stack frame?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [33a884a58c] (rid 106632) by dkf on 2010-04-04 21:50:01:
- icomment:
There is a way. Use gdb to disassemble TEBC and look for a line like: add $0x2fc,%esp It's near the very end of the function. That 0x2fc is the activation record size. (There's an equivalent 'sub' near the start of the function too.) I know of no more direct way to get this information. - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [2191c5cb5d] (rid 130607) by dkf on 2010-04-04 21:51:00:
- icomment:
BTW, gdb can take apart tclExecute.o directly for this information. You can skip the linking step.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [9ea32f7e8d] (rid 96513) by ferrieux on 2010-04-04 22:30:00:
- icomment:
To get a more "runtime" view, I tend to extract the address of locals in a caller and a callee of the function of interest. In the TEBC case, a breakpoint in some library func like [socket] yields a stack with TclNRRunCallbacks TclExecuteByteCode NRCallTEBC and extracting "&iPtr" under gdb in both TclNRRunCallbacks and NRCallTEBC yields: (gdb) frame 2 (gdb) print &iPtr $1 = (Interp **) 0xbffff194 (gdb) frame 4 (gdb) print &iPtr $2 = (Interp **) 0xbffff65c so here the offset is 0x4C8. Of course this may also include some contribution from the caller's and callee's activations records, but in this specific case they should be small (neither big local arrays nor alloca).
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [471d49d4b5] (rid 99633) by dkf on 2010-04-09 05:52:14:
- icomment:
File Deleted - 369350:
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [63c61a46bb] (rid 92640) by dkf on 2010-04-09 05:53:00:
- icomment:
File Added - 369946: tebc.stacksize.patch
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [232a394c31] (rid 130873) by dkf on 2010-04-09 06:03:22:
- icomment:
File Deleted - 369946:
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [fa5c918dcd] (rid 91855) by dkf on 2010-04-09 06:04:02:
- icomment:
File Added - 369947: tebc.stacksize.patch
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [aa372d1300] (rid 99289) by dkf on 2010-04-10 05:41:33:
- icomment:
File Deleted - 369947:
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [16af214981] (rid 124755) by dkf on 2010-04-10 05:41:59:
- icomment:
File Added - 370064: tebc.stacksize.patch
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [457e5bc236] (rid 99359) by dkf on 2010-04-23 20:47:01:
- icomment:
File Added - 371637: tebc.stacksize.patch 2.zip
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "tebc.stacksize.patch 2.zip" [f392e8de4d] (rid 133631) by dkf on 2010-04-23 20:47:01.
Ticket change [b2db11a74e] (rid 98416) by dkf on 2010-04-23 20:48:02:
- icomment:
File Deleted - 370064:
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [5bdf6576e1] (rid 118406) by dkf on 2010-04-23 20:51:20:
- icomment:
Find an updated version. This gets TEBC down to a stack size of 524 bytes, which is a lot closer to being reasonable. Again, the results from tclbench are rather difficult to interpret.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [cd5982c082] (rid 95877) by dkf on 2010-04-28 17:53:42:
- assignee changed to: "dkf"
- closedate changed to: "2010-04-28T10:53:42"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Some slight tinkering lead to overall speed improvements with tclbench across all global measures (arithmetic, geometric and harmonic means) so now committed. One other benefit: TEBC is now a shorter function in terms of general source code length. Still scarily full of gotos, but now with only 4700 lines in total... :-)
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "dkf"