<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hello,</div><div><br></div><div>gb_trees is even slower then lists. I am getting 50K data points and appends them two lists in 13ms + sorting 60ms. Same size job of gb_trees construction takes about 132ms. </div><div><br></div><div>ETS is a good point, I overlook it and this seems to be a good replacement for NIF burden. However, I need to run up to 2500 concurrent requests on single very powerful node. I guess a single ETS would be bottleneck especially when you need evicts data. ETS table per request sound an interesting approach ;-)    </div><div> </div><div>- Dmitry</div><br><div><div>On 30 May 2014, at 18:35, Bob Ippolito <<a href="mailto:bob@redivi.com">bob@redivi.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Why does it have to be a list? Why not store it in a gb_tree instead, this way it's sorted as you build it. Another alternative would be to use an ordered_set ets table.<div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, May 30, 2014 at 8:15 AM, Dmitry Kolesnikov <span dir="ltr"><<a href="mailto:dmkolesnikov@gmail.com" target="_blank">dmkolesnikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I need to sort a list of tuples {integer(), float()} within 6 ms. the lists:keysort(1, X) is not fast enough for me. I am able to meet the hard requirement only if the list size about 10K tuples. However, my application needs to sort lists of 50K tuples or so.<br>

<br>
I doubt that any other sort algorithm implemented in Erlang would solve my issue. Parallel sort would not help at all because production system would run parallel requests of lists sorting. I am starting to think of offloading the sorting to NIF.<br>

<br>
Any thought?<br>
<br>
Best Regards,<br>
Dmitry<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>
</blockquote></div><br></body></html>