C / PHP / Java – „Hello World” Linux Benchmark!

Zapraszam na małe porównanie wydajności języków programowania ;)

Benchmark:

[macnow@stallman ~]$ time ./Test
hello world
real 0m0.001s
user 0m0.000s
sys 0m0.000s
[macnow@stallman ~]$ time ./Test.php
hello world
real 0m0.025s
user 0m0.012s
sys 0m0.012s
[macnow@stallman ~]$ time java Test
hello world
real 0m0.153s
user 0m0.084s
sys 0m0.008s
[macnow@stallman ~]$

Źródełka:

[macnow@stallman ~]$ cat Test.c

#include <stdio.h>
int main()
{
printf("hello world");
return 0;
}

[macnow@stallman ~]$ cat Test.php

#!/usr/bin/php
<?php echo "hello world"; ?>

[macnow@stallman ~]$ cat Test.java

public class Test
{
  public static void main(String arg[])
  {
    System.out.print("hello world");
  }
}

[macnow@stallman ~]$

Leave a Reply

Twój adres e-mail nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

*


*

Możesz użyć następujących tagów oraz atrybutów HTML-a: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">