feat: Find alternatives to PHF for conditional compiling. #200
Labels
crate
Stuff related to the crate in general
dependencies
Pull requests that update a dependency file
game
This is something regarding a game
v1.0.X
Things about v1.0.X
Milestone
Describe the problem
When Ark: Survival Ascended was added in #197 we couldn't add it to the games definitions because the game (and protocol) is available only through the
tls
feature to avoid adding another hard dependency.And we can't use conditional stuff with PHF in the way we use it now.
Possible solutions
phf
with phf_codegen and create abuild.rs
script.Advantages: the fastest solution as this will generate and make the hashmap available at compile time.
Disadvantages: negligible bigger compile time I guess? and I for one am not really a fan of build scripts.
Advantages: Easiest to use and fastest to transition to.
Disadvantages: The first call will take a while to compute (but considering that everything that we use is const, the only overhead should be just the hashmap construction and inserts (dont quote me on this)) and therefore isn't really great for CLI performance.
Here is a quick snippet of a poc of the usage:
lazy_static
only if we enable certain features.I haven't looked that much into this but it's something that came up when I wrote this.
The text was updated successfully, but these errors were encountered: