CPython comes with a fast C implementation of bisect module. This gives 4 to 5 times speed-ups over my pure-python version.