This path normalization was functionally a recursive lstat(), which should theoretically be identical to rooting the path in the CWD and then normalizing the rest of the components after that. Well, a recursive lstat() is much slower than simple manipulation. How much slower? Well, on my system, the existing lstat() version took up a combined total of 63,284,607 us for building haiku.hpkg (only the package itself, no other components rebuilt), while this new version uses just 47,901 us -- and this just for a @minimum! I performed a full @nightly build with both versions in use at once, with an abort() in place if paths ever did not match, and it did not fire once. (I even sabotaged the new function just to ensure that it would actually find differing paths.) This code was merged in 338b8dc301721b1f472e8297a898d4eaa2f2ee3a (2005), and has remained largely unchanged since then. I don't know what the rationale was at the time for using this method instead of this much simpler version. Perhaps the 3-argument normalize_dir_path was written first and used more, while this 2-argument version was added later as a simple shim? But the original commit has no uses of the 3-argument version aside from the 2-argument one... Either way, this is an absolutely unbelievable speedup to Haiku builds. These functions are hit in every I/O operation of all libroot_build users, and their usages really do add up, as the example above shows. Fixes #16288. Change-Id: Ia11f64b0d4106ee62f22741a32ccc0c75c184442 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4427 Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Haiku
Homepage | Mailing Lists | IRC Channels | Issue Tracker | API docs
Haiku is an open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.
Goals
- Sensible defaults with minimal configuration required.
- Clean, clear, concise code.
- Unified desktop environment.
Trying Haiku
Haiku provides pre-built nightly images and release images. Haiku is compatible with a large variety of hardware, but in case you don't want to "take the plunge" and install Haiku on bare metal, you can install it on a virtual machine (VM) instead. If you've never used a VM before, you can follow one of the "Emulating Haiku" guides.
Compiling Haiku
See ReadMe.Compiling
.
Contributing
Haiku is a meritocratic open source project with a large variety of tasks. Even if you can't write code, you can still help! Haiku needs designers, (technical) writers, translators, testers... Get involved and help out!
Contributing code
If you're submitting a patch to us, please make sure you're following the patch submitting guidelines.
If you're having trouble finding something in the source tree, you can use one of our web-based source code browsers:
- https://xref.landonf.org/ (OpenGrok, provided by Landon Fuller)
- https://git.haiku-os.org/ (git, provided by Haiku, Inc.)
Contributing documentation
The main piece of documentation that still needs work are the API docs (found
in the tree at docs/user
). Just find an undocumented class, write
documentation for it, and submit a patch.
Contributing translations
See wiki:i18n.
Contributing software ports
See HaikuPorts.
Contributing to our infrastructure
See Infrastructure.