Mercurial > hg
view contrib/hgsh/Makefile @ 52284:f4aede0f01af
rust-manifest: use `memchr` crate for all byte-finding needs
While writing a very dumb manifest diffing algorithm for a proof-of-concept
I saw that `Manifest::find_by_path` was much slower than I was expecting.
It turns out that the Rust stdlib uses slow (all is relative) code when
searching for byte positions for reasons ranging from portability, SIMD
API stability, nobody doing the work, etc. `memch` is much faster for these
purposes, so let's use it.
I was measuring ~670ms of profile time in `find_by_path`, after this patch
it went down to ~230ms.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 12 Nov 2024 23:20:04 +0100 |
parents | dbbe7f72d15a |
children |
line wrap: on
line source
CC := gcc CFLAGS := -g -O2 -Wall -Werror prefix ?= /usr/bin hgsh: hgsh.o $(CC) -o $@ $< install: hgsh install -m755 hgsh $(prefix) clean: rm -f *.o hgsh