View Issue Details

IDProjectCategoryView StatusLast Update
0000133LDMud 3.5LPC Compiler/Preprocessorpublic2009-05-26 08:18
ReporterlarsAssigned To 
PrioritylowSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0000133: Faster function calls
DescriptionCalls to private/nomask functions could be made faster by skipping the argument massaging done for normal functions. Since the functions are private/nomask, the number of arguments taken is known at compile time and can be adjusted there.

Omitting the control frame as well would be possible by storing the previous pc/ap on the stack as well, but for that we would need to mark these functions as inlineable in order to generate the correct 'return' code. This is probably just not worth it.

A simple benchmark is in order, I think.
TagsNo tags attached.

Activities

lynx

2009-05-22 01:50

reporter   ~0001130

Cool. Motivation to put a lot of "private" everywhere! ;)

zesstra

2009-05-26 08:18

administrator   ~0001162

I don't have any hard facts/benchmarks here, but I once wrote some functions containing only a few instructions for implementing a kind of ring buffer in LPC. In the end, the function call overheads were so big, that arr=({foo}) + arr[1..]; was significantly faster (until a host system dependent size, typically around 70-110).
In such cases, it would be interesting to save setting up the control frame and argument massaging.

Issue History

Date Modified Username Field Change
2004-09-30 10:05 lars New Issue
2009-01-08 05:57 zesstra Project LDMud 3.3 => LDMud 3.5
2009-05-22 01:50 lynx Note Added: 0001130
2009-05-26 08:18 zesstra Note Added: 0001162