view hgweb.cgi @ 30914:74cfc4357c64

perf: split obtaining chunks from decompression Previously, the code was similar to what revlog._chunks() was doing, which took a raw data segment and delta chain, obtained buffers for the raw revlog chunks within, and decompressed them. This commit splits the "get raw chunks" action from "decompress." The goal of this change is to more accurately measurely decompression performance. On a ~50k deltachain for a manifest in mozilla-central: ! full ! wall 0.430548 comb 0.440000 user 0.410000 sys 0.030000 (best of 24) ! deltachain ! wall 0.016053 comb 0.010000 user 0.010000 sys 0.000000 (best of 181) ! read ! wall 0.008078 comb 0.010000 user 0.000000 sys 0.010000 (best of 362) ! rawchunks ! wall 0.033785 comb 0.040000 user 0.040000 sys 0.000000 (best of 100) ! decompress ! wall 0.327126 comb 0.320000 user 0.320000 sys 0.000000 (best of 31) ! patch ! wall 0.032391 comb 0.030000 user 0.030000 sys 0.000000 (best of 100) ! hash ! wall 0.012587 comb 0.010000 user 0.010000 sys 0.000000 (best of 233)
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 04 Feb 2017 08:47:46 -0800
parents 4b0fc75f9403
children 47ef023d0165
line wrap: on
line source

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also https://mercurial-scm.org/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)