On 03/11/2016 07:16, Fam Zheng wrote: > On Wed, 11/02 17:24, Paolo Bonzini wrote: >> Unnesting variables spends a lot of time parsing and executing foreach >> and if functions. Because actually very few variables have to be >> saved and restored, a good strategy is to remember what has to be done >> in load-vars, and only iterate the right variables in load-vars. >> For save-vars, unroll the foreach loop to provide another small >> improvement. >> >> This speeds up a "noop" build from around 15.5 seconds on my laptop >> to 11.7 (25% roughly). >> >> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> >> --- >> I'm wondering if this would be acceptable for 2.8. > > I think that's fine if you don't want to bear the slowness in 2.8. But TBH I > haven't really noticed this as an issue myself. Anyway, > > Reviewed-by: Fam Zheng <f...@redhat.com> > >> I also have sent patches to GNU make that save another >> 20%, down to 9.8 seconds. > > Wow, is there a link to the patch?
In theory it would be http://lists.gnu.org/archive/html/bug-make/2016-10/index.html but I cannot see it there yet. Anyway it's not rocket science: use strchr instead of a hand-rolled while loop, improve hash functions, and an optimized version of strpbrk using SSE2. Paolo