I have a java application which is started and stopped multiple times per second over hundreds of millions of items (called from an external script).
Input: String key
Output: int value
The purpose of this application is to look for a certain key in a never ever ever changing Map
(~30k keys) and to return the value. Very easy.
Question: what is more efficient when used multiple times per second:
- hard-coded dictionary in a
Map
- Read an external file with a
BufferedReader
- ...amaze me with your other ideas
I know hard-coding is evil but sometimes, you need to be evil to be efficient :-)