public inbox for gentoo-user-hu@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user-hu] SpeedTest
@ 2014-12-10 11:26 Testa
  2014-12-11  8:51 ` Császár Péter
  0 siblings, 1 reply; 10+ messages in thread
From: Testa @ 2014-12-10 11:26 UTC (permalink / raw
  To: gentoo-user-hu


[-- Attachment #1.1: Type: text/plain, Size: 1045 bytes --]

Hello Lista tagok,

Mivel gondoltam nem hagyom haldokolni a listát. Mellé eléggé egy gentoo
közeli projecten dolgozok szabad 25 percembe. Ezért kikérem a
véleményeteket.

A dolog lényege egy szemléltetés.

Melyik programozási nyelv milyen sebességgel dolgozik.

Tehát fogunk egy long_integert majd 5 for ciklusba 90, 89, 88, 87, 86
szor végig forgatjuk. Elvileg ennek nincs értelme. Vagy mégis ? Mindenki
kipróbálhatja a mellékelt 4 példa fájlban.

Kérhetnék véleményt ?


Ahogy én ezt terveztem:


python test:

time python speedtest.py


php test:

time php speedtest.php


Nodejs javascript test (lehet rhino-val is tesztelni de ne lepődj meg az
eredményen az esetben ):

time node speedtest.js


c optimalizálás nélkül :

gcc -o s speedtest.c

time ./s


c -O1 optimalizálással :

gcc -O1 -o so1 speedtest.c

time ./so1


c -O2 optimalizálással :

gcc -O2 -o so2 speedtest.c

time ./so2


c -O3 optimalizálással (nagy valószínűséggel ez már felesleges):

gcc -O3 -o so3 speedtest.c

time ./so3



[-- Attachment #1.2: Type: text/html, Size: 3510 bytes --]

[-- Attachment #2: speedtest.c --]
[-- Type: text/x-csrc, Size: 469 bytes --]

#include <stdio.h>
#include <stdint.h>
int main(void)
{

    int ia, ib, ic, id, ie;
    int64_t i = 0;
    for (ia = 1 ; ia < 90; ia++){
        for (ib = 1 ; ib < 90; ib++){
            for (ic = 1 ; ic < 89; ic++){
                  for (id = 1 ; id < 88; id++){
                      for (ie = 1 ; ie < 87; ie++){
                          i++;
                    }
                }
            }
        }
    }
    printf("osszesen: %ld \n", i);
    return 0;
}

[-- Attachment #3: speedtest.js --]
[-- Type: application/javascript, Size: 365 bytes --]

[-- Attachment #4: speedtest.php --]
[-- Type: application/x-php, Size: 371 bytes --]

[-- Attachment #5: speedtest.py --]
[-- Type: text/x-python, Size: 259 bytes --]

i = 0


for a in range(1, 90):
        for b in range(1,89):
                for c in range(1,88):
                        for d in range(1,87):
                                for e in range(1,86):
                                        i=i+1
print (str(i))

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-11 12:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10 11:26 [gentoo-user-hu] SpeedTest Testa
2014-12-11  8:51 ` Császár Péter
2014-12-11 11:35   ` Testa
2014-12-11 11:42     ` Császár Péter
2014-12-11 11:46       ` Testa
2014-12-11 11:49         ` Császár Péter
2014-12-11 11:52           ` Testa
2014-12-11 12:00             ` Császár Péter
2014-12-11 12:15               ` Testa
2014-12-11 11:50       ` Testa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox