Original Post
Hi, I'm using AngelScript in a context where multiple threads are simultaneously calling a function in AngelScript. There are very frequent calls, and it could be up to eight threads calling it at the same time. Now when I run it on my Core Duo laptop I get pretty nice performance. But when I run it on a 2 x quad core Xeon system the same operation that took 20 seconds on my laptop takes over a minute. Not what you expect from a machine which is among the fastest PC:s there is. Note that this "operation" means thousands of calls to angelscript (image processing). Anyways. I've tried a number of things. I've even gone so far that I made sure that each thread uses a different engine instance. Did not help. And when I removed the USE_THREADS define in AngelScript I get a crash approx when half of the calls to angelscript are done. This makes me think that even separate engine instances share some memory and thus uses critical sections in those places, slowing down things when using multiple threads. As for the script I'm running. I'm basically just doing a loop over 20 iterations. And I also pass an object by ∈ reference to the function, which returns an instance of a class I have (very simple class, basically a struct with r,g,b and a components). As for errors I get none and the result I get (in this case an image) looks exactly as expected. Any tips on how to improve the performance? Has it anything to do with Xeon processors? I've tried it in a 2 x core duo machintosh running bootcamp and there I had good performance as well.