Store keys as ByteStrings
authorKlaus Aehlig <aehlig@google.com>
Thu, 12 Nov 2015 13:51:16 +0000 (14:51 +0100)
committerKlaus Aehlig <aehlig@google.com>
Fri, 13 Nov 2015 11:44:39 +0000 (12:44 +0100)
commitc1fc9605d85c2f06f122d3b3041e4ec14b042d6b
treef81a3e5745bdb6b91b65eb884e7d18b00702745f
parentdfb1a6a9902233977db521d50bdf808be3b3eb85
Store keys as ByteStrings

Keys to maps are only used to look up values, so
a compact representation does impact flexibility.
However, it does save on memory usage; having more
locality in the keys also improves time when comparing
them.

While there, also refrain from linearly looking through
keys searching for partial matches where partial matches
are not desired (e.g., when looking up things by uuid).

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
16 files changed:
src/Ganeti/Config.hs
src/Ganeti/DataCollectors.hs
src/Ganeti/JSON.hs
src/Ganeti/Monitoring/Server.hs
src/Ganeti/Query/Instance.hs
src/Ganeti/Query/Network.hs
src/Ganeti/Query/Query.hs
src/Ganeti/Query/Server.hs
src/Ganeti/WConfd/ConfigModifications.hs
src/Ganeti/WConfd/ConfigVerify.hs
src/Ganeti/WConfd/Ssconf.hs
src/Ganeti/WConfd/TempRes.hs
test/hs/Test/Ganeti/Objects.hs
test/hs/Test/Ganeti/OpCodes.hs
test/hs/Test/Ganeti/Query/Filter.hs
test/hs/Test/Ganeti/Query/Network.hs