Jump to content

Increasing TorqueScript speed by reducing overhead


Recommended Posts

There is a resource on Garagegames.com where someone increased the performance of Torquescript: http://www.garagegames.com/community/resource/view/18045/1

I wanted to ask if this is still relevant, or if it has already been integrated and if not, if anyone has the code, since the link is dead.

Maybe we can end the scripting language debate that way and tell people that it is not so much about the scripting language itself, but how it is handled in the engine, which results in different performance.

Also I could imagine that the performance increase in that resource is not that relevant, since the most performance increase was in the scripts that took longer and no increase in the smaller scripts that took not so long to execute.

When I tested the C# scripting implementation that was supposed to be so much faster I found out that it was only so much faster in an mostly empty scene, but in a full loaded scene it was even slower than Torquescript. However I'm no expert on that, that is why I ask here.

Link to comment
Share on other sites

People like @jamesu, @Hutch, and @MangoFusion made improvements along these lines and most of those changes were rolled in at some point. T3D's version of TorqueScript is noticeably faster at certain things than previous versions as a result. The largest improvement was probably a result of simply disabling the antiquated memory manager TGE/T2D uses (this is off by default in T3D).

One of the issues with that resource is that the seven benchmark tests the author uses aren't particularly realistic. It's rare to call a function a million times in a single loop, and if for some reason you do need to do that doing it in script would be bad design anyway. It'd be more realistic to test function calls over a few thousand iterations but that would likely take less than 1ms to complete and make it difficult to measure the performance differences (if any).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...