From: Jeff E. <jem...@fr...> - 2009-08-27 16:01:41
|
Perhaps if you ran your Jython benchmark before the Perl benchmark, the file system had cached the file after the Jython read. If the file is on a network file system, you could see such dramatic differences. If you are running benchmarks to try to choose an implementation language, write a benchmark that approximates the application. Consider the implementation time as well as the run time in your evaluation. Then try modifying the benchmark code and also consider the expected maintenance cost. una_muna wrote: > Hello! > I have written a small test to check the buffered read speed in Jython: > #################################################### > import time > import sys > > start_time = time.time() > filename = sys.argv[1] > for line in open(filename, 'r', 1): > print line, > print >> sys.stderr, "Time elapsed: ", time.time() - start_time, "s" > #################################################### > when opening small file (89K) it takes 12 sec to run, when for Perl the same > operation takes 1 sec. > What I'm doing wrong? > And more general question: is the input/output effective in Jython comparing > to Perl and Java and why? > > Thank you. > Maria. > |