bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
76 stars 228 forks source link

`virtual-target.register` 6x performance improvement #303

Closed Kojoley closed 1 year ago

Kojoley commented 1 year ago

total 79.2 -> 13.2 (6.0x) self 34.2 -> 8.1 (4.2x)

target.actual-name is an ideal cache key because it is already used to register targets in the build engine which requires on it to be unique enough to not collide, while also is the shortest unique identifying string which is for a file targets consists of the target relevant properties, path prefix and name.

This simplification also makes it easy to port register/recent-targets/clear-recent-targets/all-targets to native which probably will have a significant impact too (at least on these 8 seconds virtual-target.register self time).