Closed Goodwine closed 9 years ago
any suggestion for improvement?
I have 2, actually:
If the first suggestion is ok, could I send a pull request? And if so.. Is the order important? (I haven't found anywhere that suggests that)
This issue was moved to appirio-tech/arena-web#8
The problem BinaryCode is taking way too long to load, I tried the other problems, and I don't see an issue with them. I pinpointed the issue by profiling the JS code, and it showed that the function
updateCoderPlacement
in resolvers.js is causing the bottleneck.this is how the code looks like:
This is the bottleneck. If I'm not wrong, this solution is bubbling down every coder according to their points. BinaryCode has 34760 coders, and the function takes 1.4 ~ 2.1 minutes, which is the result of a O(n2) bubbling algorithm.