aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-08 14:44:44 -0800
committerGitHub <noreply@github.com>2017-11-08 14:44:44 -0800
commit8c663fd60ecba9c82aa4c404dbfb1aae69fe8553 (patch)
tree8aed07de4d990bd998a61a051f3ac6b1a88f6392 /Tools/iobench
parentbpo-11063: Use more reliable way to check if uuid function exists (GH-4343) (diff)
downloadcpython-8c663fd60ecba9c82aa4c404dbfb1aae69fe8553.tar.gz
cpython-8c663fd60ecba9c82aa4c404dbfb1aae69fe8553.tar.bz2
cpython-8c663fd60ecba9c82aa4c404dbfb1aae69fe8553.zip
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
Diffstat (limited to 'Tools/iobench')
-rw-r--r--Tools/iobench/iobench.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/iobench/iobench.py b/Tools/iobench/iobench.py
index 712e58472ed..b0a7feb92e4 100644
--- a/Tools/iobench/iobench.py
+++ b/Tools/iobench/iobench.py
@@ -29,9 +29,9 @@ def text_open(fn, mode, encoding=None):
return open(fn, mode)
def get_file_sizes():
- for s in ['20 KB', '400 KB', '10 MB']:
+ for s in ['20 KiB', '400 KiB', '10 MiB']:
size, unit = s.split()
- size = int(size) * {'KB': 1024, 'MB': 1024 ** 2}[unit]
+ size = int(size) * {'KiB': 1024, 'MiB': 1024 ** 2}[unit]
yield s.replace(' ', ''), size
def get_binary_files():
@@ -273,7 +273,7 @@ def run_all_tests(options):
def print_results(size, n, real, cpu):
bw = n * float(size) / 1024 ** 2 / real
- bw = ("%4d MB/s" if bw > 100 else "%.3g MB/s") % bw
+ bw = ("%4d MiB/s" if bw > 100 else "%.3g MiB/s") % bw
out.write(bw.rjust(12) + "\n")
if cpu < 0.90 * real:
out.write(" warning: test above used only %d%% CPU, "