I'm having problems with this script.

Started by
12 comments, last by Rain Dog 19 years, 5 months ago
When you have been working on improving the speed and optimizing the engine, have the optimizations and speed improvements been mainly in the execution of the script or have they taken place all around?
Advertisement
So far I've basically only worked on optimizing the execution speed, which is obviously the most important part.

I promise that for the next release the compilation speed will be improved as well (I can't promise how much though [wink]).

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I'm pleased to announce that the next WIP will have build times about 10 times shorter than previous versions. This may of course depend on the size of the script, where larger scripts get better improvements.

Your script may take as little as 0.25 seconds to compile now.

This increase in performance was because of one function. asCScriptCode::ConvertPosToRowCol(). I had made an incredibly naïve implementation, that simply took the character position in the script code and counted the number of lines to that position. Now I precalculate the positions of each line, and do a binary search in this list of lines to find the line where the position is located.

I also wanted to take the opportunity to do a little commercial for an excellent profiler tool that I used to help me find this: LTProf. It's very easy to use.

I will make another tests with strings and see how I can improve the performance for them. Though I think I know the solution already: The string constants needs to be stored in a hash tree (or something similar) so that when a string constant is created it doesn't have to compare each and every other string constant to determine if it already exists.

Let me know if there are any other situations where the performance is too low. This way I will be able to optimize those as well.

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 is very exciting for me!!

This topic is closed to new replies.

Advertisement