[erlang-questions] Re: Unicast 20k messages, $500-$1000 bounty

Joel Reymont <>
Thu Jul 16 18:09:04 CEST 2009


On Jul 16, 2009, at 3:56 PM, Paulo Sérgio Almeida wrote:

> 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.


There's nothing like empirical proof. Traversal time with ets:select  
is 1046.224ms and 1009.256ms respectively. Compare to my previous  
timings.

Trashing memory while building the list of subscribers over time beats  
other techniques thus far, by a large margin since we are looking at  
2.9s and 3s here.

=INFO REPORT==== 16-Jul-2009::17:05:17 ===
setup: 15100.95ms, good: 20000, bad: 0, run: 22863.07ms
     5.3150ms | min
   500.0000ms | 432    -   2.16%
  1000.0000ms | 1230   -   6.15%
  1500.0000ms | 6055   -  30.28%
  2000.0000ms | 4970   -  24.85%
  2500.0000ms | 4417   -  22.09%
  3000.0000ms | 2896   -  14.48%
  2923.3990ms | max
ok
()3> bot:test(flashbot, 20000).

=INFO REPORT==== 16-Jul-2009::17:05:47 ===
setup: 14442.21ms, good: 20000, bad: 0, run: 21925.20ms
     6.3430ms | min
   500.0000ms | 723    -   3.62%
  1000.0000ms | 3308   -  16.54%
  1500.0000ms | 3442   -  17.21%
  2000.0000ms | 4217   -  21.09%
  2500.0000ms | 1943   -   9.71%
  3000.0000ms | 3084   -  15.42%
  3500.0000ms | 1130   -   5.65%
  4000.0000ms | 2153   -  10.76%
  3711.4690ms | max
ok

---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont



More information about the erlang-questions mailing list