dojoengine / dojo

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

Use Red Black Tree for indexing #219

Open tarrencev opened 1 year ago

tarrencev commented 1 year ago

Currently, doing a scan over an indexed component doesn't return an ordered entity array, so when querying across multiple components, we need to sort before finding the intersection.

We can update to use a RBT to store components sorted by entity id and improve query performance.

Cheelax commented 1 year ago

I can try this one but I think I ll need a bit more details on the expected. Where is done the scan of an indexed component in the current code?

tarrencev commented 1 year ago

I think @milancermak is planning to take this

ponderingdemocritus commented 1 year ago

@tarrencev any more thoughts on this? It has been a while since we last discussed it and I know this is still an area that needs exploring. It would be a great first issue for a Cairo native to explore if they had a clear direction.