Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider a different hash algorithm for the various hash maps+sets #1657

Open
Rangi42 opened this issue Feb 12, 2025 · 0 comments
Open

Consider a different hash algorithm for the various hash maps+sets #1657

Rangi42 opened this issue Feb 12, 2025 · 0 comments
Labels
optimization This increases performance or decreases size
Milestone

Comments

@Rangi42
Copy link
Contributor

Rangi42 commented Feb 12, 2025

See https://github.com/taviso/swisstable

std::unordered_map<std::string, T>:

src/asm/charmap.cpp:37:static std::unordered_map<std::string, size_t> charmapMap; // Indexes into `charmapList`
src/asm/lexer.cpp:140:static std::unordered_map<std::string, int, CaseInsensitive, CaseInsensitive> keywordDict = {
src/asm/main.cpp:136:   std::unordered_map<std::string, std::vector<StateFeature>> stateFileSpecs;
src/asm/section.cpp:44:std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`
src/asm/symbol.cpp:22:std::unordered_map<std::string, Symbol> symbols;
src/link/section.cpp:14:std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`
src/link/symbol.cpp:15:std::unordered_map<std::string, Symbol *> symbols;
src/link/symbol.cpp:16:std::unordered_map<std::string, std::vector<Symbol *>> localSymbols;

Other std::(unordered_)?(map|set):

src/asm/charmap.cpp:48:         std::map<size_t, std::string> mappings;
src/asm/symbol.cpp:23:std::unordered_set<std::string> purgedSymbols;
src/gfx/pal_packing.cpp:156:        std::unordered_set<uint16_t> &colors,
src/gfx/pal_packing.cpp:167:    std::unordered_set<uint16_t> &uniqueColors() const {
src/gfx/pal_packing.cpp:180:            static std::unordered_set<uint16_t> colors;
src/gfx/pal_packing.cpp:303:            std::unordered_set<uint16_t> colors;
src/gfx/process.cpp:904:        std::unordered_set<TileData> tileset;
src/gfx/process.cpp:1118:               std::unordered_set<uint16_t> tileColors;
@Rangi42 Rangi42 added the optimization This increases performance or decreases size label Feb 12, 2025
@Rangi42 Rangi42 added this to the 0.9.2 milestone Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization This increases performance or decreases size
Projects
None yet
Development

No branches or pull requests

1 participant