>>83
Who needs unicode? Really? 1+1=2, unicode or not, duh.
Name:
Anonymous2006-04-20 9:27
>>85
Got that right! I couldn't even get Python to run that fast again, while Ruby ran faster every time. And with the extra newline, Python was like .06s slower.
Name:
Anonymous2006-04-20 9:48
>>84
Addendum, startup times: python -c "print \"Hello, world\""
0.03s user 0.01s system 32% cpu 0.100 total
ruby -e "puts \"Hello, world\""
0.01s user 0.00s system 15% cpu 0.066 total
Wait? Who cares about speed in a scripting language? What is more productive, and more fun to maintain:
1000.times { |i| puts \"#{i}GET\" }"
or
for i in xrange(1000): print str(i) + "GET"
Name:
Anonymous2006-04-20 11:19
>>91 ruby -e "1000.times { |i| puts \"#{i}GET\" }" > /dev/null
0.01s user 0.00s system 47% cpu 0.034 total
python -c "for i in xrange(1000): print str(i) + \"GET\"" > /dev/null
0.02s user 0.01s system 58% cpu 0.061 total
Piping output to remove wait for TTY.
I guess Python is slower because it opens and reads from some "files" or files while Ruby does not.
Name:
Anonymous2006-04-20 11:42
>>92
Neither is as awesome assequence_ $ map (putStrLn . (++"GET") . show) [1..1000]
>>92
I sure as hell don't care much for speed as long as it's within the Python-Perl-PHP-Ruby range, I was just bored and tried to troll. But regarding maintenance, which I do care, I find the Python form much easier to read and maintain.
Name:
Anonymous2006-04-20 13:02 (sage)
>>96
In real code you'd write it like this using Ruby: 1000.times do |i|
puts "#{i}GET"
endUsing {} where do end is possible is generally considered bad practise.
Name:
Anonymous2006-04-20 14:22
Likewise, you'd do for i in xrange(1000):
print str(i) + "GET"in Python