Commit Graph

103 Commits

Author SHA1 Message Date
Pulkit Goyal
17d5faaa79 contrib: make perf.py use absolute_import 2016-03-16 04:12:16 +05:30
Gregory Szorc
f5985dcd63 revlog: return offset from _chunkraw()
A subsequent patch will refactor _chunks() and the calculation of the
offset will no longer occur in that function. Prepare by returning the
offset from _chunkraw().
2016-01-05 19:51:51 -08:00
Bryan O'Sullivan
7cd156ddd3 perf: close transaction in perffncachewrite
This fixes a bug, and brings CPython behaviour on this test into
line with PyPy.
2015-12-27 23:55:54 +09:00
Gregory Szorc
517d3d4815 perf: make start revision configurable for perfrevlog
This will help isolate performance characteristics of delta chains.
2015-12-20 19:56:23 -08:00
Gregory Szorc
e8cdc56137 perf: use standard arguments for perfrevlog
We have a convention of using -c|-m|FILE elsewhere for reading from
revlogs. Use it for `hg perfrevlog`.

While I was here, I also added a docstring to document what this
command does, as "perfrevlog" is ambiguous.
2015-12-20 19:45:55 -08:00
Matt Mackall
a8248afde0 cleanup: back out performance hacks amended into previous commit 2015-12-21 14:52:18 -06:00
timeless
777dbfe303 commands: consistently indent notes 3 spaces
most notes have 3 spaces for indentation, these had 2...
2015-12-18 06:33:48 +00:00
Gregory Szorc
9f75546b76 perf: add perfrevlogrevision
As part of investigating performance improvements to revlog reading,
I needed a mechanism to measure every part of revlog reading so I knew
where time was spent and how effective optimizations were.

This patch implements a perf command for benchmarking the various
stages of reading a single revlog revision.

When executed against a manifest revision at the end of a 30,000+
long delta chain in mozilla-central, the command demonstrates that
~80% of time is spent in zlib decompression.
2015-12-20 18:38:21 -08:00
Gregory Szorc
179b25b04a perf: call clearcaches() in perfmanifest
The old code only partially cleared the caches. Now that we have a
comprehensive method for wiping all caches, let's call it.

This appears to introduce a marginal regression in `hg perfmanifest`
on mozilla-central. This is good because the new result is more
accurate since caches aren't being used.
2015-12-20 17:57:44 -08:00
Matt Harbison
ac7fc5b232 perf: adjust perfstartup() for Windows
The /dev/null redirect was causing the following error:

  The system cannot find the path specified.

Adjusting HGRCPATH as part of the command line causes the system to try to
execute 'HGRCPATH'.
2015-12-13 18:13:44 -05:00
Augie Fackler
a84cc516e7 merge: restate calculateupdates in terms of a matcher
Once we get a matcher down into manifestmerge, we can make narrowhg
work more easily and potentially let manifest.match().diff() do less
work in manifestmerge.
2015-12-14 20:37:41 -05:00
timeless
e91c29104b perf: perfrevlog optimize for perf.stub 2015-12-04 19:05:56 +00:00
timeless
0da8511b85 perf: add getlen
getlen will return 1 if perf.stub
2015-12-04 19:05:32 +00:00
timeless
04f03f3aeb perf: add optional rev for perflog and perftemplating 2015-12-04 18:08:50 +00:00
timeless
05d63c41ee perf: perfparents honor config perf.parentscount 2015-12-04 18:18:07 +00:00
timeless
c9727daf48 perf: offer perf.stub to only run one loop 2015-12-04 17:41:30 +00:00
timeless
aa0ea59703 perf: improve grammar of gettimer comment 2015-12-04 17:41:02 +00:00
Gregory Szorc
da7e434856 perf: add perflrucachedict command
It measures time to construct, perform gets, sets, or mixed mode
operations on a cache of configurable size with variable numbers of
operations.
2015-12-06 17:07:50 -08:00
timeless
6706ae14fe contrib/perf: perfparents handle filtered repos 2015-11-24 21:36:20 +00:00
timeless
0706103b1f contrib/perf: perfparents handle tiny repos
refuse to run if there are not enough commits
2015-11-24 20:54:14 +00:00
timeless
d5fb95573c contrib/perf: fix perfmergecalculate
merge.calculateupdates requires an array of ancestors and followcopies
2015-11-24 21:44:16 +00:00
timeless
1781386673 contrib/perf: fix perffncachewrite
fncache.write requires a transaction (and thus a lock)
2015-11-24 22:01:11 +00:00
timeless
73fa098081 contrib/perf: omit duplicated function 2015-11-24 20:05:15 +00:00
timeless
87b00f7ab0 contrib/perf: name functions to match decorators 2015-11-24 20:08:21 +00:00
Gregory Szorc
86b206e002 perf: support obtaining contexts from perfrevset
Previously, perfrevset called repo.revs(), which only returns integer
revisions. Many revset consumers call repo.set(), which returns
changectx instances. Or they obtain a context manually later.

Since obtaining changectx instances when evaluating revsets is common,
this patch adds support for benchmarking this use case.

While we added an if conditional for every benchmark loop, it
doesn't appear to matter since revset evaluation dwarfs the cost
of a single if.
2015-11-21 15:39:18 -08:00
Matt Mackall
fd472e2570 perf: un-bitrot perfstatus 2015-11-19 15:02:27 -06:00
FUJIWARA Katsunori
106983607a dirstate: make dirstate.write() callers pass transaction object to it
Now, 'dirstate.write(tr)' delays writing in-memory changes out, if a
transaction is running.

This may cause treating this revision as "the first bad one" at
bisecting in some cases using external hook process inside transaction
scope, because some external hooks and editor process are still
invoked without HG_PENDING and pending changes aren't visible to them.

'dirstate.write()' callers below in localrepo.py explicitly use 'None'
as 'tr', because they can assume that no transaction is running:

  - just before starting transaction
  - at closing transaction, or
  - at unlocking wlock
2015-10-17 01:15:34 +09:00
Matt Mackall
e6644982a8 perf: mark experimental option presleep 2015-07-18 14:16:36 -05:00
Pierre-Yves David
a4580cc28e perf: support -T for every perf commands
We are already building a formatter, we can now pass it options the official
way.
2015-06-09 15:18:47 -07:00
Siddharth Agarwal
6a367ef5be perf: make measuring foldmap perf work again
Rev 54727f222a91 split the foldmap into two, but I forgot to update perf for
the changes.
2015-04-02 19:13:50 -07:00
Matt Mackall
bbeea83192 perf: add methods for timing changeset file list reading 2015-03-18 12:03:44 -05:00
Angel Ezquerra
6e49f7def8 localrepo: remove all external users of localrepo.sopener
This change touches every module in which repository.sopener was being used, and
changes it for the equivalent repository.svfs.

It should now be possible to remove localrepo.sopener.
2015-01-11 00:25:54 +01:00
Matt Mackall
465be7563f perf: add a configurable sleep on startup
This is intended to counteract power management by giving a consistent
idle period before test runs.
2015-01-10 21:13:10 -06:00
Matt Harbison
3c47e94de7 commit: propagate --addremove to subrepos if -S is specified (issue3759)
The recursive addremove operation occurs completely before the first subrepo is
committed.  Only hg subrepos support the addremove operation at the moment- svn
and git subrepos will warn and abort the commit.
2014-11-24 22:27:49 -05:00
Matt Harbison
9e4d7cc2d3 scmutil: pass a matcher to scmutil.addremove() instead of a list of patterns
This will make it easier to support subrepository operations.
2014-11-09 19:57:02 -05:00
Pierre-Yves David
a2ff033417 perf: add a perfloadmarkers command
It is used to benchmark the obsstore initialization time.
2014-11-20 16:27:55 -08:00
Pierre-Yves David
1154bfe337 perf: use a formatter for output
We use a `formatter` object in the perf extensions. This allow the use of
formatted output like json. To avoid adding logic to create a formatter and pass
it around to the timer function in every command, we add a `gettimer` function
in charge of returning a `timer` function as simple as before but embedding an
appropriate formatter.

This new `gettimer` function also return the formatter as it needs to be
explicitly closed at the end of the command.

example output:


  $ hg --config ui.formatjson=True perfvolatilesets visible obsolete
  [
   {
    "comb": 0.02,
    "count": 126,
    "sys": 0.0,
    "title": "obsolete",
    "user": 0.02,
    "wall": 0.0199398994446
   },
   {
    "comb": 0.02,
    "count": 117,
    "sys": 0.0,
    "title": "visible",
    "user": 0.02,
    "wall": 0.0250301361084
   }
  ]
2014-11-04 10:40:06 +00:00
Siddharth Agarwal
6a0b47b797 perf: add a way to measure the perf of constructing the foldmap
Constructing the foldmap is a necessary part of operations like 'hg status' on
OS X. This command allows us to measure the perf of constructing it.
2014-10-03 19:58:26 -07:00
Pierre-Yves David
8dd85d0996 perf: unroll the result in perfrevset
With the new lazy revset implementation, we need to actually read all elements
to trigger all the computations. Otherwise a no-op if of course much faster than
the full work.
2014-03-26 17:25:11 -07:00
Pierre-Yves David
f834b74f49 perf: fix perfvolatilesets
The repoview's `filteredrevs` has been renamed to `filterrevs` at some point.
perf was never informed.
2013-12-23 16:04:51 -08:00
Brodie Rao
aba805d85d perf: add perfmoonwalk command to walk the changelog backwards
This lets us test the effectiveness (or ineffectiveness) of the revlog chunk
cache when walking revlogs backwards.
2013-11-17 18:04:28 -05:00
Augie Fackler
2859ed15ec subsettable: move from repoview to branchmap, the only place it's used
This is a step towards breaking an import cycle between revset and
repoview. Import cycles happened to work in Python 2 with implicit
relative imports, but breaks on Python 3 when we start using explicit
relative imports via 2to3 rewrite rules.
2013-11-06 14:38:34 -05:00
Augie Fackler
2727bcf864 perf: rearrange imports of changelong and manifest to appease check-code 2013-09-20 10:14:59 -04:00
Siddharth Agarwal
10bb361ad4 perfmanifest: allow and require passing in a rev
Previously perfmanifest would only test tip.
2013-09-06 13:35:29 -07:00
Siddharth Agarwal
79b9a1c4e5 perfmanifest: fix cache invalidation
The manifest cache is now stored in _mancache. The revlog cache is still stored
in _cache.
2013-09-06 13:20:07 -07:00
Simon Heimberg
6059e06d0f cleanup: drop unused variables and an unused import 2013-07-01 20:48:56 +02:00
Simon Heimberg
8a32578a00 cleanup: remove unused imports
detected by pyflakes
2013-06-13 01:36:58 +02:00
Durham Goode
94d98a2fbb annotate: simplify annotate parent function
The annotate algorithm used a custom parents() function to try to reuse
filectx and filelogs. I simplified it a bit to rely more heavily on the
self.parents() which makes it work well with alternative filectx
implementations. I tested performance on a file with 5000+ revisions
but no renames, and on a file with 500 revisions repeating a series of
4 edits+renames and saw zero performance hit.  In fact, it was reliably a
couple milliseconds faster now.

Added the perfannotate command to contrib/perf.py for future use.
2013-05-30 19:29:03 -07:00
Siddharth Agarwal
b2115318e7 perf: add a command to test copies.pathcopies perf
An upcoming patch will improve the performance of this function, and this
command will be used to demonstrate that improvement.
2013-04-04 20:36:46 -07:00
Siddharth Agarwal
3d47559133 perf: add a command to test addremove performance
Upcoming patches will improve addremove performance. This command will be used
to demonstrate that improvement.
2013-04-01 23:09:36 -07:00