mobject-io
mobject-io copied to clipboard
cyclic call happens via index and not via enumerator
Since each module is first searched for in the linked list via index, the loop is 100 * (100+1)/2 = 5050 for 100 modules. With 500 modules it is 125,250 and with 1000 modules 500500. It is faster to run through the linked list with an enumerator.
Hi @FellowWithLaptop, I totally agree. I'll be stripping out the collections soon and replacing these with a more generic collection which will also have the enumerator. Thank you for your feedback!
One thing I need to concider with this is that modules have the ability to leave the cyclic calling mechanism, so I'll need to take care with the enumerators to correctly idenfity this.