Re: Map with integer key
Posted: Sun May 30, 2021 6:12 pm
Usw Arrays.
Or your own linked list.
Or ist tihis mit Right?
Or your own linked list.
Or ist tihis mit Right?
http://www.purebasic.com
https://www.purebasic.fr/english/
Arrays are no good when you don't know the size of data. And, if the number aren't contiguous, a trie is more RAM efficient. Obviously, that's moot if there's only 1k, but of you are running into ram concerns, it matters.IceSoft wrote: Sun May 30, 2021 6:12 pm Usw Arrays.
Or your own linked list.
Or ist tihis mit Right?
vs a dynamically sized map, Result Maps not very dynamic, it only took 10 minutes for the map.Items 1000000
Squint Numeric Set 794 ms
Map Set 527 ms
Squint numeric Get 399 ms
Map Get 513 ms
=========================
Squint Set Ratio 1.507 slower
Squint Get Ratio 1.286 faster
=========================
Key Input Size 7.63 mb
Squint Memory Size 25.71 mb
Overhead 3.37 bytes input
Map Size ~ 49.70mb
Items 1000000
Squint Numeric Set 566 ms
Map Set 296708 ms
Squint numeric Get 811 ms
Map Get 659250 ms
=========================
Squint Set Ratio 0.002 slower
Squint Get Ratio 812.885 faster
=========================
Key Input Size 7.63 mb
Squint Memory Size 25.71 mb
Overhead 3.37 bytes input
Map Size ~ 49.70mb