[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] (Identity)Dictionary : includesKey performance



hello,

should we change includesKey in Dictionary and IdentityDictionary to call 'at', since that is a lot faster? :

x = IdentityDictionary.new;
(1..1000).do({ arg key; x.put( key, \lala )})

{ a = 2000.collect({ arg key; x.includesKey( key )})}.bench;
{ b = 2000.collect({ arg key; x.at( key ).notNil })}.bench;
a == b

x = Dictionary.new;
(1..1000).do({ arg key; x.put( key, \lala )})

{ a = 2000.collect({ arg key; x.includesKey( key )})}.bench;
{ b = 2000.collect({ arg key; x.at( key ).notNil })}.bench;
a == b;



ciao, -sciss-