Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: third_party/gsutil/third_party/rsa/create_timing_table.py

Issue 1377933002: [catapult] - Copy Telemetry's gsutilz over to third_party. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Rename to gsutil. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 import time
4 import rsa
5
6 poolsize = 8
7 accurate = True
8
9 def run_speed_test(bitsize):
10
11 iterations = 0
12 start = end = time.time()
13
14 # At least a number of iterations, and at least 2 seconds
15 while iterations < 10 or end - start < 2:
16 iterations += 1
17 rsa.newkeys(bitsize, accurate=accurate, poolsize=poolsize)
18 end = time.time()
19
20 duration = end - start
21 dur_per_call = duration / iterations
22
23 print '%5i bit: %9.3f sec. (%i iterations over %.1f seconds)' % (bitsize,
24 dur_per_call, iterations, duration)
25
26 for bitsize in (128, 256, 384, 512, 1024, 2048, 3072, 4096):
27 run_speed_test(bitsize)
28
29
OLDNEW
« no previous file with comments | « third_party/gsutil/third_party/rsa/README.rst ('k') | third_party/gsutil/third_party/rsa/doc/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698