blob: c7b69cf29cb9c9a9e7bd4c4e8efabc261789899a [file] [log] [blame]
Yesudeep Mangalapillya4453c62011-08-11 06:33:371#!/bin/sh
Roy Kokkelkoren0659aac2015-10-25 15:12:112#
3# Copyright 2011 Sybren A. Stüvel <[email protected]>
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 Mangalapillya4453c62011-08-11 06:33:3716
17echo "int2bytes speed test"
Yesudeep Mangalapilly03c51e72011-08-16 09:00:4818echo "pypy"
19pypy -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)'
20pypy -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)'
Yesudeep Mangalapillya4453c62011-08-11 06:33:3721echo "python2.5"
22python2.5 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)'
Yesudeep Mangalapilly81325242011-08-12 07:36:5123python2.5 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)'
Yesudeep Mangalapillya4453c62011-08-11 06:33:3724echo "python2.6"
Yesudeep Mangalapilly81325242011-08-12 07:36:5125python2.6 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n, 516)'
26python2.6 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n, 516)'
Yesudeep Mangalapillya4453c62011-08-11 06:33:3727echo "python2.7"
28python2.7 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)'
Yesudeep Mangalapilly81325242011-08-12 07:36:5129python2.7 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)'
Yesudeep Mangalapillya4453c62011-08-11 06:33:3730echo "python3.2"
31python3 -mtimeit -s'from rsa.transform import int2bytes; n = 1<<4096' 'int2bytes(n)'
Yesudeep Mangalapilly81325242011-08-12 07:36:5132python3 -mtimeit -s'from rsa.transform import _int2bytes; n = 1<<4096' '_int2bytes(n)'
33
Yesudeep Mangalapillyce4ede72011-08-12 09:59:3134echo "bit_size speed test"
35echo "python2.5"
36python2.5 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)'
37python2.5 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)'
38echo "python2.6"
39python2.6 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)'
40python2.6 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)'
41echo "python2.7"
42python2.7 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)'
43python2.7 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)'
44echo "python3.2"
45python3 -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)'
46python3 -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)'
47echo "pypy"
48pypy -mtimeit -s'from rsa.common import bit_size; n = 1<<4096' 'bit_size(n)'
49pypy -mtimeit -s'from rsa.common import _bit_size; n = 1<<4096' '_bit_size(n)'
50