mobject-io icon indicating copy to clipboard operation
mobject-io copied to clipboard

cyclic call happens via index and not via enumerator

Open FellowWithLaptop opened this issue 3 years ago • 1 comments

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.

FellowWithLaptop avatar Sep 07 '22 10:09 FellowWithLaptop

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.

benhar-dev avatar Nov 10 '22 21:11 benhar-dev