Thanks. It's good to know the solution worked well. I have a little performance test that auto generates a script with ~40 thousand lines, and then compiles it. With the optimizations the compilation time improved almost 4 times, but the autogenerated script doesn't really reflect a real world script, so I wasn't too sure the improvements would be that good.
I'll see if I get the time to look into improving the GetFunctionDescriptions. 30% of the time is quite a bit, and it shouldn't be too difficult to replace the current linear searches by storing the functions in a map, similar to the enhancement done for the string constants by vroad.
The asCompareStrings() function is more difficult to improve. It would be easier to eliminate the string comparisons from the calling functions. Can you see where it is called the most? GetFunctionDescriptions() would be one one of them, but where else?
Compile performance notes.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
As an additional, slightly dumb trick, have you investigated using something like Boost's flat_map structure? Since the number of tokens can be easily predicted and isn't likely to change at all once the lookup table is constructed, this could be an interesting (and fairly easy) way to avoid cache misses. For the uninitiated, it's basically a vector-based map structure that sorts the contents in a method similar to how std::map works instead of using a linked list structure to hold entries.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.
Thanks for the tip. I'll have a look at boost's flat_map structure to see if it something I can easily use.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement