4 ms·
A real set implementation is 250x faster than using a list as a set (doesn't mention which operations or include the numbers though..)? One would hope so for la
by thesmallestcat 10y ago
A real set implementation is 250x faster than using a list as a set (doesn't mention which operations or include the numbers though..)? One would hope so for large sets. That is what the author is referring to by built-in set functionality, right?
- codr4life 10y agoIt's not any more real than built-in, it uses a list as a set as well. The benchmark is now included at the bottom of the post, or you can follow the link to the repo if you want to run it yourself.
- thesmallestcat 10y agoRight, I saw the benchmarking code in the linked repository already, it would be interesting if you included the results from your machine in the post. By "real" I meant "not naive."
- codr4life 10y agoWill do. I hear you, what's surprising (to me) is how much less naive you have to go to get a workable solution.
- akkartik 10y agoFor what it's worth, I was able to reproduce the results. Evaluation took: 5.930 seconds of real time 5.923203 seconds of total run time (5.916811 user, 0.006392 system) 99.88% CPU 13,045,070,068 processor cycles 2,392,064 bytes consed Evaluation took: 0.014 seconds of real time 0.014117 seconds of total run time (0.014106 user, 0.000011 system) 100.00% CPU 31,060,638 processor cycles 3,571,712 bytes consed The first para is for lists, the second for slists.
- codr4life 10y agoCool, so at least we know I'm not seeing ghosts :)