Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Context.Prepare


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
4 replies to this topic

#1 zola   Members   -  Reputation: 122

Like
0Likes
Like

Posted 07 November 2004 - 03:11 AM

Hi I'm currently trying to squeeze out performance from my app. I wonder if calling Prepare() is needed every time a script function is called or if its enough to call Prepare just once if I keep the context after the script returned? Regards Tom

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3445

Like
0Likes
Like

Posted 07 November 2004 - 04:44 AM

It is necessary to call Prepare() to reset the context before starting the execution again.

I could make Prepare() a little smarter by verifying if it is the same function ID that is being passed, and if so use the information that is already known. That would save a little overhead, where bytecode address is fetched, and stack space is verified, etc.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 zola   Members   -  Reputation: 122

Like
0Likes
Like

Posted 07 November 2004 - 07:17 AM

Ok, thanks
I just want to make sure I don't introduce overhead [wink]

#4 Lioirc   Members   -  Reputation: 142

Like
0Likes
Like

Posted 08 November 2004 - 08:46 AM

Hi

As WitchLord said, probably is needed to call prepare() each time ,i dont have confirmed this, but i use a modified version where i call prepare at the script compilation, and call execute() each frame, without calling prepare, avoiding the overhead
The scripts use the last stack state for each new frame, with script/context pairs

I dont know what is the current implementation state of the ASM VM, but a few changes are needed, like updating the eip at the execution ret

Lioric





#5 Andreas Jonsson   Moderators   -  Reputation: 3445

Like
0Likes
Like

Posted 08 November 2004 - 09:11 AM

That is actually a good idea. I think I will change the behaviour of Execute to reset the status when it is finished. That way the application would be allowed to call Execute() again without first calling Prepare() if the same script function is to be called.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




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