mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 02:58:02 +02:00
cairo-perf-diff: Use two-part hash to avoid stale data when perf suite changes.
The perf tree's sha1 is now in the cache file name, so that if the performance suite itself ever changes then new data will be generated rather than using stale stuff from the cache. Also, we now use the src tree's sha1 rather than the commit's so that commits that don't change the src directory are also treated as identical, (which they really should be as far as performance of the library itself is concerned).
This commit is contained in:
parent
e760d0927e
commit
52eb7134bd
2 changed files with 16 additions and 4 deletions
|
|
@ -46,13 +46,25 @@ git_setup() {
|
|||
|
||||
rev2sha() {
|
||||
rev=$1
|
||||
git rev-parse --verify $rev || ( echo "Cannot resolve $rev to a revision" && exit 1 )
|
||||
git rev-parse --verify $rev || ( echo "Cannot resolve $rev as a git object" && exit 1 )
|
||||
}
|
||||
|
||||
# We cache performance output based on a two-part name capturing the
|
||||
# current performance test suite and the library being tested. We
|
||||
# capture these as the tree object of the perf directory in HEAD and
|
||||
# the tree object of the src directory of the revision being tested.
|
||||
#
|
||||
# This way, whenever the performance suite is updated, cached output
|
||||
# from old versions of the suite are automatically invalidated. Also,
|
||||
# if a commit just changes things outside of the src tree, (say it
|
||||
# changes the "test" test suite, or README or configure.in, or
|
||||
# whatever), cairo-perf-diff will be smart enough to still use cached
|
||||
# results from a run with an equivalent src tree.
|
||||
rev2perf() {
|
||||
rev=$1
|
||||
sha=$(rev2sha $rev)
|
||||
echo "$CAIRO_PERF_DIR/$sha.perf"
|
||||
src_tree_sha=$(rev2sha $rev:src)
|
||||
perf_tree_sha=$(rev2sha HEAD:perf)
|
||||
echo "$CAIRO_PERF_DIR/${perf_tree_sha}-${src_tree_sha}.perf"
|
||||
}
|
||||
|
||||
# Usage: run_cairo_perf_if_not_cached <rev>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ target_is_measurable (cairo_boilerplate_target_t *target)
|
|||
case CAIRO_SURFACE_TYPE_WIN32:
|
||||
case CAIRO_SURFACE_TYPE_BEOS:
|
||||
case CAIRO_SURFACE_TYPE_DIRECTFB:
|
||||
#if CAIRO_VERSION_MAJOR > 1 || (CAIRO_VERSION_MAJOR = 1 && CAIRO_VERSION_MINOR > 2)
|
||||
#if CAIRO_VERSION_MAJOR > 1 || (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR > 2)
|
||||
case CAIRO_SURFACE_TYPE_NQUARTZ:
|
||||
case CAIRO_SURFACE_TYPE_OS2:
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue