Created
July 4, 2017 00:49
[PYSPARK] SPARK-21296 benchmark codes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def timing(f): | |
def wrap(*args): | |
time1 = time.time() | |
ret = f(*args) | |
time2 = time.time() | |
print '%s function took %0.3f ms' % (f.func_name, (time2-time1)*1000.0) | |
return ret | |
return wrap | |
data = range(1000000) | |
for _ in xrange(10): | |
timing(lambda: spark.createDataFrame(data, "int"))() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment