1 | | Keep it up. Do you think using Sets may improve performance further as Sets not allow duplicates? This way we might save the cost of indexOf() === -1 which is expensive as it is checked within the double loop (=> n*m*m) in GetAllBuildableEntities() in the GuiInterface. Also === check is expensive in comparison to != check (as all bits and type have to be checked for equality while for != we can terminate once we have found one non-equal bit .. anyway, that's lowlevel, no idea if the javascript compiler optimizes this automatically .. but probably not). |
| 1 | Keep it up. Do you think using Sets may improve performance further as Sets not allow duplicates (not sure about Javascript set internals but perhaps it's constant time if they simply overwrite a duplicate entry instead of checking for duplicates)? |
| 2 | |
| 3 | This way we might save the cost of indexOf() === -1 which is expensive as it is checked within the double loop (=> n*m*m) in GetAllBuildableEntities() in the GuiInterface. Also === check is expensive in comparison to != check (as all bits and type have to be checked for equality while for != we can terminate once we have found one non-equal bit .. anyway, that's lowlevel, no idea if the javascript compiler optimizes this automatically .. but probably not). |