Sign in to follow this  

Performance: global functions vs. object methods.

This topic is 2035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm not aware of any significant overhead when calling C++ member functions compared to C++ global functions from the scripts.

Of course, even in C++ there is a slight overhead when calling member functions compared to global functions. Especially if the member functions are virtual.


Have you noticed a difference in performance? If you show me the script you feel is slower than it should be I'd gladly take a look at it to see if there are any opportunities for optimizing AngelScript further.

Share this post


Link to post
Share on other sites
[quote name='Andreas Jonsson' timestamp='1336515009' post='4938501']
Have you noticed a difference in performance?
[/quote]

Not really. It´s just that I have my scripts setup so that the script functions call some object´s method of the same script, which in turn calls a member function in my C++ code, and I was wondering if I could improve performance by using global functions. Time for some testing!

Share this post


Link to post
Share on other sites
Just finished some testing - first using some member functions exposed to a script, then using static functions exposed to the same script. At first sight it seems that there´s no significant difference - what´s more, I have the feeling that member functions are a little faster. Have to test further but I wanted to post a quick update.

Share this post


Link to post
Share on other sites

This topic is 2035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this