objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
154 stars 11 forks source link

`Collection.Hash` vs `Collection.Map` #460

Closed ghost closed 7 months ago

ghost commented 7 months ago

I'm totally ignorant about the algorithms underlying them and the use cases for each of them.

But this is what I observed.

I'm unable to have a Collection.Map with 1000000 elements. It always crashed with:

>>> call std::stack bounds have been exceeded! <<<

Increasing the value of --GC_THRESHOLD doesn't help.

But I'm able to have a Collection.Hash with 1000000 elements.

I have no idea why.

objeck commented 7 months ago

The call stack size is set to 32, rather small. I will create an enhancement to make the call stack and operation stack sizes configurable.

objeck commented 7 months ago

Tweaked the VM parameters yesterday to improve performance. The bottleneck was memory for both the Map and Hash classes when inserting 1 million elements.