Jump to content

  • Log In with Google      Sign In   
  • Create Account


_Engine_

Member Since 24 Nov 2003
Offline Last Active Mar 25 2014 06:45 AM
-----

Posts I've Made

In Topic: perfomances issues with classes in array

22 January 2013 - 01:25 AM

StoreData class is a script class

I will be happy to modify CScriptArray but how i can overide angel script to allocate data in my buffer when angelscript calling CreateScriptObject? I only think about temperiory binding custom allocator but i am not shure what happens when angel script call ReleaseScriptObject. Maybe i need use some markers in allocated blocks. May be i need use some thing else?</p>

In Topic: perfomances issues with classes in array

21 January 2013 - 10:04 AM

Hi!

 

Thanks to link leads to documentatios. But please before answer again try to understend what i want to achieve.

In c++ if i define array like this -

 

struct Data

{

    float a,b,c;

}

std::vector<Data> data;

 

when i go throught loop of each element of array access speed to element will be maximized because data lie in cache. If I repace array to

 

std::vector<Data*> data;

 

access to each element may leed to pоtention cache miss becase pointers in array may point at random places in memory. If accessed data lie all in one chank there still potentional chace miss.

 

cusom allocators from angel script is good but that mean write very complicated memory manager because i can call from script resize of array at any time and how my manager supose to understend that i must resize exetly that array? it is almost imposible without hacking angelscript.

 

i understend - angel script goes by way of sand box. But sand box means big perfomance problems. We currently work on mobile title and angel script is big big perfomance issue. I prefer get more control points to trade safety to speed.


In Topic: perfomances issues with classes in array

21 January 2013 - 08:35 AM

Thanks for reply!

 

But using custom allocator it is not solution. Script array already store data in one chunk. But script class itself allocated by AngelScript so array it is just array of pointers to angel script representation of class. I can not hack Angel Script to make allocate arrays of classes in one chunk.


In Topic: registering virtual properties

17 November 2012 - 05:12 AM

Yep, this is working :)

Thank you.

In Topic: char* or const char* in binding functions to script

30 October 2012 - 12:28 PM

Thanks to advise I will try to dig this theme :)

PARTNERS