|
2010-04-28
| ||
| 17:53 | • Closed ticket [2981677fff]: Shrink TEBC Activation Record plus 8 other chang... artifact: cd5982c082 user: dkf | |
|
2010-04-23
| ||
| 20:51 | • Ticket [2981677fff]: 4 changes artifact: 5bdf6576e1 user: dkf | |
| 20:48 | • Ticket [2981677fff]: 4 changes artifact: b2db11a74e user: dkf | |
| 20:47 | • Ticket [2981677fff]: 4 changes artifact: 457e5bc236 user: dkf | |
| 20:47 | • Add attachment tebc.stacksize.patch 2.zip to ticket [2981677fffffffff|2... artifact: f392e8de4d user: dkf | |
|
2010-04-10
| ||
| 05:41 | • Ticket [2981677fff] Shrink TEBC Activation Record status still Open with 4 o... artifact: 16af214981 user: dkf | |
| 05:41 | • Ticket [2981677fff]: 4 changes artifact: aa372d1300 user: dkf | |
|
2010-04-09
| ||
| 06:04 | • Ticket [2981677fff]: 4 changes artifact: fa5c918dcd user: dkf | |
| 06:03 | • Ticket [2981677fff]: 4 changes artifact: 232a394c31 user: dkf | |
| 05:53 | • Ticket [2981677fff]: 4 changes artifact: 63c61a46bb user: dkf | |
| 05:52 | • Ticket [2981677fff]: 4 changes artifact: 471d49d4b5 user: dkf | |
|
2010-04-04
| ||
| 22:30 | • Ticket [2981677fff]: 4 changes artifact: 9ea32f7e8d user: ferrieux | |
| 21:51 | • Ticket [2981677fff]: 4 changes artifact: 2191c5cb5d user: dkf | |
| 21:50 | • Ticket [2981677fff]: 4 changes artifact: 33a884a58c user: dkf | |
| 19:42 | • Ticket [2981677fff]: 4 changes artifact: b08d9a0882 user: msofer | |
| 06:42 | • Ticket [2981677fff]: 4 changes artifact: 2e2a4f2068 user: dkf | |
|
2010-04-03
| ||
| 23:42 | • New ticket [2981677fff]. artifact: d262380510 user: dkf | |
Shrink TEBC Activation Record
Closed / Accepted2981677fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-04-03 23:42:51
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.
dkfplain2010-04-04 06:42:51
File Added - 369350: tebc.stacksize.patch
msoferplain2010-04-04 19:42:45
Do we have any way to measure the size of the stack frame?
dkfplain2010-04-04 21:50:01
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.
dkfplain2010-04-04 21:51:00
BTW, gdb can take apart tclExecute.o directly for this information. You can skip the linking step.
ferrieuxplain2010-04-04 22:30:00
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).
dkfplain2010-04-09 05:52:14
File Deleted - 369350:
dkfplain2010-04-09 05:53:00
File Added - 369946: tebc.stacksize.patch
dkfplain2010-04-09 06:03:22
File Deleted - 369946:
dkfplain2010-04-09 06:04:02
File Added - 369947: tebc.stacksize.patch
dkfplain2010-04-10 05:41:33
File Deleted - 369947:
dkfplain2010-04-10 05:41:59
File Added - 370064: tebc.stacksize.patch
dkfplain2010-04-23 20:47:01
File Added - 371637: tebc.stacksize.patch 2.zip
dkfplain2010-04-23 20:48:02
File Deleted - 370064:
dkfplain2010-04-23 20:51:20
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.
dkfplain2010-04-28 17:53:42
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... :-)
Log in (anonymous is fine) to add a comment.
Attachments:
- tebc.stacksize.patch 2.zip [download] added by dkf on 2010-04-23 20:47:01. [details]