I submitted a github issue on this for the other implementation I looked at here[1].
I submitted a github issue on this for the other implementation I looked at here[1].
How do you search in the lookup table? If you are thinking of a hash map it will be slower than the few operations of his custom parser.
For example, you could find whether it starts with a '-' and where the delimiter is to know the length of the number string representation (that's the "simpler parsing" part), and then don't do any work at all to decode the number, simply use these 1-5 bytes of that string (without sign and separator) directly as an index into a very large very sparse memory region in which all the valid values are pre-populated with the proper result.
You'd need to allocate 4 or 8 terabytes of virtual memory address space for that lookup table, but you'll touch only a tiny fraction of the memory pages, so it doesn't require an unacceptable amount of physical memory.
0: https://github.com/k0nserv/brc/blob/main/src/main.rs#L279
00.1
-10.3
or 0.1 (with an ending space)
so you can look up 5 bytes in the map? (+/i, two digits, dot, one digit)The idea would be, you have a tree of all values of 0.0 to 99.9 and then just use the bytes to iterate the tree (e.g. in an array) to come up with the int value of e.g. 45.5