Browse Source

Added hhvm test

Mattie Coccia 10 years ago
parent
commit
386aa19feb

+ 22 - 0
frameworks/PHP/Yii2/benchmark_config.json

@@ -22,6 +22,28 @@
       "display_name": "yii2",
       "notes": "",
       "versus": "php"
+    },
+    "hhvm": {
+      "setup_file": "setup_hhvm",
+      "json_url": "/site/json",
+      "db_url": "/site/db",
+      "query_url": "/site/db?queries=",
+      "fortune_url": "/site/fortunes",
+      "update_url": "/site/updates?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MySQL",
+      "framework": "yii2",
+      "language": "PHP",
+      "orm": "Full",
+      "platform": "PHP-FPM",
+      "webserver": "HPHP",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "yii2-hhvm",
+      "notes": "",
+      "versus": "php"
     }
   }]
 }

+ 47 - 0
frameworks/PHP/Yii2/deploy/config.hdf

@@ -0,0 +1,47 @@
+# main configuration file
+
+# Application PID File
+PidFile = /home/vagrant/FrameworkBenchmarks/frameworks/PHP/Yii2/hhvm.pid
+
+# Server settings
+Server {
+  Port = 9001
+  Type = fastcgi
+  SourceRoot = /home/vagrant/FrameworkBenchmarks/frameworks/PHP/Yii2
+  DefaultDocument = index.php
+}
+
+# Disable logging completely
+Log {
+  UseLogFile = false
+  UseSyslog = false
+  Level = Error
+  #File = /home/vagrant/FrameworkBenchmarks/frameworks/PHP/Yii2/error.log
+}
+
+# Enable jit for production mode
+Eval {
+    Jit = true
+    CheckSymLink = false
+}
+
+# Repo file
+Repo {
+  Central {
+    Path = /home/vagrant/FrameworkBenchmarks/frameworks/PHP/Yii2/.hhvm.bbhc
+  }
+}
+
+# Setup basic rewrite
+VirtualHost {
+    * {
+        Pattern = .*
+        RewriteRules {
+            * {
+                pattern = ^(.*)$
+                to = $1.php
+                qsa = true
+            }
+        }
+    }
+}

+ 1 - 0
frameworks/PHP/Yii2/hhvm.pid

@@ -0,0 +1 @@
+28104

+ 1 - 1
frameworks/PHP/Yii2/install.sh

@@ -2,7 +2,7 @@
 export PHP_HOME=${IROOT}/php-5.5.17
 export COMPOSER_HOME=${IROOT}/php-composer
 
-fw_depends php nginx composer
+fw_depends php nginx composer hhvm
 
 ${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \

+ 16 - 0
frameworks/PHP/Yii2/setup_hhvm.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+export PHP_HOME=${IROOT}/php-5.5.17
+export NGINX_HOME=${IROOT}/nginx
+
+sed -i 's|localhost|'"${DBHOST}"'|g' app/index.php
+sed -i 's|SourceRoot = .*/FrameworkBenchmarks/Yii2|SourceRoot = '"${TROOT}"'|g' deploy/config.hdf
+sed -i 's|Path = .*/.hhvm.hhbc|Path = '"${TROOT}"'/.hhvm.bbhc|g' deploy/config.hdf
+sed -i 's|PidFile = .*/hhvm.pid|PidFile = '"${TROOT}"'/hhvm.pid|g' deploy/config.hdf
+sed -i 's|File = .*/error.log|File = '"${TROOT}"'/error.log|g' deploy/config.hdf
+sed -i 's|root .*/FrameworkBenchmarks/php-yii2|root '"${TROOT}"'|g' deploy/nginx.conf
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
+
+export PATH="$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"
+
+hhvm --config $TROOT/deploy/config.hdf --user $(whoami) -m daemon
+$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf