Skip to content

Instantly share code, notes, and snippets.

@kkung
kkung / result.md
Created August 14, 2014 02:52
RSA library benchmark
  • RMBP 15" / Early 2013(2.4GHz i7, 16GB RAM), CPython 2.7.6
  • rsa==3.1.4
  • pycrypto==2.6.1
  • cryptography==0.5.3
Cryptography PyCrypto RSA
1.0222690105438232 1.453489065170288 4.905964136123657
1.0008471012115479 1.3903019428253174 4.860486030578613
0.9761111736297607 1.3885319232940674 5.226905107498169
#
# http://stackoverflow.com/questions/519633/lazy-method-for-reading-big-file-in-python
#
def readline_in_chunks(file_object, chunk_size=1024):
buf = ''
while True:
data = file_object.read(chunk_size)
if not data:
break