performance question

Eric Texier texiereric at yahoo.com
Thu Mar 15 06:27:46 CET 2007


I need speed here. What will be the fastest method or does it matter?

(for the example 'a' is only 3 values for the clarity of the example)
a = [1,3,4.] ##


method1:

f.write("vec %f %f %f \n" % (a[0],a[1],a[2]))

method2:

f.write("vec " + str(a[0]) + " " + str(a[1]) + " " + str(a[2]) + "\n")

also it there a relevant speed difference between making few small write
instead of 1 bigger one.

Thanks for any feed back,
Eric



More information about the Python-list mailing list