Page 2 of 2

Re: Map with integer key

Posted: Sun May 30, 2021 6:12 pm
by IceSoft
Usw Arrays.
Or your own linked list.
Or ist tihis mit Right?

Re: Map with integer key

Posted: Sun May 30, 2021 9:13 pm
by Tenaja
IceSoft wrote: Sun May 30, 2021 6:12 pm Usw Arrays.
Or your own linked list.
Or ist tihis mit Right?
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.

Re: Map with integer key

Posted: Mon May 31, 2021 1:16 am
by idle
Squint technically hoses all over a Map, don't be fooled by the timings as they're not really a fair fight.

A sized map, you know in advance how many items you need to store
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
vs a dynamically sized map, Result Maps not very dynamic, it only took 10 minutes for the map.
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

Re: Map with integer key

Posted: Mon May 31, 2021 5:02 am
by Rinzwind
There's barely ever a reply (let alone implementation) from head quarters so no difference there. A point to improve upon me think. Anyway, keep wishing :)

Request is originally from 2019 too...