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/151/2±
 spectral-norm1/8 ±
 fasta1/5 ±
 mandelbrot †1/4 1/2
 regex-dna1/3±±
 n-body± ±
 reverse-complement±±±
 fannkuch-redux †± 1/2
 k-nucleotide±±
 pidigits211× 
 Hack used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/151/151/51/2±211×

† 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 
Hack41.3641.40511,504480  1% 1% 100% 1%
PHP634.80635.631,025,300472  0% 0% 0% 100%
 spectral-norm 
Hack55.8514.32162,5121195  97% 97% 97% 99%
PHP446.61113.8524,4081193  98% 97% 100% 98%
 fasta 
Hack27.7627.77336,9041109  0% 0% 1% 100%
PHP133.11136.583,3281030  60% 36% 4% 0%
 mandelbrot 
Hack87.8387.86790,384458  100% 1% 1% 0% †
PHP1,288.37322.44115,808863  100% 100% 100% 100% †
 regex-dna 
Hack7.722.84181,340832  77% 53% 70% 75%
PHP26.249.60151,380832  52% 70% 57% 95%
 n-body 
Hack604.20604.4087,2001432  16% 1% 84% 0%
PHP712.83713.053,3361082  100% 0% 0% 0%
 reverse-complement 
Hack6.686.69459,952294  99% 1% 1% 0%
PHP6.406.41444,376262  0% 0% 0% 100%
 fannkuch-redux 
Hack914.36914.5882,936532  21% 80% 1% 0% †
PHP3,372.33862.7814,9681150  99% 98% 99% 95% †
 k-nucleotide 
Hack154.2846.24205,8721061  94% 88% 71% 82%
PHP53.6519.10248,0441141  65% 66% 70% 82%
 pidigits 
Hack455.28455.4495,576735  11% 53% 23% 15%
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.3.0 (rel)
Compiler: tags/HHVM-3.3.0-0-g0a3cfb87b8a353fc7e1d15374f4adc413e37aba9
Repo schema: 9a391d9a03e15fccba1cde6d35c05b7cdd380238
Extension API: 20140829

Home Page: http://hacklang.org/

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

Revised BSD license

  Home   Conclusions   License   Play