##// END OF EJS Templates
bdiff: write a native version of splitnewlines...
bdiff: write a native version of splitnewlines ./hg perfunidiff mercurial/manifest.py 0 --count 500 --profile before: ! wall 0.309280 comb 0.350000 user 0.290000 sys 0.060000 (best of 32) ./hg perfunidiff mercurial/manifest.py 0 --count 500 --profile after: ! wall 0.241572 comb 0.260000 user 0.240000 sys 0.020000 (best of 39) so it's about 20% faster. I hate Python. I wish we could usefully write this in Rust, but it doesn't look like that's realistic without using the cpython crate, which I'd still like to avoid. Differential Revision: https://phab.mercurial-scm.org/D1973

File last commit:

r30895:c32454d6 default
r36163:29dd37a4 default
Show More
test_estimate_sizes.py
22 lines | 512 B | text/x-python | PythonLexer
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
from . common import (
make_cffi,
)
@make_cffi
class TestSizes(unittest.TestCase):
def test_decompression_size(self):
size = zstd.estimate_decompression_context_size()
self.assertGreater(size, 100000)
def test_compression_size(self):
params = zstd.get_compression_parameters(3)
size = zstd.estimate_compression_context_size(params)
self.assertGreater(size, 100000)