Changes between Version 1 and Version 2 of Ticket #2179, comment 30
- Timestamp:
- Oct 19, 2014, 10:52:02 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2179, comment 30
v1 v2 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 ^2) 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? 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).