<div dir="ltr"><div><div><div><div>When applying out/out_r methods if one list of queue is empty can happen situation where big list will be copying each time, so instead on amortized linear time we'll get O(N^2). Example: <a href="https://gist.github.com/4539653">https://gist.github.com/4539653</a> . Try running it with 100000, 1000000 and 10000000 elements and compare run times.<br>
</div>So I changed internal functions r2f and f2r to copy each time only half of list instead of almost all of it.<br><br></div>git fetch <a href="https://github.com/AlexErofeev/otp/tree/faster_queue">https://github.com/AlexErofeev/otp/tree/faster_queue</a><br>
<a href="https://github.com/AlexErofeev/otp/compare/faster_queue">https://github.com/AlexErofeev/otp/compare/faster_queue</a><br><a href="https://github.com/AlexErofeev/otp/compare/faster_queue.patch">https://github.com/AlexErofeev/otp/compare/faster_queue.patch</a><br>
<br></div>Regards,<br><br></div>Alex Erofeev<br></div>