qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* sphinx-build is really slow, any way to improve that?
@ 2022-09-05 19:48 Claudio Fontana
  2022-09-05 21:21 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Claudio Fontana @ 2022-09-05 19:48 UTC (permalink / raw)
  To: qemu-devel

Hi all,

when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.

Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..

Thanks,

Claudio


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sphinx-build is really slow, any way to improve that?
  2022-09-05 19:48 sphinx-build is really slow, any way to improve that? Claudio Fontana
@ 2022-09-05 21:21 ` Peter Maydell
  2022-09-06  7:55   ` Daniel P. Berrangé
  2022-09-06  8:17   ` Markus Armbruster
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2022-09-05 21:21 UTC (permalink / raw)
  To: Claudio Fontana; +Cc: qemu-devel

On Mon, 5 Sept 2022 at 20:51, Claudio Fontana <cfontana@suse.de> wrote:
> when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.
>
> Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..

It's a big fat python program, so I suspect not, but
maybe I'm wrong.

You can always configure --disable-docs if you don't care
about the docs and want to make builds faster.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sphinx-build is really slow, any way to improve that?
  2022-09-05 21:21 ` Peter Maydell
@ 2022-09-06  7:55   ` Daniel P. Berrangé
  2022-09-06 13:41     ` Peter Maydell
  2022-09-06  8:17   ` Markus Armbruster
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2022-09-06  7:55 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Claudio Fontana, qemu-devel

On Mon, Sep 05, 2022 at 10:21:55PM +0100, Peter Maydell wrote:
> On Mon, 5 Sept 2022 at 20:51, Claudio Fontana <cfontana@suse.de> wrote:
> > when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.
> >
> > Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..
> 
> It's a big fat python program, so I suspect not, but
> maybe I'm wrong.

It annoys me too and I've had a look at what it is doing in the past and
failed to find an obvious way to improve it. I fear this could be an
inherant limitation of the way we use sphinx to build the docs as a
complete manual, as compared to say treating each docs source file as
a distinct standalone web page.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sphinx-build is really slow, any way to improve that?
  2022-09-05 21:21 ` Peter Maydell
  2022-09-06  7:55   ` Daniel P. Berrangé
@ 2022-09-06  8:17   ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2022-09-06  8:17 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Claudio Fontana, qemu-devel

Peter Maydell <peter.maydell@linaro.org> writes:

> On Mon, 5 Sept 2022 at 20:51, Claudio Fontana <cfontana@suse.de> wrote:
>> when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.
>>
>> Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..
>
> It's a big fat python program, so I suspect not, but
> maybe I'm wrong.
>
> You can always configure --disable-docs if you don't care
> about the docs and want to make builds faster.

I care about the docs, but the impact on turnaround time is so bad I
stopped building the docs in the build trees I use for development, and
instead keep a separate tree that has docs enabled.  Tends to delay
diagnosis of doc markup errors, but that's the lesser evil for me.

We used to have a similar problem with generated C: touch the QAPI
schema, rebuild everything and its dog.  That was because everything and
its dog depended on the generated QAPI header.  C projects 101: putting
everything in a single header slows down rebuilds.

We solved this by splitting up the generated header, and updating
generated headers only when they actually change.

I have no idea whether Sphinx could do a similarly incremental rebuild.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sphinx-build is really slow, any way to improve that?
  2022-09-06  7:55   ` Daniel P. Berrangé
@ 2022-09-06 13:41     ` Peter Maydell
  2022-09-06 13:57       ` Daniel P. Berrangé
  2022-09-07  8:59       ` Markus Armbruster
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2022-09-06 13:41 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Claudio Fontana, qemu-devel

On Tue, 6 Sept 2022 at 08:55, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Mon, Sep 05, 2022 at 10:21:55PM +0100, Peter Maydell wrote:
> > On Mon, 5 Sept 2022 at 20:51, Claudio Fontana <cfontana@suse.de> wrote:
> > > when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.
> > >
> > > Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..
> >
> > It's a big fat python program, so I suspect not, but
> > maybe I'm wrong.
>
> It annoys me too and I've had a look at what it is doing in the past and
> failed to find an obvious way to improve it. I fear this could be an
> inherant limitation of the way we use sphinx to build the docs as a
> complete manual, as compared to say treating each docs source file as
> a distinct standalone web page.

IIRC sphinx really really wants to process the whole document tree
in one go. You can see this in the way that for example the
HTML build process creates HTML files for the top-level rst
files that are supposed to be only for the manpage -- it will
suck in and process everything, not just the files reachable
via whatever top level file you point it at.

-- PMM


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sphinx-build is really slow, any way to improve that?
  2022-09-06 13:41     ` Peter Maydell
@ 2022-09-06 13:57       ` Daniel P. Berrangé
  2022-09-07  8:59       ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel P. Berrangé @ 2022-09-06 13:57 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Claudio Fontana, qemu-devel

On Tue, Sep 06, 2022 at 02:41:13PM +0100, Peter Maydell wrote:
> On Tue, 6 Sept 2022 at 08:55, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Mon, Sep 05, 2022 at 10:21:55PM +0100, Peter Maydell wrote:
> > > On Mon, 5 Sept 2022 at 20:51, Claudio Fontana <cfontana@suse.de> wrote:
> > > > when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.
> > > >
> > > > Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..
> > >
> > > It's a big fat python program, so I suspect not, but
> > > maybe I'm wrong.
> >
> > It annoys me too and I've had a look at what it is doing in the past and
> > failed to find an obvious way to improve it. I fear this could be an
> > inherant limitation of the way we use sphinx to build the docs as a
> > complete manual, as compared to say treating each docs source file as
> > a distinct standalone web page.
> 
> IIRC sphinx really really wants to process the whole document tree
> in one go. You can see this in the way that for example the
> HTML build process creates HTML files for the top-level rst
> files that are supposed to be only for the manpage -- it will
> suck in and process everything, not just the files reachable
> via whatever top level file you point it at.

Yeah, thats why I think we're limited by what sphinx upstream can do
for us. They need to be able to parallelize stuff in their loading
and generation code.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sphinx-build is really slow, any way to improve that?
  2022-09-06 13:41     ` Peter Maydell
  2022-09-06 13:57       ` Daniel P. Berrangé
@ 2022-09-07  8:59       ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2022-09-07  8:59 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Daniel P. Berrangé, Claudio Fontana, qemu-devel

Peter Maydell <peter.maydell@linaro.org> writes:

> On Tue, 6 Sept 2022 at 08:55, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>
>> On Mon, Sep 05, 2022 at 10:21:55PM +0100, Peter Maydell wrote:
>> > On Mon, 5 Sept 2022 at 20:51, Claudio Fontana <cfontana@suse.de> wrote:
>> > > when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build.
>> > >
>> > > Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me..
>> >
>> > It's a big fat python program, so I suspect not, but
>> > maybe I'm wrong.
>>
>> It annoys me too and I've had a look at what it is doing in the past and
>> failed to find an obvious way to improve it. I fear this could be an
>> inherant limitation of the way we use sphinx to build the docs as a
>> complete manual, as compared to say treating each docs source file as
>> a distinct standalone web page.
>
> IIRC sphinx really really wants to process the whole document tree
> in one go. You can see this in the way that for example the
> HTML build process creates HTML files for the top-level rst
> files that are supposed to be only for the manpage -- it will
> suck in and process everything, not just the files reachable
> via whatever top level file you point it at.

How do other projects deal with the resulting slowness?

Could we avoid rerunning sphinx-build when documentation hasn't changed?



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-07  9:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-05 19:48 sphinx-build is really slow, any way to improve that? Claudio Fontana
2022-09-05 21:21 ` Peter Maydell
2022-09-06  7:55   ` Daniel P. Berrangé
2022-09-06 13:41     ` Peter Maydell
2022-09-06 13:57       ` Daniel P. Berrangé
2022-09-07  8:59       ` Markus Armbruster
2022-09-06  8:17   ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).