Rerumu / Wasynth

WebAssembly to Lua translation library and tool
https://discord.gg/sgm5YcmgyD
GNU General Public License v3.0
130 stars 18 forks source link

Add `BrTable` optimization heuristic #18

Open Rerumu opened 2 years ago

Rerumu commented 2 years ago

Right now when BrTable is translated, it always uses a combination of a lookup table and binary search tree. This is efficient, but not necessarily optimal for when the number of targets is small. In this case it is preferable to just emit a binary search tree directly for about a dozen items or less.