Skip to content

Commit b09e40f

Browse files
Sheppard, KevinSheppard, Kevin
authored andcommitted
FIX: Fix performance measurement on Win64
1 parent 1509aab commit b09e40f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

randomstate/performance.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sys
1+
import struct
22
import timeit
33

44
import pandas as pd
@@ -10,11 +10,11 @@
1010
'''
1111

1212
scale_32 = scale_64 = 1
13-
if sys.maxsize < 2 ** 32:
14-
# 32 bit
15-
scale_64 = 2
16-
else:
13+
if struct.calcsize('P') ==8:
14+
# 64 bit
1715
scale_32 = 0.5
16+
else:
17+
scale_64 = 2
1818

1919
RNGS = ['mlfg_1279_861', 'mrg32k3a', 'pcg64', 'pcg32', 'mt19937', 'xorshift128', 'xorshift1024', 'random']
2020

0 commit comments

Comments
 (0)