Ackoli sam pouzivam PHP, take programuji v Jave a neda
mi to nereagovat.
Transcript (omluvam se za tochu delsi prispevek):
bash-2.03$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 8
model name : Celeron (Coppermine)
stepping : 3
cpu MHz : 567.972
cache size : 128 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips : 1133.77
bash-2.03$ cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 129761280 127770624 1990656 0 1486848 57434112
Swap: 148013056 0 148013056
MemTotal: 126720 kB
MemFree: 1944 kB
MemShared: 0 kB
Buffers: 1452 kB
Cached: 56088 kB
Active: 38424 kB
Inact_dirty: 15612 kB
Inact_clean: 3504 kB
Inact_target: 288 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 126720 kB
LowFree: 1944 kB
SwapTotal: 144544 kB
SwapFree: 144544 kB
bash-2.03$ time javac HelloWorld.java
real 0m4.389s
user 0m1.690s
sys 0m0.290s
bash-2.03$ rm HelloWorld.class
bash-2.03$ time javac HelloWorld.java
real 0m2.493s
user 0m1.730s
sys 0m0.230s
bash-2.03$ time java HelloWorld
Hello, world!
real 0m0.751s
user 0m0.480s
sys 0m0.130s
bash-2.03$ rm HelloWorld.class
bash-2.03$ time /usr/local/NetBeans31/bin/fastjavac/fastjavac.linux HelloWorld.java
real 0m0.389s
user 0m0.150s
sys 0m0.030s
Tech 4.389s bylo prvni spusteni javac po rebootu,
tech 2.493s hned potom (vsechno v cachich)
no a 0.389s fastjavacu myslim mluvi dost jasne.
Jedina nevyhoda fastjavacu je, ze obcas vygeneruje neplatny kod (ale opravdu jen u dost silenych konstrukci a neni prece problem pouzivat fastjavac pro ladeni a pro deploy pouzit javac).
Co se tyce srovnani s Cckem: Velke projekty by asi mely
kratsi kompilacni cas pokud by byly v jave nez v C,
pro C se kompilator spousti (obecne) pro kazdy zdrojak
zvlast, zatimco javac nasosa vsecny tridy najednou a pak vysype .class soubory.