dojoengine / dojo

Dojo is a toolchain for building provable games and autonomous worlds with Cairo
https://dojoengine.org
Apache License 2.0
406 stars 163 forks source link

[BUG] sozo test high RAM usage (20GB+) #2314

Open rsodre opened 3 weeks ago

rsodre commented 3 weeks ago

Describe the bug Running any simple tet on pistols consumes 18-20GB of RAM

To Reproduce

and please notice this gas consumption on simple tests (test_initialize_table_defaults)...

$ sozo test -f test_initialize_table
testing test(pistols_unittest) pistols v0.10.0-3 (/Users/roger/Dev/Realms/pistols/dojo/Scarb.toml)
running 2 tests
test pistols::tests::test_admin::tests::test_initialize_table ... ok (gas usage est.: 52,242,666)
test pistols::tests::test_admin::tests::test_initialize_table_defaults ... ok (gas usage est.: 54,464,862)
test result: ok. 2 passed; 0 failed; 0 ignored; 233 filtered out;

Expected behaviour A clear and concise description of what you expected to happen.

Screenshots

Screenshot 2024-08-18 at 10 38 16

Additional context

lambda-0x commented 3 weeks ago

just to add some quick context, i checked the memory usage on spawn-and-move example that is in the repo and memory usage was around 1.2GB for build and 3.5GB for running the test (it only has couple of tests).

and since sozo build and sozo test are light wrapper around scarb i dont think the issue is specially related to sozo, i will do a memory profile to confirm this.

rsodre commented 3 weeks ago

origami token package: ~4GB during build, ~8.5GB during tests

sozo test --package origami_token
ShantelPeters commented 3 weeks ago

@rsodre please can I be assigned

glihm commented 2 weeks ago

For the record, scarb has also notice significative increment of the compilation time. We may depend on what their bottleneck is.

@ShantelPeters do you have an idea of what could be dojo bottleneck related to compilation? Happy to assign if you have some suggestions.

rsodre commented 2 weeks ago

Is there an scarb issue for that?

The language server is also consumes around 6GB.

Btw, running the same test with Dojo alpha 9, it's around 13GB