vs

 1 : Are the Hack programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Hack program used compared to the fastest PHP program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the Hack programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Hack program used compared to the fastest PHP program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Hack used what fraction? used how many times more? 
Benchmark Time Memory Code
 binary-trees1/121/2±
 spectral-norm1/6 ±
 fasta1/4 ±
 n-body± ±
 mandelbrot †± 1/2
 regex-dna±±±
 fannkuch-redux †± 1/2
 k-nucleotide±±
 reverse-complement±±
 pidigits212× 
 Hack used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/121/121/4±212×

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Are the Hack programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Hack program are shown for comparison against measurements of the fastest PHP program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 binary-trees 
Hack52.2352.31582,848480  1% 1% 0% 100%
PHP634.80635.631,025,300472  0% 0% 0% 100%
 spectral-norm 
Hack73.7618.89188,2281195  98% 97% 98% 98%
PHP446.61113.8524,4081193  98% 97% 100% 98%
 fasta 
Hack34.5434.56319,9761109  1% 1% 0% 100%
PHP133.11136.583,3281030  60% 36% 4% 0%
 n-body 
Hack605.66605.9656,0841432  0% 0% 100% 1%
PHP712.83713.053,3361082  100% 0% 0% 0%
 mandelbrot 
Hack283.58283.69107,372458  1% 0% 100% 1% †
PHP1,288.37322.44115,808863  100% 100% 100% 100% †
 regex-dna 
Hack27.939.53150,480832  99% 66% 67% 62%
PHP26.249.60151,380832  52% 70% 57% 95%
 fannkuch-redux 
Hack1,003.781,004.1755,344532  1% 0% 0% 100% †
PHP3,372.33862.7814,9681150  99% 98% 99% 95% †
 k-nucleotide 
Hack137.0542.82221,9601061  66% 94% 74% 89%
PHP53.6519.10248,0441141  65% 66% 70% 82%
 reverse-complement 
Hack22.1722.21645,024261  1% 0% 0% 100%
PHP6.406.41444,376262  0% 0% 0% 100%
 pidigits 
Hack456.76457.0259,236735  1% 0% 100% 1%
PHP2.162.164,280394  1% 0% 0% 100%
 fasta-redux 
No program
PHP0.670.833,5721110  60% 2% 30% 6%

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Hack programs for these benchmarks?

Remember - those are just the fastest Hack and PHP programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Hack.

Maybe one of those other Hack programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Hack and PHP programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Hack : productivity without breaking things 

HipHop VM 3.0.0-dev (rel)
Compiler: heads/master-0-g7fe20173f182c6f8363c3f1752da50aa16c674df
Repo schema: daaf94930cc75e7b0cb2b11779a1be66280a5b6c

Home Page: http://hacklang.org/

Download: http://hacklang.org/install/

Revised BSD license

  Home   Conclusions   License   Play