On Wed, 28 Jun 2017 09:50:10 -0400 Ben Hoyt <benh...@gmail.com> wrote: > I've now got a patch to add new COMPARE_IS_NONE and > COMPARE_IS_NOT_NONE bytecodes to CPython to attempt to speed up the > very common "is None" and "is not None" expressions. It's a very > simple change overall. Here is my patch: > https://gist.github.com/benhoyt/e5ba19afe7b869fd743c1c39fc2afdf8
I don't want to discourage you, but this is unlikely to produce significant speedups on real-world code. The simple reason is that comparing to None is not a bottleneck for any real application -- comparing to None is probably damn fast compared to everything else the real application does. That said, it would be nice if you could get stable benchmark results to validate that theory (or not!) ;-) Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com