4 ms·
Precisely my first thought. Static readonly data? Why isn't this just sitting in memory?
by th3byrdm4n 9y ago
Precisely my first thought. Static readonly data? Why isn't this just sitting in memory?
- mzzter 9y agoSounds reasonable, 500mil * 160 bits of SHA-1 would be 500 mb of space. Even with some metadata to manage it, the smallest instances should be able to handle that.
- lipnitsk 9y ago500,000,000*160bits/(8bits/byte)=10,000,000,000 bytes=9,536MB=9.313GB
- vortico 9y agoDon't filesystem caches basically do this for you?
- zaroth 9y agoYes but with a heck of a lot more overhead than; response.body = result[(int)hexCode];
- dullgiulio 9y agoYou can do that after mmap(2) and you never have to reach out for read(2). Might need to use unsafe language constructs though.
- tgsovlerkhgsel 9y agoNo, with a lot less overhead because you don't need to write custom web server code. Edit: and if he points the requests directly at blob storage as he's suggesting, we're very close to to flat files on a filesystem again.