@marcel,

Why Object.create(null) rather than {}? You'll get a null prototype instead 
of Object.prototype but that's often irrelevant. On the other hand you may 
pay a price for it. I just re-run the benchmark and Object.create is 40 
time slower than {} on V8 (chrome). On firefox they are equivalent!

http://jsperf.com/object-create-null-vs-literal


On Sunday, June 17, 2012 5:46:05 AM UTC+2, vitoa wrote:
>
> Tanks a lot for all help :) 
> This var table = Object.create(null);  and Object.keys(table) saved my 
> life 
> All my algorith was repalced by a simple      table[line[0]]=line; 
> Love nodejs and all help u give to me 
>
> I have some question about eficiency? does this way off implemeting 
> algortithm eficient in cpu eat? 
>
> What do you mean wirh ""size" of an object like this is NOT a constant 
> time operation" 
>
> This  table[line[0]]=line; is used frequently in time there is data on 
> serial port  serial.on('data', function  )..... 
> I receive like 6 or 7 data each 3 seconds, 40bytes for each data 
> contaning this unique id and values to repalce or add to table 
>
> On future there will be much more data id's, because this is a ZigBee 
> network ..that could receive up to 65000 diferent id's... but for 
> begining this works perfect 
>
>
> Best regards nodejs guys, 
> Vitor 
>
>
>

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to