Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

speed


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Lettique   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 May 2004 - 07:15 AM

hello everybody, finally I''ve started using AngelCode and I''m quite pleased of it. However there''s another thing I''d like to clarify: how fast AngelCode is? I mean how many times (more or less) is it slower (faster ) than C code, its execution time to be specific, let''s say I have the context ready and just call ->Execute(). Mostly I use calling C-function from real C code (host app), no big expressions etc. Thanks, Ltq

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3343

Like
Likes
Like

Posted 08 May 2004 - 10:03 AM

I really can''t say. I''ve never done any tests to compare the speed of AngelScript with C code. A guesstimate is between 20 to a 50 times slower.

Should you do any measurements I would be very interested in knowing the results.

__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game

#3 meink   Members   -  Reputation: 133

Like
Likes
Like

Posted 10 May 2004 - 01:02 AM

I wouldn't call this a scientific measurement, but I was calling an angelscript function every frame that simply returned a value, and getting ~120fps. The context was already made, and calling the function by name or id didn't seem to make much of a difference (although I would expect this to change if I registered a heap more functions). Calling the function twice yeilded ~60fps, 3x = ~45fps.

Replacing the script call with a compiled function that did exactly the same thing saw about ~1600fps.

I was pushing 3 arguments to the function (they will be used later) and grabbing the returned value. I also had a little bit of rendering and physics code in there, but not enough to have much of an effect.

I'm running on an Athlon 2600+.

EDIT: The post makes sense now.

- Xavier

[edited by - meink on May 10, 2004 8:46:13 PM]

#4 Andreas Jonsson   Moderators   -  Reputation: 3343

Like
Likes
Like

Posted 11 May 2004 - 02:39 AM

There is quite a bit of overhead when calling a script function, so it is reasonable to think that the difference would be huge in this case. Also you have to be careful when measuring the speed of C++ functions, because they might have been optimized, for example a simple function that only returns a value is usually inlined by the compiler giving a completely different situation.

I'm surprised to see that you get 45 fps just by calling executing 3 scripts per frame. It doesn't seem comparable to what others have experienced. Of course if you are using the debug version, this might be true because it saves some statistics to a file for each execution. Which would make it quite slow.

Some examples:

BeatHarness is a WinAmp plugin that uses AngelScript to do the visualizations. It calls executes a script at least 768 times per frame (once per scanline), with very good frame rates. Sorry, there is still not a public release that you can test.

Xtreeme Forces by Raptor Entertainment is using AngelScript for lots of different tasks, i.e AI, event scripting, GUI, etc. I doubt they would have been able to do that if they were getting 45fps with only 3 scripts executed per frame.

My own texture generator executes millions of byte code instructions per second. Don't remember how many at the moment.

To measure the speed of AngelScript it might be a good idea to do a loop that calculates the sum of all values between 1 and 1000000 (as an example). Perhaps 1000000 isn't enough to measure the speed of C++, if so increase the size. In this case you'll have to remember that the C++ compiler probably unrolls the loop somewhat, probably doing 8 adds per iteration.

__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game

[edited by - WitchLord on May 11, 2004 9:41:36 AM]

#5 Lettique   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 May 2004 - 03:09 AM

I''ve made some tests and more or less they gave me the result that AngelScript is about 20 times slower than real C calling. Surely it depends on the script, usage etc. I dont treat this as a precise result. In one month time we''ll move some of our AI and physics to scripts then I will be able to make the tests again in real app situation, not as a synthetic test. So I''ll post my results here.

thanks,
Ltq

#6 Andreas Jonsson   Moderators   -  Reputation: 3343

Like
Likes
Like

Posted 11 May 2004 - 11:22 AM

Cool, then my guesstimate was pretty accurate after all :D

What game are you working on? Is it publically announced? Are you a professional game developer or an independent game developer?

I'm really interesting in knowing where AngelScript is being used. I understand that you are probably still in the evaluation phase with AngelScript, but if you could tell me what you might be using it for I would be thankful. Perhaps an e-mail if it is not supposed to be told publically. I'm very good at keeping confidentiality.

I saw on your site that you've joined the team of NahKolor. Do they have a website that we can take a look at?

__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game

[edited by - WitchLord on May 11, 2004 6:25:30 PM]

#7 meink   Members   -  Reputation: 133

Like
Likes
Like

Posted 11 May 2004 - 11:10 PM

Good point, I''m using a debug build. I''ll try it with the release version. I''m glad I was wrong actually, I was hoping to be able to use script calls every frame.

I''m making a game by myself for my own enjoyment. 2D vehicles that kill. Oh yeah I''m trying to make as much of the game logic scripted as possible.

- Xavier

#8 LDenninger   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 May 2004 - 12:02 PM

quote:
Original post by WitchLord
Some examples:

BeatHarness is a WinAmp plugin that uses AngelScript to do the visualizations. It calls executes a script at least 768 times per frame (once per scanline), with very good frame rates. Sorry, there is still not a public release that you can test.



Sorry, it'll be out Any-Day-Now*

BeatHarness can in 'bad' situations (when mixing 2 effect-scripts using 1 transition-script) call per-vertex-functions 768 times per script per frame,
which would amount to uhm... 3x768 I guess

The function being called does quite a bit more than just return a value,
and then there are still other parts of the scripts thet get called too

Still on my Athlon 2500, my framerate in these cases is mostly >40fps if I remember correctly.

Hey, it's just a matter of tweaking your compiler-options I guess ;-)

Edit:
And ALWAYS test speed in release-mode !
(I've seen AS-versions that opened, wrote and closed a debug-textfile each frame )

---
* 'Any-Day-Now' © 2004 by L.e.Denninger




[edited by - LDenninger on May 12, 2004 7:05:11 PM]

[edited by - LDenninger on May 17, 2004 6:54:33 PM]

#9 EddHead   Members   -  Reputation: 140

Like
Likes
Like

Posted 12 May 2004 - 07:19 PM

Andreas is right here. we do have about a thousand AS function calls per frame and the game is a polycruncher as well. the game runs at about 50 fps now and it isnt very well optimized as yet. we are extremely pleased with angelscript but i am still using 1.6.1 now.

My suggesstion is to use scripting as little as possible in the main loop. our basic usage of the script is for object initialization and AI descisions ,testing ,GUI handling etc. we would eventually move it to C++ code and leave an option for the game modders to override certain functions with AS code. this would help extending the app (as one of the goals for a scripting language).



Jayanth.K
Raptor Entertainment Pvt. Ltd.
http://www.raptorentertainment.com




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS