openjdk-6 zero

real 0m29.014s

user 0m26.070s

sys 0m0.660s

root@raspbian:~#

openjdk-6 jamvm

real 0m16.068s

user 0m13.800s

sys 0m0.600s

openjdk-7 zero

real 0m28.568s

user 0m25.980s

sys 0m0.820s

openjdk-7 jamvm

real 0m15.511s

user 0m13.270s

sys 0m0.650s

openjdk-7 avian

real 0m11.701s

user 0m9.620s

sys 0m0.550s

gcc 4,6

real 0m6.882s

user 0m5.250s

sys 0m0.390s

gcc 4.6 -O2

real 0m5.360s

user 0m3.790s

sys 0m0.370s

gcc 4.7

real 0m6.884s

user 0m5.140s

sys 0m0.510s

gcc 4.7 -O2

real 0m5.310s

user 0m3.560s

sys 0m0.540s

php

real 1m31.333s

user 1m28.860s

sys 0m0.590s

I think this shows that contary to some peoples assertions java on raspbian is a perfectly usable language performance wise.

Code: Select all

```
public class testprime {
public static void main(String [] args) {
System.out.println(2);
for (int i=3;i<=10000;i++) {
boolean prime = true;
for (int j=2;j<i;j++) {
int k = i/j;
int l = k*j;
if (l==i) prime = false;
}
if (prime) System.out.println(i);
}
}
}
```

Code: Select all

```
#include <stdio.h>
void main() {
printf("2\n");
for (int i=3;i<=10000;i++) {
int prime = 1;
for (int j=2;j<i;j++) {
int k = i/j;
int l = k*j;
if (l==i) prime = 0;
}
if (prime) printf("%i\n",i);
}
}
```

Code: Select all

```
<?php
print("2\n");
for ($i=3;$i<=10000;$i++) {
$prime = true;
for ($j=2;$j<$i;$j++) {
$k = (int)($i/$j);
$l = $k*$j;
if ($l==$i) $prime = false;
}
if ($prime) print($i."\n");
}
?>
```