I am looking for ways to speed up the dead end in my elixir program.
Enum.reduce( list, 0, fn ({c,v},acc) -> v*elem(tuple_array,c) + acc end )
He simply looks at the list of tuples and for each of them: search for a tuple (c is an integer), multiplication and addition.
I tried to insert into the module head
@compile [:native, {:hipe, [:verbose, :o3]}]
and on macOS, it's a native compilation. But when I go and run the code from the iex shell it works even slower than before. Did I miss something?
UPDATE May 3, 2015. Now I realized that my hard loop works at speeds almost equivalent to compiled languages ββlike Fortran, rather than orders of magnitude slower. My real bottleneck seems to be sending the output of this loop to another process, especially when it happens between nodes on the network.
Thanks to everyone who showed interest.
source share