Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
clevijoki opened this issue Feb 22, 2024 · 2 comments
Closed

Comments

@clevijoki
Copy link

clevijoki commented Feb 22, 2024

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.

@abeimler
Copy link
Owner

abeimler commented Feb 22, 2024

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.

@clevijoki
Copy link
Author

clevijoki commented Feb 22, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants