Re: [PATCH v2 0/6] Miscellaneous speedup patches

2017-11-11 Thread Paolo Bonzini
On 11/11/2017 19:40, Paul Smith wrote: > On Wed, 2017-11-08 at 14:30 +0100, Paolo Bonzini wrote: >> Another month, another email begging for an update?? > > These changes have been pushed into the Git repository, thanks very > much. Thanks to you! > I needed to adjust s

Re: [PATCH v2 0/6] Miscellaneous speedup patches

2017-11-08 Thread Paolo Bonzini
On 22/09/2017 12:46, Paolo Bonzini wrote: > On 11/08/2017 13:44, Paolo Bonzini wrote: >> Overall, they provide a 15% improvement for my favorite testcase (QEMU's >> "no-op" build). These were first sent out last November, but there >> have been quite a fe

Re: [PATCH v2 0/6] Miscellaneous speedup patches

2017-09-24 Thread Paolo Bonzini
> I'll need to think about the hash patches: the hash implementation in > GNU make is taken pretty straightforwardly from id-utils. If we start > to modify it significantly here we'd be cutting that relationship. That > may be OK, but I'd need to think about it. Maybe you want to backport those

Re: [PATCH v2 0/6] Miscellaneous speedup patches

2017-09-22 Thread Paolo Bonzini
On 11/08/2017 13:44, Paolo Bonzini wrote: > Overall, they provide a 15% improvement for my favorite testcase (QEMU's > "no-op" build). These were first sent out last November, but there > have been quite a few changes since then: > > - I have dropped the SSE-opt

[PATCH 6/6] do not use STOP_SET for singleton sets

2017-08-11 Thread Paolo Bonzini
Compare against '$' directly rather than using MAP_VARIABLE. This is a ~10% speedup for find_map_function, which is the top hotspot in QEMU's no-op build. The build is sped up overall by about 1.5% more (from 11.1 to 10.95 seconds). * read.c (find_map_function): Do not compare against singleton

[PATCH 5/6] speedup parsing of functions

2017-08-11 Thread Paolo Bonzini
Use the stopchar map to quickly jump over everything that is not an open/close brace, an open/close parenthesis or a comma. This provides a roughly 1% improvement on QEMU's noop build (from 11.23 to 11.1 seconds). * function.c (find_next_argument, handle_function): Check with STOP_SET before comp

[PATCH 4/6] remove MAP_PERCENT

2017-08-11 Thread Paolo Bonzini
* read.c (find_percent_cached): Use strchr instead of STOP_SET to find % or nul. * makeint.h (MAP_PERCENT): Remove. * main.c (initialize_stopchar_map): Remove. --- main.c| 1 - makeint.h | 1 - read.c| 10 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/main.c b

[PATCH 2/6] use strchr for simple case of find_char_unquote

2017-08-11 Thread Paolo Bonzini
In most cases, find_char_unquote has a single stopchar. In that case we can look for it using strchr's optimized implementation. The resulting speedup on QEMU's noop build is 3.5% (from 11.78 to 11.37 seconds). * read.c (find_char_unquote): Rename to find_map_unquote. Replace with an implementa

[PATCH 1/6] use Jenkins hash

2017-08-11 Thread Paolo Bonzini
This is about twice as fast as the current hash, and removes the need for double hashing (improving locality of reference). The hash function is based on Bob Jenkins' design, slightly adapted wherever Make needs to hash NUL-terminated strings. The old hash function is kept for case-insensitive ha

[PATCH v2 0/6] Miscellaneous speedup patches

2017-08-11 Thread Paolo Bonzini
Makefile. For this reason the times are lower and the speedup from patch 5 is smaller than I had reported for v1. Paolo Paolo Bonzini (6): use Jenkins hash use strchr for simple case of find_char_unquote use strchr/memmove in collapse_continuations remove MAP_PERCENT speedup parsing of

[PATCH 3/6] use strchr/memmove in collapse_continuations

2017-08-11 Thread Paolo Bonzini
collapse_continuations is already using strchr to speed up the common case of no backslash-newline sequence, but on modern processors it is faster to scan the string twice with strchr+memmove (or strlen+memmove) than to move bytes manually. This saves about 1.5% on QEMU's no-op build (from 11.37 t

Re: [PATCH 0/5] Miscellaneous speed up patches

2017-05-12 Thread Paolo Bonzini
On 11/11/2016 18:42, Paolo Bonzini wrote: > > > On 11/11/2016 17:44, Paul Smith wrote: >> On Fri, 2016-11-11 at 12:28 +0100, Paolo Bonzini wrote: >>> Paul, any news? >> >> I expect to carve out a chunk of time to work on GNU make maintenance >> next mo

Re: [PATCH 0/5] Miscellaneous speed up patches

2016-11-11 Thread Paolo Bonzini
On 11/11/2016 17:44, Paul Smith wrote: > On Fri, 2016-11-11 at 12:28 +0100, Paolo Bonzini wrote: >> Paul, any news? > > I expect to carve out a chunk of time to work on GNU make maintenance > next month, and will try to put out a new release. These updates are > in my qu

Re: [PATCH 1/5] optimize checking for globs

2016-11-11 Thread Paolo Bonzini
On 02/11/2016 17:24, Paolo Bonzini wrote: > +int needs_glob(const char *s) > +{ > + return strpbrk (s, "?*[") == NULL; My bad, this should be "!=" NULL. I will send a v2 when I get more feedback. Paolo > +} > +#endif > diff --git a/read.c b/read.c &

Re: [PATCH 0/5] Miscellaneous speed up patches

2016-11-11 Thread Paolo Bonzini
On 02/11/2016 17:24, Paolo Bonzini wrote: > These patches optimize the hotspots in QEMU's "noop" build: > > - patch 1: parse_file_seq / strpbrk > > - patch 2: find_char_unquote > > - patch 3: variable_hash_1 / variable_hash_2 > > - patches 4+5: h

Re: [PATCH 3/5] use jhash for STRING_N_HASH

2016-11-03 Thread Paolo Bonzini
On 03/11/2016 09:44, Andreas Schwab wrote: > On Nov 02 2016, Paolo Bonzini wrote: > >> +#define sum_get_unaligned_32(r, p) \ >> + do { \ >> +unsigned int val; \ >

[PATCH 4/5] remove MAP_PERCENT

2016-11-02 Thread Paolo Bonzini
This is needed to free a stopchar_map bit for the next patch. * read.c (find_percent_cached): Use strchr instead of STOP_SET to find % or nul. * makeint.h (MAP_PERCENT): Remove. * main.c (initialize_stopchar_map): Remove. --- main.c| 1 - makeint.h | 1 - read.c| 10 +- 3 files

[PATCH 1/5] optimize checking for globs

2016-11-02 Thread Paolo Bonzini
This removes the hotspot in parse_file_seq's call to strpbrk, by using SSE2 vector instructions. The resulting speedup on QEMU's noop build is around 6% (15.4 seconds to 14.5). The code is roughly based on GCC's similar optimizations in the lexer. * read-opt.c: New. * read.c (parse_file_seq): Us

[PATCH 2/5] use strchr for simple case of find_char_unquote

2016-11-02 Thread Paolo Bonzini
In most cases, find_char_unquote has a single stopchar. In that case we can look for it using strchr's optimized implementation. The resulting speedup on QEMU's noop build is 4.4% (from 14.5 seconds to 13.8). * read.c (find_char_unquote): Rename to find_map_unquote. Replace with an implementati

[PATCH 0/5] Miscellaneous speed up patches

2016-11-02 Thread Paolo Bonzini
employer has a blanket assignment on file). Thanks, Paolo Paolo Bonzini (5): optimize checking for globs use strchr for simple case of find_char_unquote use jhash for STRING_N_HASH remove MAP_PERCENT speedup parsing of functions Makefile.am | 6 ++--- Makefile.in | 19 ++--- f

[PATCH 5/5] speedup parsing of functions

2016-11-02 Thread Paolo Bonzini
Use the stopchar map to quickly jump over everything that is not an open/close brace, an open/close parenthesis or a comma. This provides an 1.5% improvement on QEMU's noop build (from 13.2 seconds to 13). * function.c (find_next_argument, handle_function): Ignore characters quickly using the sto

[PATCH 3/5] use jhash for STRING_N_HASH

2016-11-02 Thread Paolo Bonzini
The hottest hash table in Make is the variable hash, and it is easy to apply a better function (that works on bigger chunks than just one byte) because the length of its key is known. This is about twice as fast as the current hash, and removes the need for double hashing (improving locality of ref

erroneous MAKEFLAGS test in GNU Make's manual

2010-10-05 Thread Paolo Bonzini
The manual's example of using $(findstring) to test MAKEFLAGS: archive.a: ... ifneq (,$(findstring t,$(MAKEFLAGS))) +touch archive.a +ranlib -t archive.a else ranlib archive.a endif was broken by the addition of --no-print-directory to $

Re: RFC: Make is a HUGE memory hog

2005-12-13 Thread Paolo Bonzini
GNU make 3.80 is a HUGE memory hog. It calls xstrdup to build dependency list. gnu-src-gcc.deps in libjava has 3000+ targets depend the same 3000+ files, whose filenames are more than 260K. For this dependency alone, make takes 3000*260K == 761MB. Then, you should make the 3000+ target depend