<div dir="ltr"><div>I found a way that give enough performance for me. I'm just get rid of proplists, and start using tuples as pointed ILYA. The simple sum by column of two tuples with 100000 in it, take about 5ms.<br></div><div><br></div><div>Thaks a lot for help, folks!<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-14 10:25 GMT+01:00 Jon Schneider <span dir="ltr"><<a href="mailto:jon@axismilton.ltd.uk" target="_blank">jon@axismilton.ltd.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Surely if we're talking efficiency then use a library written for the<br>
purpose. This is standard matrix manipulation surely ?<br>
<br>
Assuming we're talking PC type hardware there are instructions that do<br>
this kind of thing with a speed-up of some factor of 2.<br>
<span class="HOEnZb"><font color="#888888"><br>
Jon<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> Hello Alexander Petrovsky!<br>
> On Sun, 12 Apr 2015 21:23:09 +0400 you wrote:<br>
><br>
>> Hello!<br>
>><br>
>> I have about 100 nodes in cluster, each node in cluster contains about<br>
>> 100000 elements in proplist. All proplists have equal length, the same<br>
>> keys, but different values. I need to get the sum values for every key<br>
>> between all proplists. By example, it can be represented as matrix NxM<br>
>> (N~=100, M~=100000), and I need to get the sum by column.<br>
>><br>
>> The problem is that it's too slow, even when I use the hackish way<br>
>> with ets:update_counter and N=2, it's take about 1.5 secs, If I make<br>
>> in parallel, it's take about 2-3 seconds.<br>
>><br>
>> How can I make it fast and efficient?<br>
>><br>
><br>
> Look at lists:keyfind/4 It is much faster than proplists.<br>
><br>
> --<br>
> Best regards!<br>
> gfborn [at] gmail [dot] com<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>
><br>
><br>
<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Петровский Александр / Alexander Petrovsky,<br><br>Skype: askjuise<br><div>Phone: +7 914 8 820 815<div><br></div></div></div></div>
</div>