Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 367481 - mercurial.eclass: 'Creating working directory' eats a lot of CPU time
Summary: mercurial.eclass: 'Creating working directory' eats a lot of CPU time
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Krzysztof Pawlik (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 07:57 UTC by Michał Górny
Modified: 2011-08-03 19:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log with 'time' call added (20110516-074319.log,2.89 KB, text/plain)
2011-05-16 07:57 UTC, Michał Górny
Details
Patch to use faster --updaterev (mercurial.eclass.diff,1.24 KB, patch)
2011-08-03 07:18 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-05-16 07:57:05 UTC
Created attachment 273375 [details]
Build log with 'time' call added

The 'Creating working directory' part of mercurial_src_unpack() does take a lot of time for me and keeps CPU 100% busy. That seems at least a little odd to me, as checkout should be I/O-bound. I'm hitting that with dev-lang/python hg ebuilds from the python overlay.

My guess is that hg does some kind of repository repacking during the repo->checkout clone. If that's the case, I think we should look for a more efficient solution for checkouts.

I'm attaching the short build log for interrupted python:2.7 build. I prefixed the 'hg clone' call with a 'time' command.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-08-02 15:58:50 UTC
To be honest, it seems that replacing '--rev' with '--updaterev' makes this faster (less CPU- and a more I/O-intensive).
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-08-03 07:09:40 UTC
Using python:3.2::python.

--rev:
real	7m9.001s
user	6m17.056s
sys	0m13.373s

--updaterev:
real	0m27.064s
user	0m8.394s
sys	0m4.642s

--rev with warm cache:
real	6m35.514s
user	6m12.527s
sys	0m11.608s
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-08-03 07:18:10 UTC
Created attachment 281933 [details, diff]
Patch to use faster --updaterev

As proven earlier, using --updaterev is much faster than --rev. This patch updates the eclass to do so.
Comment 4 Krzysztof Pawlik (RETIRED) gentoo-dev 2011-08-03 19:02:58 UTC
(In reply to comment #3)
> Created attachment 281933 [details, diff]
> Patch to use faster --updaterev
> 
> As proven earlier, using --updaterev is much faster than --rev. This patch
> updates the eclass to do so.

Thanks for your awesome work on this issue, committed:

revision 1.16
date: 2011-08-03 21:01:16 +0200;  author: nelchael;  state: Exp;  lines: +4 -4;  commitid: 65f4e399afc4567;
Use --updaterev instead of --rev, thanks to Michał Górny (mgorny@gentoo.org), see bug #367481.
=============================================================================