Is that in a 7.5? It'd be interesting to see comparisons between the old and new multiset implementations (i.e. between 7.4 and 7.5, assuming the default configure settings). I haven't got around to make a good performance comparison between them.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-01-29 09:00: Subject: Re: reasons why pike is better than python?
a = a[1..]; a += ({ some_value });
^^^^^^^^^^
*removing* elements isn't fast. Adding elements are.
But anyway, I wrote a benchmark for it. It uses v+=({17}) and v[x]=y respectively, up to 100000 elements (k times):
test total user mem (runs) Append array............... 0.808s 0.525s 3540kb (19) (952859/s) Append mapping............. 0.703s 0.459s 3784kb (22) (1090188/s) Append multiset............ 1.132s 0.806s 3684kb (14) (620018/s)
I don't know if it's fast, around one microsecond per insertation... I suspect it might be the function call that is slow, not the insertation in itself - recursed loops gives about the same figures:
Loops Recursed............. 1.337s 1.077s 3680kb (12) (973910 iters/s)
/ Mirar