##// END OF EJS Templates
revlog: make compressed size comparisons consistent...
revlog: make compressed size comparisons consistent revlog.compress() compares the compressed size to the input size and throws away the compressed data if it is larger than the input. This is the correct thing to do, as storing compressed data that is larger than the input takes up more storage space and makes reading slower. However, the comparison was implemented inconsistently. For the streaming compression mode, we threw away the result if it was greater than or equal to the input size. But for the one-shot compression, we threw away the compression only if it was greater than the input size! This patch changes the comparison for the simple case so it is consistent with the streaming case. As a few tests demonstrate, this adds 1 byte to some revlog entries. This is because of an added 'u' header on the chunk. It seems somewhat wrong to increase the revlog size here. However, IMO the cost of 1 byte in storage is insignificant compared to the performance gains of avoiding decompression. This patch should invite questions around the heuristic for throwing away compressed data. For example, I'd argue we should be more liberal about rejecting compressed data, additionally doing so where the number of bytes saved fails to reach a threshold. But we can have this discussion another time.

File last commit:

r19429:c8490dcc default
r30792:4215dc1b default
Show More
map
42 lines | 1.2 KiB | text/plain | TextLexer
Matt Mackall
hgweb: avoid traceback if raw is used as default style...
r17277 default = 'shortlog'
shortlog = "'raw' is not a browsable style"
Alexander Plavin
hgweb: add changelog and search templates to raw style...
r19429 changelog = changelog.tmpl
changelogentry = logentry.tmpl
search = search.tmpl
searchentry = logentry.tmpl
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 mimetype = 'text/plain; charset={encoding}'
header = ''
footer = ''
changeset = changeset.tmpl
difflineplus = '{line}'
difflineminus = '{line}'
difflineat = '{line}'
diffline = '{line}'
changesetparent = '# Parent {node}'
changesetchild = '# Child {node}'
filenodelink = ''
Matt Mackall
templates: add filenolink to raw style (issue2332)
r11936 filenolink = ''
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 fileline = '{line}'
diffblock = '{lines}'
filediff = filediff.tmpl
fileannotate = fileannotate.tmpl
annotateline = '{author|user}@{rev}: {line}'
manifest = manifest.tmpl
direntry = 'drwxr-xr-x {basename}\n'
fileentry = '{permissions|permissions} {size} {basename}\n'
index = index.tmpl
notfound = notfound.tmpl
error = error.tmpl
indexentry = '{url}\n'
tags = '{entries%tagentry}'
tagentry = '{tag} {node}\n'
Yuya Nishihara
hgweb: add bookmarks listing to raw style with test case
r13921 bookmarks = '{entries%bookmarkentry}'
bookmarkentry = '{bookmark} {node}\n'
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 branches = '{entries%branchentry}'
branchentry = '{branch} {node} {status}\n'
Paul Boddie
hgweb: make graph data suitable for template usage...
r16773 graph = graph.tmpl
graphnode = graphnode.tmpl
graphedge = graphedge.tmpl
bookmarkname = 'bookmark: {name}\n'
branchname = 'branch: {name}\n'
tagname = 'tag: {name}\n'