4 ms·
He reduced the example in the post to the core of the issue, which is the time complexity O(n) for each load (thus O(n^2) overall), and his replacing the existi
by stock_toaster 15y ago
He reduced the example in the post to the core of the issue, which is the time complexity O(n) for each load (thus O(n^2) overall), and his replacing the existing data structure with what seems (I didn't look at the patch for very long) like a hash[1] which should be O(1) for each load (O(n) overall). A tradeoff of speed for some additional memory.
There is quite a bit going on in module loading. I think reducing it to 'ass clowns' is a bit unwarranted.
[1]: publicly exposed as an array, but a hash internally for actual loading and checking to see if loaded already.
edit: fixed bigO notation