Skip to content

Instantly share code, notes, and snippets.

@bnorick
bnorick / time_dict_merge.py
Last active January 22, 2020 15:03 — forked from treyhunner/time_dict_merge.py
Test performance of different dictionary merging functions in Python
"""
Results:
multiple_update: 56 ms
copy_and_update: 48 ms
dict_constructor: 56 ms
kwargs_hack: 44 ms
dict_comprehension: 97 ms
concatenate_items: 196 ms
union_items: 168 ms
@kaefer3000
kaefer3000 / mozlz4a.py
Created August 23, 2018 18:00 — forked from Tblue/mozlz4a.py
MozLz4a compression/decompression utility
#!/usr/bin/env python
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
# This file format is in fact just plain LZ4 data with a custom header (magic number [8 bytes] and
# uncompressed file size [4 bytes, little endian]).
#
# This Python 3 script requires the LZ4 bindings for Python, see: https://pypi.python.org/pypi/lz4
#