[erlang-questions] Re: Unicast 20k messages, $500-$1000 bounty
Paulo Sérgio Almeida
psa@REDACTED
Thu Jul 16 16:56:03 CEST 2009
Joel Reymont wrote:
>
> On Jul 16, 2009, at 2:57 PM, Paulo Sérgio Almeida wrote:
>
>> - obtain the list of pids with ets:select, as in:
>>
>> ets:select(State#state.subs, [{{'$1', '_'}, [], ['$1']}]).
>
> Would it not be faster to call ets:tab2list?
I have a weak memory, but I have the feeling select is faster in this
case when you don't need all the content in the table. It is a built-in,
it is producing less results (just a list of Pids, not of tuples), and
then you don't have to extract the Pid from the tuples when traversing
the list.
Paulo
More information about the erlang-questions
mailing list