AVR32 - Java vs C++ flame
hoyuka
hoyuka at c2.hu
Sat Mar 11 18:10:08 CET 2006
Szia!
En is lefuttattam az alabbi kodokat idehaza:
$ time ./test.a0>/dev/null
real 0m6.936s
user 0m6.698s
sys 0m0.042s
$ time java TestClassA0 >/dev/null
real 0m7.474s
user 0m7.108s
sys 0m0.130s
C nalam kicsit gyorsabb lett, de ez nem jelentos szerintem. Mind 2 progit
2x futtattam le, hogy be-cache-elodjenek a cuccok az FS bufferekbe stb.
Itt a masodik futasi eredmenyek vannak.
udv.
hoyuka
Auth Gábor said:
> Halihó!
>
> hoyuka ezt Ãrta:
>> - tombkezeles
>
> #include <stdio.h>
> int main()
> {
> int tomb[500000];
> for (int count2=0;count2<1000;count2++)
> {
> for (int count=0;count<500000;count++)
> {
> tomb[count]=count;
> }
> printf("%d\n",count2);
> }
>
> return 0;
> }
>
>> time ./proba
> real 0m4.062s
> user 0m3.516s
> sys 0m0.060s
>
> public class Proba
> {
> public static void main(String[] args)
> {
> int tomb[]=new int[500000];
> for (int count2=0;count2<1000;count2++)
> {
> for (int count=0;count<500000;count++)
> {
> tomb[count]=count;
> }
> System.out.println(count2);
> }
> }
> }
>
>> time java Proba
> real 0m2.516s
> user 0m2.012s
> sys 0m0.068s
>
>> Esetleg elso lepeskent csinalhatnank vmi egyszeru Huffman tomoritot,
>> raengednenk vmi nagy file-ra.
>
> Ez a vesszőparipád? :)
>
>> Na ha lesz idom, akor nekallok, most mar nekem is bassza a csoromet
>> ez a tema.
>
> Hajrá.
> --
> http://www.enaplo.hu - Iskolai Információs Rendszer
> Auth Gábor -=- FreeBSD 5.4 -=- http://bsd.lap.hu
> +36-70/9400-341 -=- ICQ: 49179141 -=- Skype: authgabor
>
> -----------------------------------
> Szponzorunk: http://tonerbolt.hu/
--
http://hoyuka.myip.hu
-------------------------------------
C2 MAIL: Levelezés felsõfokon. http://mail.c2.hu
More information about the Elektro
mailing list