Check the history of the source code.
Looks like it is related to this commit:
https://github.com/joyent/node/commit/fc6f8a69438d45640d4d0a76633b57965c1f843a
Long story short: delete is costly because it disrupts the layout of the 
internal [[Class]].
Setting to undefined if faster, but unused keys pile up eating memory.


On Tuesday, October 15, 2013 1:44:11 PM UTC+2, Gagle wrote:
>
> Why? Any major changes? Have you introduced additional nextTick or 
> setImmediate calls?
>
> *CODE*
>
> "use strict";
>
> var events = require ("events");
> var util = require ("util");
> var speedy = require ("../lib");
>
> var Emitter = function (){
>     events.EventEmitter.call (this);
> };
>
> util.inherits (Emitter, events.EventEmitter);
>
> Emitter.prototype.ping = function (){
>     this.emit ("ping");
> };
>
> var emitter = new Emitter ();
>
> speedy.run ({
>     emitter: function (done){
>         emitter.once ("ping", done);
>         emitter.ping ();
>     }
> });
>
> *RESULT v0.10.13 (node.exe binary on windows 7 x64)*
>
> File: emitter-vs-callback.js
>
> Node v0.10.13
> V8 v3.14.5.9
> Speedy v0.1.0
>
> Benchmarks: 2
> Timeout: 1000ms (1s 0ms)
> Samples: 3
> Total time per benchmark: ~3000ms (3s 0ms)
> Total time: ~6000ms (6s 0ms)
>
> Higher is better (ops/sec)
>
> emitter
>   *2,062,441 ± 0.5%*
>
> Elapsed time: 6054ms (6s 54ms)
>
> *RESULT v0.10.20 (node.msi installer on windows x64)*
>
> File: emitter-vs-callback.js
>
> Node v0.10.20
> V8 v3.14.5.9
> Speedy v0.1.0
>
> Tests: 2
> Timeout: 1000ms (1s 0ms)
> Samples: 3
> Total time per test: ~3000ms (3s 0ms)
> Total time: ~6000ms (6s 0ms)
>
> Higher is better (ops/sec)
>
> emitter
>   *684,655 ± 0.4%*
>
> Elapsed time: 6053ms (6s 53ms)
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to