Miou-zora / Eidolon

Eidolon is an experience to create a game using python and ECS architecture
GNU General Public License v3.0
3 stars 0 forks source link

Optimize perfomances #15

Open Miou-zora opened 3 months ago

Miou-zora commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently, ECS is very but VERY slow: 10000 entity max for no logic, no debug print. We can dream about physic plugin and complex entity

Describe the solution you would like

I dunno

Describe alternatives you have considered

Please, make some investigations.

electronstudio commented 3 months ago

You can typically get an 8x speedup by switching from CPython to Pypy.

Miou-zora commented 3 months ago

You can typically get an 8x speedup by switching from CPython to Pypy.

This improvement is quite good, @Sigmanificient is currently making a PR to fix pypy support for meson for Nix. We should make some internal engine modifications which contains the most bottleneck (I think). I would like to notice that other types of problems will arise when using the engine. We can also think about using Cython

Sigmanificient commented 3 months ago

Turns out that the failing meson is a dependency from python-meson used by grpcio, which is a dependency we do not need and can remove!

electronstudio commented 3 months ago

Cython can give you a big speed up but you have to be prepared to identify the hot parts of your code and rewrite them in a language that is more C than Python.

For pure Python, the fastest interpreter is GraalPy, but it doesn’t have good compatibility with Python libraries so you might have to switch to Java libraries.

Sigmanificient commented 3 months ago

Cython seems interresting, I'd like to try it out