Advertisement

array performance / direct memory access?

Started by January 14, 2014 01:40 PM
28 comments, last by WitchLord 10 years, 8 months ago

Ok, thanks, I will check this out and see what it could look like.

After some more testing, it appears that using the JIT with appropriate settings just makes performance so good that this is not required anymore! (JIT compiled code is just incredibly faster).

The first time I tried the JIT, I forgot to add the asEP_INCLUDE_JIT_INSTRUCTIONS option, hence the poor performance, By the way, why would this option not be automatically added to the engine when a JIT Compiler is registered?

Advertisement

Are you using the JIT compiler from here

The forum must not like direct links. Are you using the JIT compiler from here . If so could you post some results or a comparison? I haven't tried the JIT compiler. Angelscript has been fast enough for anything I've tried to do.

The forum must not like direct links. Are you using the JIT compiler from here . If so could you post some results or a comparison? I haven't tried the JIT compiler. Angelscript has been fast enough for anything I've tried to do.

Here are a few benchmarks I test against while developing the JIT:
Math:
No JIT: 1.55231ms
JIT: 0.570772ms
Script Call:
No JIT: 8.14899ms
JIT: 3.93928ms
System Call:
No JIT: 6.20815ms
JIT: 2.48501ms
Strings:
No JIT: 0.346983ms
JIT: 0.089297ms
Classes:
No JIT: 1.69336ms
JIT: 0.990286ms
System Classes:
No JIT: 6.21726ms
JIT: 1.6591ms
Switches:
No JIT: 2.57504ms
JIT: 0.261695ms
At least for these benchmarks, it's typically 2-4x faster. Specific use cases can go up to 10x faster (like the switch test).

ThyReaper,

Those are some pretty good results. I am going to try this out when a I get a chance. Are there any things to watch out for, or is it pretty much plug and play? From the brief docs on Github it seems like its just a matter of registering the JIT compiler with the script engine and then business as usual. Great job, and thanks for the contribution!

Tony

Advertisement

After some more testing, it appears that using the JIT with appropriate settings just makes performance so good that this is not required anymore! (JIT compiled code is just incredibly faster).

The first time I tried the JIT, I forgot to add the asEP_INCLUDE_JIT_INSTRUCTIONS option, hence the poor performance, By the way, why would this option not be automatically added to the engine when a JIT Compiler is registered?

I'll consider adding some check for this, though probably not to automatically turn on asEP_INCLUDE_JIT_INSTRUCTIONS. That wouldn't work with pre-compiled bytecode anyway.

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'll consider adding some check for this, though probably not to automatically turn on asEP_INCLUDE_JIT_INSTRUCTIONS. That wouldn't work with pre-compiled bytecode anyway.

That's right, I had not thought about this!

And yes, that's the JIT I am using, I don't think there is any other anyway... I have just found a small memory leak, but otherwise it is really worth it! Any chance this would become integrated with angelscript directly in the future?

And yes, that's the JIT I am using, I don't think there is any other anyway... I have just found a small memory leak, but otherwise it is really worth it! Any chance this would become integrated with angelscript directly in the future?

No. I have no plans to make this or any other JIT compiler part of the AngelScript SDK. BlindMind's JIT compiler is a completely separate project and is best maintained that way.

I believe BlindMind has made a good job of making the integration of the JIT compiler as smooth as possible anyway.

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