[PATCH 2 of 6] scripts: docs-headings: distribute over available CPU cores

Mads Kiilerich mads at kiilerich.com
Sat Dec 29 23:45:39 UTC 2018


On 12/29/18 10:50 PM, Thomas De Schampheleire wrote:
> # HG changeset patch
> # User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
> # Date 1546110972 -3600
> #      Sat Dec 29 20:16:12 2018 +0100
> # Node ID a7df630cfe21e5e66c555b9fa88ef2c3930870b1
> # Parent  6caed3c13cb8d631430371b8e1141a724c4c4cae
> scripts: docs-headings: distribute over available CPU cores
>
> This script is only relevant for contributors, and the fact that it is quite
> slow is normally not a big problem.
> However, when running it in iteration on different commits, as preparation
> to sending out a series, its slowness becomes annoying.


Yeah, the script takes something like 30s to run for me.

But most of the time is spent running 'hg diff' once for each file. Just 
the part of your change that moves it to a simple diff call takes it 
down to less than one second.

The parallelization doesn't seem to save additional time. Perhaps 
because I don't have many cores. But is it really worth the extra 
complexity? Then let's assess the parallelization separate from the 
single hg invocation.

/Mads


More information about the kallithea-general mailing list