Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Improve handling of shared script entities


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

#1 vroad   Members   -  Reputation: 131

Like
0Likes
Like

Posted 19 September 2013 - 12:44 AM

When the engine loads precompiled bytecode, it performs linear search from ALL types which was registered before loading. I think this is because the engine doesn't know which module has shared entity. So saving the name of module to the bytecode would allow the engine to search shared types from fewer number of the types.

 

Other problems of shared script entities are
  • bytecodes doesn't have information about dependencies. You need to store them to another place and load manually.
  • you need to mark all entity as shared to use them from other modules.

What do you think about it?



Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3356

Like
0Likes
Like

Posted 19 September 2013 - 10:35 AM

Shared entities was introduced as a mean to allow modules to interchange objects without causing dependency on which module is compiled in which order.

 

The module name is not part of the bytecode. You can load the same bytecode into different modules (sometimes that is necessary to get separate set of global variables).

 

I didn't quite get what you meant with the comments in the bullet list, so I have probably not answered what you really asked for.

 

 

There are certainly improvements that can be made. You mention the linear search of all types. This can quite easily be optimized if there is a need for it. Are you seeing performance issues with loading pre-compiled bytecode?


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 vroad   Members   -  Reputation: 131

Like
0Likes
Like

Posted 20 September 2013 - 05:48 AM

Sorry I was confused. Let me sort my thoughts out first.
You said that there is no need to worry about which bytecode should be loaded first. That means declaration and implementation of shared functions will be saved to every file when I save them?

Linear search of script entities may incur some performance penalties, though it's very smaller than the case of string constants.

#4 Andreas Jonsson   Moderators   -  Reputation: 3356

Like
0Likes
Like

Posted 20 September 2013 - 12:01 PM

Yes, the shared entities are saved in all byte codes to guarantee that they will function regardless of the order in which modules are loaded.

 

 

You may want to know that I have plans to make improvements to the import functionality, which currently only works for global functions. Importing entities would be different from shared entities in that the imported entity must have been compiled / loaded in a previous module for the import to work. I can't say exactly when I'll get to work on this improvement though.


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