A table with these columns might be helpful for performance comparisons: [ structure, operation, big_o, keyset, # signed ints, randstrs timeit_output, system_load, architecture, # x86_84, aarch64 os, ] Does anyone have a recommendation for a tool that stores such benchmark data in JSON and merges the e.g. per-arch output? Are there URIs for Big-O notation that could be added as e.g. structured attributes in docstrings or annotations? I just added a ._repr_html_() method to the tabulate package so that, in addition to the many excellent ASCII formats tabulate prints, tabulate.tabulate(data, tablefmt='html') displays an html-escaped table in Jupyter notebooks? It's not yet released, so you'd need to `pip install -e git+ https://github.com/astanin/python-tabulate@master#egg=tabulate` On Tue, Dec 24, 2019, 3:53 AM Larry Hastings <larry@hastings.org> wrote:
On 12/23/19 8:09 PM, Kyle Stanley wrote:
Chris Angelico wrote:
I think this is an artifact of Python not having an empty set literal. [snip] When both use the constructor call or both use a literal, the difference is far smaller. I'd call this one a wash.
Ah, good catch. I hadn't considered that it would make a substantial difference, but that makes sense. Here's an additional comparison between "{}" and "dict()" to confirm it:
timeit.timeit("{}", number=100_000_000) 2.1038335599987477 timeit.timeit("dict()", number=100_000_000) 10.225583500003268
We could also go the other way with it, set / dict-map-to-dontcare with one element, because that way we *can* have a set literal:
timeit.timeit("set()", number=100_000_000) 8.579900023061782 timeit.timeit("dict()", number=100_000_000) 10.473437276901677 timeit.timeit("{0}", number=100_000_000) 5.969995185965672 timeit.timeit("{0:0}", number=100_000_000) 6.24465325800702
(ran all four of those just so you see a relative sense on my laptop, which I guess is only sliiiightly slower than Kyle's)
Happy holidays,
*/arry* _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/MQAKLPKW... Code of Conduct: http://python.org/psf/codeofconduct/