Yesudeep Mangalapilly | a4453c6 | 2011-08-11 12:03:37 +0530 | [diff] [blame] | 1 | #!/bin/sh |
Roy Kokkelkoren | 0659aac | 2015-10-25 16:12:11 +0100 | [diff] [blame^] | 2 | # |
| 3 | # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Yesudeep Mangalapilly | a4453c6 | 2011-08-11 12:03:37 +0530 | [diff] [blame] | 16 | |
| 17 | echo "int2bytes speed test" |
Yesudeep Mangalapilly | 03c51e7 | 2011-08-16 14:30:48 +0530 | [diff] [blame] | 18 | echo "pypy" |
| 19 | pypy -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)' |
| 20 | pypy -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)' |
Yesudeep Mangalapilly | a4453c6 | 2011-08-11 12:03:37 +0530 | [diff] [blame] | 21 | echo "python2.5" |
| 22 | python2.5 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)' |
Yesudeep Mangalapilly | 8132524 | 2011-08-12 13:06:51 +0530 | [diff] [blame] | 23 | python2.5 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)' |
Yesudeep Mangalapilly | a4453c6 | 2011-08-11 12:03:37 +0530 | [diff] [blame] | 24 | echo "python2.6" |
Yesudeep Mangalapilly | 8132524 | 2011-08-12 13:06:51 +0530 | [diff] [blame] | 25 | python2.6 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n, 516)' |
| 26 | python2.6 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n, 516)' |
Yesudeep Mangalapilly | a4453c6 | 2011-08-11 12:03:37 +0530 | [diff] [blame] | 27 | echo "python2.7" |
| 28 | python2.7 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)' |
Yesudeep Mangalapilly | 8132524 | 2011-08-12 13:06:51 +0530 | [diff] [blame] | 29 | python2.7 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)' |
Yesudeep Mangalapilly | a4453c6 | 2011-08-11 12:03:37 +0530 | [diff] [blame] | 30 | echo "python3.2" |
| 31 | python3 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)' |
Yesudeep Mangalapilly | 8132524 | 2011-08-12 13:06:51 +0530 | [diff] [blame] | 32 | python3 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)' |
| 33 | |
Yesudeep Mangalapilly | ce4ede7 | 2011-08-12 15:29:31 +0530 | [diff] [blame] | 34 | echo "bit_size speed test" |
| 35 | echo "python2.5" |
| 36 | python2.5 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)' |
| 37 | python2.5 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)' |
| 38 | echo "python2.6" |
| 39 | python2.6 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)' |
| 40 | python2.6 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)' |
| 41 | echo "python2.7" |
| 42 | python2.7 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)' |
| 43 | python2.7 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)' |
| 44 | echo "python3.2" |
| 45 | python3 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)' |
| 46 | python3 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)' |
| 47 | echo "pypy" |
| 48 | pypy -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)' |
| 49 | pypy -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)' |
| 50 | |