[linux-l] Re: Ruby: sehr cool, aber auch sehr laaaahm... wie geht's schneller?!
Pascal Volk
linux-l at edelhost.de
Mo Aug 21 23:04:30 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
* Am Mo, 21 Aug 2006 schrub Oliver Bandel:
>
> ==============================================
> first:~ oliver$ time ruby hw.rb
> hello world
>
> real 0m0.065s
> user 0m0.030s
> sys 0m0.020s
> ==============================================
>
> Der Code:
>
> ==============================================
> first:~ oliver$ cat hw.rb
>
> puts "hello world"
> ==============================================
>
> [...]
> http://peterhi.dyndns.org/write_it_in_c/index.html
^^^^^^^^^^^^ ja :)
> [...]
Mhh, ich dachte eben, Ruby sei richtig lahm im Vergleich zu Python, als ich
Deine Ausgabe mit meiner von Python verglichen hatte.
Als ich es in Ruby probiert habe wurde ich etwas stutzig. Welche Version hat
Dein Ruby? Aus welcher Distribution hast Du es?
pvo at el-presidente ~ $ ruby -v
ruby 1.8.4 (2005-12-24) [i486-linux]
Bzw. Wie betagt ist die Hardware, oder hast Du einen erhöhten System-Load?
'Write it in C' hat wohl was wahres an sich. ;-)
pvo at el-presidente tmp $ time python2.3 hw.py && time python2.4 hw.py \
&& time ruby hw.rb && time ./hw && cat hw.*
hello world
real 0m0.023s
user 0m0.020s
sys 0m0.004s
hello world
real 0m0.018s
user 0m0.012s
sys 0m0.008s
hello world
real 0m0.008s
user 0m0.004s
sys 0m0.000s
hello world
real 0m0.002s
user 0m0.000s
sys 0m0.000s
#include <stdio.h>
int main(void) {
printf("hello world\n");
return 0;
}
print "hello world"
puts "hello world"
Gruß
Pascal
- --
rm -Rfv /tmp/../ && echo "are you sure???"
Die BeLUG im IRC:
irc://irc.freenode.net/#belug
____ ____ ____ ____ ____ _________ ____ ____ ____ ____ ____ ____
||/ |||j |||o |||i |||n ||| |||# |||b |||e |||l |||u |||g ||
||__|||__|||__|||__|||__|||_______|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFE6h/eNx2k6gsBqqkRAvkOAJ9T64TES3rqjnHXiTqJT4yMZVOqdgCgwQOY
1Ca4o7Azdh1h2/1LxVdIziA=
=WcKT
-----END PGP SIGNATURE-----
Mehr Informationen über die Mailingliste linux-l