Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put common aliases in Map/Set instead of switch over strings (faceboo…
…k#26551) This is a follow up to facebook#26546 This is strictly a perf optimization since we know that switches over strings aren't optimally implemented in current engines. Basically they're a sequence of ifs. As a result, we're better off putting the unusual cases in a Map and the very common cases in the beginning of the switch. We might be better off putting very common cases in explicit ifs - just in case the engine does optimize switches to a hash table which is potentially worse. --------- Co-authored-by: Sophie Alpert <git@sophiebits.com>
- Loading branch information