mcollina/ascoltatori — pull request #59 by davedoesdev (2013-06-21 10:19:49+00:00)
Title: Trie ascoltatore

Trie Ascoltatore using Qlobber.
Note other changes:
- Changed benchmark to use wildcard topic
- Switched the publish adapter to set this.publish instead of defineProperty.
The performance is much better like this!
- Trie Ascoltatore filters out duplicate matches from qlobber. e.g. if you
have subscribed to foo.bar and foo.* and a message on topic foo.bar comes in
then your callback will only be called once. I think this is the right thing
- callback should only be called once for each message published.
This required one-line changes to the test and benchmark.

Benchmark results (with the wildcard topic, 'start/*/end'):

class, mean, standard deviation, median, mode, runs, listeners
MemoryAscoltatore, 33.15, 71.7706250012172, 18, 16, 100, 1
TrieAscoltatore, 26.075, 45.961195944658755, 17, 16, 100, 1
MemoryAscoltatore, 43.24, 67.80219827153289, 27, 26, 100, 10
TrieAscoltatore, 28.985, 48.05466710061313, 19, 19, 100, 10
MemoryAscoltatore, 91.92, 109.43442358475065, 70, 63, 100, 100
TrieAscoltatore, 39.34, 54.31348056287934, 27, 26, 100, 100
MemoryAscoltatore, 838.045, 1032.8325120583802, 511, 483, 100, 1000
TrieAscoltatore, 117.61, 83.72531001846721, 95.5, 91, 100, 1000

Benchmark results with non-wildcard topic ('hello'):

class, mean, standard deviation, median, mode, runs, listeners
MemoryAscoltatore, 23.105, 50.45375986407864, 14, 13, 100, 1
TrieAscoltatore, 48.56, 360.1163915699844, 15, 14, 100, 1
MemoryAscoltatore, 25.445, 50.18745739123458, 16, 14, 100, 10
TrieAscoltatore, 26.38, 46.7428074707891, 17, 15, 100, 10
MemoryAscoltatore, 36.92, 90.31743906353289, 23, 22, 100, 100
TrieAscoltatore, 35.985, 57.46840753250087, 25, 24, 100, 100
MemoryAscoltatore, 102.995, 56.424583677826824, 91, 83,85,86, 100, 1000
TrieAscoltatore, 119.525, 70.7986697132498, 104, 93, 100, 1000