Monday | 15 APR 2024
[ previous ]
[ next ]

General Mistakes During Hashmaps

Date: 2023-05-14

I am going to be writing out the hashmap to a file so that will at least let me test the hashmap access method, MAP.GET. This will let me know if it is indeed better than a LOCATE which I expect and I'm hoping for. However adding keys is stupidly expensive and that might be a problem. It might not matter ultimately because the type of projects I'm planning to use it on will have at most tens of keys. I doubt I'd even get to 100s of keys.

Ultimately problems of scale only matter if you get to that scale but it does mean that there is an issue with the underlying foundations.

I realized now that I could also write out the hashmap as a file. In memory hashmaps may not exist but on disk hashmaps certainly do!

Now I'm waiting for the linux.words file to be made into a hashmap, its about 450k keys and it is taking quite a bit of time. Like a ridiculous amount of time, such that I think I definitely screwed something up in the logic of things.

The MATBUILD in MAP.ADD was very expensive and not worth keeping. I need to figure out a better answer to that problem because passing in the size is not a good idea in my opinion, it makes the signature so much worse.

I also swapped out the reading of the words and made it a REMOVE function which I think has also added some speed.

The core slowdown I was complaining about was the MATBUILD, I forgot that even though I mentioned it. I took it out and everything sped up quite a bit and I began to see the numbers I was expecting to see.