[erlang-questions] Efficient sum matrix by column
Tue Apr 14 11:25:59 CEST 2015
Surely if we're talking efficiency then use a library written for the
purpose. This is standard matrix manipulation surely ?
Assuming we're talking PC type hardware there are instructions that do
this kind of thing with a speed-up of some factor of 2.
> Hello Alexander Petrovsky!
> On Sun, 12 Apr 2015 21:23:09 +0400 you wrote:
>> I have about 100 nodes in cluster, each node in cluster contains about
>> 100000 elements in proplist. All proplists have equal length, the same
>> keys, but different values. I need to get the sum values for every key
>> between all proplists. By example, it can be represented as matrix NxM
>> (N~=100, M~=100000), and I need to get the sum by column.
>> The problem is that it's too slow, even when I use the hackish way
>> with ets:update_counter and N=2, it's take about 1.5 secs, If I make
>> in parallel, it's take about 2-3 seconds.
>> How can I make it fast and efficient?
> Look at lists:keyfind/4 It is much faster than proplists.
> Best regards!
> gfborn [at] gmail [dot] com
> erlang-questions mailing list
More information about the erlang-questions