rbfx icon indicating copy to clipboard operation
rbfx copied to clipboard

Performance issue: CreateComponent<T>

Open Mac767 opened this issue 4 years ago • 0 comments

Hello,

I have now ported my complete game from UrhoSharp to rbfx. Everything is now working so far. Thanks for the great work to rbfx!

But I have now encountered a performance problem that did not occur with UrhoSharp. The CreateComponent<T> function takes on average 15ms on an older Android device. Even if only the UpdateEventMask is set in the component constructor.

Example: node.CreateComponent<BulletComponent>();

    public class BulletComponent : BaseComponent
    {
        public BulletComponent(Context context) : base(context)
        {
        }
    }

   [ObjectFactory]
    public abstract class BaseComponent : LogicComponent
    {
        public BaseComponent(Context context) : base(context)
        {
            UpdateEventMask = UpdateEvent.UseUpdate;
        }
    }

Mac767 avatar Apr 07 '21 17:04 Mac767