##// END OF EJS Templates
revlog: use compression engine API for compression...
revlog: use compression engine API for compression This commit swaps in the just-added revlog compressor API into the revlog class. Instead of implementing zlib compression inline in compress(), we now store a cached-on-first-use revlog compressor on each revlog instance and invoke its "compress()" method. As part of this, revlog.compress() has been refactored a bit to use a cleaner code flow and modern formatting (e.g. avoiding parenthesis around returned tuples). On a mozilla-unified repo, here are the "compress" times for a few commands: $ hg perfrevlogchunks -c ! wall 5.772450 comb 5.780000 user 5.780000 sys 0.000000 (best of 3) ! wall 5.795158 comb 5.790000 user 5.790000 sys 0.000000 (best of 3) $ hg perfrevlogchunks -m ! wall 9.975789 comb 9.970000 user 9.970000 sys 0.000000 (best of 3) ! wall 10.019505 comb 10.010000 user 10.010000 sys 0.000000 (best of 3) Compression times did seem to slow down just a little. There are 360,210 changelog revisions and 359,342 manifest revisions. For the changelog, mean time to compress a revision increased from ~16.025us to ~16.088us. That's basically a function call or an attribute lookup. I suppose this is the price you pay for abstraction. It's so low that I'm not concerned.

File last commit:

r9999:f91e5630 default
r30795:78ac56ae default
Show More
map-cmdline.changelog
17 lines | 842 B | text/plain | TextLexer
header = '{date|shortdate} {author|person} <{author|email}>\n\n'
header_verbose = ''
changeset = '\t* {files|stringify|fill68|tabindent}{desc|fill68|tabindent|strip}\n\t[{node|short}]{tags}{branches}\n\n'
changeset_quiet = '\t* {desc|firstline|fill68|tabindent|strip}\n\n'
changeset_verbose = '{date|isodate} {author|person} <{author|email}> ({node|short}{tags}{branches})\n\n\t* {file_adds|stringify|fill68|tabindent}{file_dels|stringify|fill68|tabindent}{files|stringify|fill68|tabindent}{desc|fill68|tabindent|strip}\n\n'
start_tags = ' ['
tag = '{tag}, '
last_tag = '{tag}]'
start_branches = ' <'
branch = '{branch}, '
last_branch = '{branch}>'
file = '{file}, '
last_file = '{file}:\n\t'
file_add = '{file_add}, '
last_file_add = '{file_add}: new file.\n* '
file_del = '{file_del}, '
last_file_del = '{file_del}: deleted file.\n* '