Start time performance improvements to build tools (#3797)

* Make os.cpus() faster on Linux

* Fix crash

See https://github.com/ziglang/zig/issues/16540

* Handle watcher_count == 0

* Add assertion

* Clean up lifetimes of fs watcher a little

* ✂️

* Use `errdefer`

* Make the error better

* Make os.cpus() more lazy

* Please don't translate-c on the entire C standard library

* immediately closing works correctly is still bug

* ops

* fmt+fixeup

* add back verbose

* free instead of destroy

* remove destroy option for watcher tasks

* flush verbose and add debug log

* fixup files

* use log for debug

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
This commit is contained in:
Jarred Sumner
2023-07-26 21:35:49 -07:00
committed by GitHub
parent ec2cf38ad8
commit 86633e0af4
13 changed files with 869 additions and 364 deletions

View File

@@ -672,15 +672,7 @@ pub fn startsWith(self: string, str: string) bool {
return false;
}
var i: usize = 0;
while (i < str.len) {
if (str[i] != self[i]) {
return false;
}
i += 1;
}
return true;
return eqlLong(self[0..str.len], str, false);
}
pub inline fn endsWith(self: string, str: string) bool {