Skip to content

Performance question - Having lots of c++ monobehaviour's is slower than expected. #51

@AustinSmith13

Description

@AustinSmith13

Hello,

I am planning on using your project for lua bindings instead of moonsharp. As a quick test to see how fast it runs, I spawned 1,000 GameObjects with the BaseBall script.

I also changed the object store both in c# and c++ to allow up to 10,00 objects.

The result was poor, each script was taking 0.078 ms in Editor and 0.070 ms in the Il2cpp build.

I then implemented the BaseBall script in C# and performed the same test.

My results where much better. each script was taking about 0.01 ms to complete in Editor.

This is my first time trying something like this in Unity3d, I read your blog and it looked like you where getting much better results "C++ can still make 13,140 Unity API calls in a single millisecond.". Executing the c++ scripts is taking me 70 - 80 ms, this seems wrong to me.

Is it better to only have one monobehaviour that manages multiple game objects?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions