abeimler/ecs_benchmark

The DataSystem::update function is invalidating some of the results

Closed this issue · 2 comments

I did some profiling and std::fmt inside of DataSystem::update is 95% of the time spent executing the benchmark.

For some perspective with 2m mixed entities the benchmark takes 260 ms with pico_ecs on my machine. Disabling the last two lines of DataSystem::update will change it to take 13ms which is more in-line with what I would expect performance to be.

This makes the difference in performance across ECS libs much more dramatic.

Any other ideas to do some smaller string operations in the system to fill the buffer ?

(I may try out std::to_string(), but idk maybe the string allocations is also a factor)

EDIT: Maybe I try out to make a System with something more "realistic" and useful, like a "RenderingSystem", but with a string buffer to "draw" a character into it or some other data and number crunching things.

I would avoid any string manipulation or allocation at all, most games try to avoid it. That way those things will be overhead in the libs, if they do it.

I don't think you need any real-world simulation but purely benchmarking actions under different conditions is fine.