Skip to content

Instantly share code, notes, and snippets.

@bnorick
bnorick / time_dict_merge.py
Last active Jan 22, 2020 — forked from treyhunner/time_dict_merge.py
Test performance of different dictionary merging functions in Python
View time_dict_merge.py
"""
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