martaannaj / RecommenderServer

GNU General Public License v3.0
1 stars 2 forks source link

Improve memory use by using an array to keep the tree in memory #62

Open miselico opened 1 year ago

miselico commented 1 year ago

Currently, the tree is kept in memory as tree using pointers. However, while serving the tree, it will not longer be changed. Hence, it becomes possible to keep the tree in an array and use array indices to indicate nodes. Since we have way fewer than $2^{32}$ nodes in the three, an int32 is sufficient and we can save a substantial amount of memory.

miselico commented 1 year ago

As a drawback, this adds more complexity to the code.