Browse Source

Merge branch 'master' of https://github.com/TechEmpower/FrameworkBenchmarks

Masahiro Nagano 11 years ago
parent
commit
c249a1e38d
100 changed files with 2290 additions and 250 deletions
  1. 6 0
      WeberFramework/.gitignore
  2. 2 0
      WeberFramework/README.md
  3. 24 0
      WeberFramework/benchmark_config
  4. 0 0
      WeberFramework/lang/.gitkeep
  5. 18 0
      WeberFramework/lib/app.ex
  6. 36 0
      WeberFramework/lib/config.ex
  7. 0 0
      WeberFramework/lib/controllers/.keep
  8. 13 0
      WeberFramework/lib/controllers/main.ex
  9. 0 0
      WeberFramework/lib/helpers/.keep
  10. 0 0
      WeberFramework/lib/models/.keep
  11. 9 0
      WeberFramework/lib/route.ex
  12. 0 0
      WeberFramework/lib/views/.keep
  13. 235 0
      WeberFramework/lib/views/Main.html
  14. 0 0
      WeberFramework/lib/views/layout/.keep
  15. 24 0
      WeberFramework/mix.exs
  16. 0 0
      WeberFramework/public/css/.keep
  17. 0 0
      WeberFramework/public/img/.keep
  18. BIN
      WeberFramework/public/img/favicon.ico
  19. 235 0
      WeberFramework/public/index.html
  20. 0 0
      WeberFramework/public/js/.keep
  21. 18 0
      WeberFramework/setup_weber.py
  22. 7 0
      WeberFramework/start.sh
  23. 7 0
      WeberFramework/test/WeberFramework_test.exs
  24. 1 0
      WeberFramework/test/test_helper.exs
  25. 1 1
      config/10gen.list
  26. 9 8
      config/benchmark_profile
  27. 3 0
      config/database_sftp_batch
  28. 1 8
      config/erlang.list
  29. 188 0
      config/mysql
  30. 63 0
      config/mysql.conf
  31. 1 1
      config/postgresql.conf
  32. 7 0
      curacao/.gitignore
  33. 24 0
      curacao/README.md
  34. 0 0
      curacao/__init__.py
  35. 24 0
      curacao/benchmark_config
  36. 35 0
      curacao/build.sbt
  37. 1 0
      curacao/project/build.properties
  38. 3 0
      curacao/project/plugins.sbt
  39. 35 0
      curacao/setup.py
  40. 5 0
      curacao/source_code
  41. 21 0
      curacao/src/main/java/benchmark/Benchmarks.java
  42. 52 0
      curacao/src/main/java/benchmark/Bootstrap.java
  43. 21 0
      curacao/src/main/java/benchmark/entities/HelloWorld.java
  44. 12 0
      curacao/src/main/resources/application.conf
  45. 23 0
      curacao/src/main/resources/logback.xml
  46. 0 0
      dropwizard-mongodb/__init__.py
  47. 25 0
      dropwizard-mongodb/benchmark_config
  48. 20 0
      dropwizard-mongodb/hello-world.yml
  49. 84 0
      dropwizard-mongodb/pom.xml
  50. 23 0
      dropwizard-mongodb/setup.py
  51. 11 0
      dropwizard-mongodb/source_code
  52. 27 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java
  53. 47 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java
  54. 40 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java
  55. 21 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java
  56. 23 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java
  57. 30 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java
  58. 47 0
      dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java
  59. 1 1
      grails/README.md
  60. 0 16
      grails/hello/.classpath
  61. 2 0
      grails/hello/.gitignore
  62. 0 25
      grails/hello/.project
  63. 2 2
      grails/hello/application.properties
  64. 3 3
      grails/hello/grails-app/conf/BuildConfig.groovy
  65. 0 19
      grails/hello/grails-app/conf/JsonWorkaroundBootStrap.groovy
  66. 9 15
      grails/hello/grails-app/controllers/hello/HelloController.groovy
  67. 5 5
      hapi/app.js
  68. 2 2
      netty/README.md
  69. 74 68
      netty/pom.xml
  70. 1 1
      netty/setup.py
  71. 1 0
      netty/source_code
  72. 42 43
      netty/src/main/java/hello/HelloServerHandler.java
  73. 8 1
      netty/src/main/java/hello/HelloServerInitializer.java
  74. 37 16
      netty/src/main/java/hello/HelloWebServer.java
  75. 15 0
      netty/src/main/java/hello/Message.java
  76. 2 3
      openresty/nginx.conf
  77. 7 0
      php-zend-framework/.gitignore
  78. 0 0
      php-zend-framework/__init__.py
  79. 25 0
      php-zend-framework/benchmark_config
  80. 19 0
      php-zend-framework/composer.json
  81. 16 0
      php-zend-framework/config/application.config.php
  82. 0 0
      php-zend-framework/config/autoload/.gitkeep
  83. 10 0
      php-zend-framework/config/autoload/benchmarks.local.php
  84. 1 0
      php-zend-framework/data/cache/.gitignore
  85. 133 0
      php-zend-framework/deploy/nginx.conf
  86. 9 0
      php-zend-framework/deploy/php-zend-framework
  87. 63 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/DbController.php
  88. 23 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/JsonController.php
  89. 41 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Entity/World.php
  90. 78 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Module.php
  91. 43 0
      php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/ServiceFactory/DbControllerServiceFactory.php
  92. 16 0
      php-zend-framework/public/.htaccess
  93. 6 0
      php-zend-framework/public/index.php
  94. 27 0
      php-zend-framework/setup.py
  95. 2 1
      ringojs-convenient/app/models.js
  96. 1 8
      ringojs-convenient/app/views.js
  97. 1 1
      ringojs-convenient/setup.py
  98. 2 1
      ringojs/ringo-main.js
  99. 1 1
      ringojs/setup.py
  100. BIN
      sbt/sbt-launch.jar

+ 6 - 0
WeberFramework/.gitignore

@@ -0,0 +1,6 @@
+/ebin
+/deps
+erl_crash.dump
+/tmp
+_build
+/logs

+ 2 - 0
WeberFramework/README.md

@@ -0,0 +1,2 @@
+WeberFramework
+=====

+ 24 - 0
WeberFramework/benchmark_config

@@ -0,0 +1,24 @@
+{
+  "framework": "weber",
+  "tests": [{
+    "default": {
+      "setup_file": "setup_weber",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "weber",
+      "language": "Elixir",
+      "orm": "Raw",
+      "platform": "Cowboy",
+      "webserver": "Cowboy",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "weber",
+      "notes": "",
+      "versus": "",
+      "skip": "false"
+  }}]
+}

+ 0 - 0
WeberFramework/lang/.gitkeep


+ 18 - 0
WeberFramework/lib/app.ex

@@ -0,0 +1,18 @@
+defmodule WeberFramework do
+
+  require Weber.Templates.ViewsLoader
+  
+  def start(_type, _args) do
+    # Set resources
+    Weber.Templates.ViewsLoader.set_up_resources(File.cwd!)
+    # compile all views
+    Weber.Templates.ViewsLoader.compile_views(File.cwd!)
+    # start weber application
+    Weber.run_weber
+  end
+
+  def stop(_state) do
+    :ok
+  end
+  
+end

+ 36 - 0
WeberFramework/lib/config.ex

@@ -0,0 +1,36 @@
+defmodule Config do 
+
+  def config do
+    [webserver: 
+      [http_host: "localhost", 
+       http_port: 8080,
+       acceptors: 100,
+       ssl: false,
+       cacertfile_path: "",
+       certfile_path: "",
+       keyfile_path: ""
+      ],
+    ws: 
+      [ws_port: 8080,
+       ws_mod: :Handler
+      ],
+    use_internationalization: false,
+    localization:
+      [default_locale: :en_US,
+       use_locales: [:en_US]
+      ],
+    use_sessions: false,
+    session:
+      [max_age: 1440
+      ],
+    db:
+      [
+        db_host: "",
+        db_port: 5000,
+        db_username: "",
+        db_password: ""
+      ],
+    ]
+  end
+
+end

+ 0 - 0
WeberFramework/lib/controllers/.keep


+ 13 - 0
WeberFramework/lib/controllers/main.ex

@@ -0,0 +1,13 @@
+defmodule WeberFramework.Main do
+  
+  use Weber.Controller
+
+  def action_json(_, _) do
+    {:json, [message: "Hello, world!"], [{"Content-type", "application/json"}]}
+  end
+
+  def action_text(_, _) do
+  	{:text, "Hello, world!", [{"Content-type", "text/plain"}]}
+  end
+
+end

+ 0 - 0
WeberFramework/lib/helpers/.keep


+ 0 - 0
WeberFramework/lib/models/.keep


+ 9 - 0
WeberFramework/lib/route.ex

@@ -0,0 +1,9 @@
+defmodule Route do
+
+  import Weber.Route
+  require Weber.Route
+  
+  route on("GET", "/json", :WeberFramework.Main, :action_json)
+     |> on("GET", "/plaintext", :WeberFramework.Main, :action_text)
+
+end

+ 0 - 0
WeberFramework/lib/views/.keep


+ 235 - 0
WeberFramework/lib/views/Main.html

@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+<html itemscope itemtype="http://schema.org/WebPage" lang="en">
+
+<head>
+  <meta charset="utf-8">
+  <title>Welcome to Weber!</title>
+  <link href="img/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
+
+  <style>
+    /* Reset */
+    * {
+      margin: 0;
+      padding: 0;
+    }
+
+    /* Default */
+    body {
+      font: normal 13px proxima-nova, sans-serif;
+      color: #666;
+    }
+
+    a {
+      color: #4c0066;
+    }
+
+    code, pre {
+      background: #f9f9f9;
+      border: 1px solid #ddd;
+      border-radius: 3px;
+      display: block;
+      font-family: monospace;
+      margin: 5px 0;
+      padding: 20px 0 20px 30px;
+      white-space: pre;
+    }
+
+    blockquote {
+      background: #f9f9f9;
+      border-left: 10px solid #eee;
+      border-radius: 3px;
+      color: #888;
+      margin: 20px 0 20px 20px;
+      padding: 10px 12px;
+      quotes: "\201C""\201D""\2018""\2019";
+    }
+
+    blockquote:before {
+      color: #ccc;
+      content: open-quote;
+      font-size: 55px;
+      line-height: 1px;
+      margin-right: 15px;
+      vertical-align: -25px;
+    }
+
+    blockquote p {
+      display: inline;
+    }
+
+    p {
+      font-size: 120%;
+      line-height: 25px;
+      margin: 10px 0;
+    }
+
+    /* Classes */
+    .content {
+      margin: 0 auto;
+      padding: 0 10px;
+      width: 960px;
+    }
+
+    /* Structure */
+    header:after, main:after,
+    header:before, main:before {
+      content: " ";
+      display: table;
+    }
+
+    header:after, main:after {
+      clear: both;
+    }
+
+    header {
+      background: #4c0066;
+      height: 150px;
+      margin-bottom: 50px;
+    }
+
+    header .logo {
+      border-radius: 100%;
+      display: block;
+      float: left;
+      padding-top: 25px;
+    }
+
+    header .title {
+      color: #fff;
+      float: left;
+      line-height: 30px;
+      margin: 101px 0 0;
+      text-align: right;
+      width: 660px;
+    }
+
+    header .title h1 {
+      font-size: 100px;
+    }
+
+    main .guide {
+      float: right;
+      width: 610px;
+    }
+
+    main .guide article {
+      margin-bottom: 50px;
+    }
+
+    main .guide h3 {
+      color: #4c0066;
+      font-size: 150%;
+      text-transform: uppercase;
+    }
+
+    main aside {
+      float: left;
+      margin-right: 50px;
+      width: 300px;
+    }
+
+    .sidebar-box {
+      margin: 25px 20px;
+    }
+
+    .sidebar-box h3 {
+      font-size: 110%;
+      margin-bottom: 5px;
+      text-transform: uppercase;
+    }
+
+    .sidebar-box p {
+      font-size: 90%;
+      line-height: 100%;
+      margin: 0;
+    }
+
+    .sidebar-box ol {
+      background: #f9f9f9;
+      border: 1px solid #eee;
+      border-radius: 3px;
+      list-style: none;
+    }
+    
+    .sidebar-box ol a {
+      border-bottom: 1px solid #eee;
+      display: block;
+      padding: 10px 10px;
+      text-decoration: none;
+    }
+    
+    .sidebar-box ol li:last-child a {
+      border-bottom: none;
+    }
+
+    .sidebar-box ol a:hover {
+      background: #f5f5f5;
+    }
+
+    li {
+      margin-left: 20px;
+      font-size: 120%;
+    }
+
+    h4 {
+      font-size: 120%;
+    }
+
+
+  </style>
+</head>
+
+<body>
+  <header role="banner">
+    <div class="content">
+      <a class="logo" href="http://0xAX.github.io/weber" target="_blank">
+        <svg height="300" width="300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+          <g>
+            <circle cx="150" cy="150" fill="#4c0066" r="147" stroke="#ffffff" stroke-width="6" />
+            <path d="M191.75,213.42l34.57-126.24c2.39-8.71-4.36-15.78-15.08-15.78c-10.721,0-21.02,7.06-23.01,15.78l-28.82,126.24c-1.99,8.71,3.47,15.78,12.21,15.78C180.35,229.2,189.359,222.141,191.75,213.42z" fill="#ffffff" />
+            <path d="M148.77,213.42l26.74-126.24c1.85-8.71-5.289-15.78-15.939-15.78c-10.66,0-20.47,7.06-21.92,15.78l-21.03,126.24c-1.45,8.71,4.41,15.78,13.09,15.78S146.92,222.141,148.77,213.42z" fill="#ffffff" />
+            <path d="M106.05,213.45l4.78-31.511c1.33-8.689-5.28-15.739-14.76-15.739c-9.47,0-17.9,7.05-18.82,15.739l-3.36,31.511c-0.92,8.7,5.36,15.75,14.05,15.75C96.62,229.2,104.73,222.15,106.05,213.45z" fill="#ffffff" />
+          </g>
+        </svg>
+      </a>
+
+      <div class="title">
+        <h1 style="margin-top: -20px;">Weber</h1>
+      </div>
+    </div>
+  </header>
+
+  <main class="content" role="main">
+    <div class="guide">
+      <article id="getting-started">
+        <h3>Getting started</h3>
+        <p>Welcome to the default <a href="https://github.com/0xAX/weber">Weber's</a> page. Weber is a MVC Rails like web framework which was built with <a href="http://elixir-lang.org/">Elixir</a> programming language. Build web applications quickly and efficiently as possible. Let's build Web with Elixir.</p>
+        <h4>Weber features:</h4>
+        <br/>
+        <ul>
+          <li>MVC web framework;</li>
+          <li>New project generation;</li>
+          <li>Json generation with exjson;</li>
+          <li>Websocket support;</li>
+          <li>HTML helpers;</li>
+          <li>Site internationalization</li>
+          <li>Sessions support;</li>
+          <li>and many more</li>
+        </ul>
+      </article>
+    </div>
+    
+    <aside role="contentinfo">
+      <div class="sidebar-box">
+        <h3>Links</h3>
+        <ol>
+          <li><a href="https://github.com/0xAX/weber">Weber source code</a></li>
+          <li><a href="http://0xax.github.io/weber/index.html">Weber site</a></li>
+          <li><a href="http://elixir-lang.org/">Elixir</a></li>
+        </ol>
+      </div>
+    </aside>
+  </main>
+</body>
+
+</html>

+ 0 - 0
WeberFramework/lib/views/layout/.keep


+ 24 - 0
WeberFramework/mix.exs

@@ -0,0 +1,24 @@
+defmodule WeberFramework.Mixfile do
+  use Mix.Project
+
+  def project do
+    [ 
+      app: :WeberFramework,
+      version: "0.0.1",
+      deps: deps
+    ]
+  end
+
+  def application do
+    [
+      applications: [],
+      mod: {WeberFramework, []}
+    ]
+  end
+
+  defp deps do
+    [ 
+      { :weber, github: "0xAX/weber" } 
+    ]
+  end
+end

+ 0 - 0
WeberFramework/public/css/.keep


+ 0 - 0
WeberFramework/public/img/.keep


BIN
WeberFramework/public/img/favicon.ico


+ 235 - 0
WeberFramework/public/index.html

@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+<html itemscope itemtype="http://schema.org/WebPage" lang="en">
+
+<head>
+  <meta charset="utf-8">
+  <title>Welcome to Weber!</title>
+  <link href="img/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
+
+  <style>
+    /* Reset */
+    * {
+      margin: 0;
+      padding: 0;
+    }
+
+    /* Default */
+    body {
+      font: normal 13px proxima-nova, sans-serif;
+      color: #666;
+    }
+
+    a {
+      color: #4c0066;
+    }
+
+    code, pre {
+      background: #f9f9f9;
+      border: 1px solid #ddd;
+      border-radius: 3px;
+      display: block;
+      font-family: monospace;
+      margin: 5px 0;
+      padding: 20px 0 20px 30px;
+      white-space: pre;
+    }
+
+    blockquote {
+      background: #f9f9f9;
+      border-left: 10px solid #eee;
+      border-radius: 3px;
+      color: #888;
+      margin: 20px 0 20px 20px;
+      padding: 10px 12px;
+      quotes: "\201C""\201D""\2018""\2019";
+    }
+
+    blockquote:before {
+      color: #ccc;
+      content: open-quote;
+      font-size: 55px;
+      line-height: 1px;
+      margin-right: 15px;
+      vertical-align: -25px;
+    }
+
+    blockquote p {
+      display: inline;
+    }
+
+    p {
+      font-size: 120%;
+      line-height: 25px;
+      margin: 10px 0;
+    }
+
+    /* Classes */
+    .content {
+      margin: 0 auto;
+      padding: 0 10px;
+      width: 960px;
+    }
+
+    /* Structure */
+    header:after, main:after,
+    header:before, main:before {
+      content: " ";
+      display: table;
+    }
+
+    header:after, main:after {
+      clear: both;
+    }
+
+    header {
+      background: #4c0066;
+      height: 150px;
+      margin-bottom: 50px;
+    }
+
+    header .logo {
+      border-radius: 100%;
+      display: block;
+      float: left;
+      padding-top: 25px;
+    }
+
+    header .title {
+      color: #fff;
+      float: left;
+      line-height: 30px;
+      margin: 101px 0 0;
+      text-align: right;
+      width: 660px;
+    }
+
+    header .title h1 {
+      font-size: 100px;
+    }
+
+    main .guide {
+      float: right;
+      width: 610px;
+    }
+
+    main .guide article {
+      margin-bottom: 50px;
+    }
+
+    main .guide h3 {
+      color: #4c0066;
+      font-size: 150%;
+      text-transform: uppercase;
+    }
+
+    main aside {
+      float: left;
+      margin-right: 50px;
+      width: 300px;
+    }
+
+    .sidebar-box {
+      margin: 25px 20px;
+    }
+
+    .sidebar-box h3 {
+      font-size: 110%;
+      margin-bottom: 5px;
+      text-transform: uppercase;
+    }
+
+    .sidebar-box p {
+      font-size: 90%;
+      line-height: 100%;
+      margin: 0;
+    }
+
+    .sidebar-box ol {
+      background: #f9f9f9;
+      border: 1px solid #eee;
+      border-radius: 3px;
+      list-style: none;
+    }
+    
+    .sidebar-box ol a {
+      border-bottom: 1px solid #eee;
+      display: block;
+      padding: 10px 10px;
+      text-decoration: none;
+    }
+    
+    .sidebar-box ol li:last-child a {
+      border-bottom: none;
+    }
+
+    .sidebar-box ol a:hover {
+      background: #f5f5f5;
+    }
+
+    li {
+      margin-left: 20px;
+      font-size: 120%;
+    }
+
+    h4 {
+      font-size: 120%;
+    }
+
+
+  </style>
+</head>
+
+<body>
+  <header role="banner">
+    <div class="content">
+      <a class="logo" href="http://0xAX.github.io/weber" target="_blank">
+        <svg height="300" width="300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+          <g>
+            <circle cx="150" cy="150" fill="#4c0066" r="147" stroke="#ffffff" stroke-width="6" />
+            <path d="M191.75,213.42l34.57-126.24c2.39-8.71-4.36-15.78-15.08-15.78c-10.721,0-21.02,7.06-23.01,15.78l-28.82,126.24c-1.99,8.71,3.47,15.78,12.21,15.78C180.35,229.2,189.359,222.141,191.75,213.42z" fill="#ffffff" />
+            <path d="M148.77,213.42l26.74-126.24c1.85-8.71-5.289-15.78-15.939-15.78c-10.66,0-20.47,7.06-21.92,15.78l-21.03,126.24c-1.45,8.71,4.41,15.78,13.09,15.78S146.92,222.141,148.77,213.42z" fill="#ffffff" />
+            <path d="M106.05,213.45l4.78-31.511c1.33-8.689-5.28-15.739-14.76-15.739c-9.47,0-17.9,7.05-18.82,15.739l-3.36,31.511c-0.92,8.7,5.36,15.75,14.05,15.75C96.62,229.2,104.73,222.15,106.05,213.45z" fill="#ffffff" />
+          </g>
+        </svg>
+      </a>
+
+      <div class="title">
+        <h1 style="margin-top: -20px;">Weber</h1>
+      </div>
+    </div>
+  </header>
+
+  <main class="content" role="main">
+    <div class="guide">
+      <article id="getting-started">
+        <h3>Getting started</h3>
+        <p>Welcome to the default <a href="https://github.com/0xAX/weber">Weber's</a> page. Weber is a MVC Rails like web framework which was built with <a href="http://elixir-lang.org/">Elixir</a> programming language. Build web applications quickly and efficiently as possible. Let's build Web with Elixir.</p>
+        <h4>Weber features:</h4>
+        <br/>
+        <ul>
+          <li>MVC web framework;</li>
+          <li>New project generation;</li>
+          <li>Json generation with exjson;</li>
+          <li>Websocket support;</li>
+          <li>HTML helpers;</li>
+          <li>Site internationalization</li>
+          <li>Sessions support;</li>
+          <li>and many more</li>
+        </ul>
+      </article>
+    </div>
+    
+    <aside role="contentinfo">
+      <div class="sidebar-box">
+        <h3>Links</h3>
+        <ol>
+          <li><a href="https://github.com/0xAX/weber">Weber source code</a></li>
+          <li><a href="http://0xax.github.io/weber/index.html">Weber site</a></li>
+          <li><a href="http://elixir-lang.org/">Elixir</a></li>
+        </ol>
+      </div>
+    </aside>
+  </main>
+</body>
+
+</html>

+ 0 - 0
WeberFramework/public/js/.keep


+ 18 - 0
WeberFramework/setup_weber.py

@@ -0,0 +1,18 @@
+import sys
+import subprocess
+
+def start(args, logfile, errfile):
+    try:
+        subprocess.check_call("mix deps.get", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
+        subprocess.check_call("mix compile --all --force", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
+        subprocess.check_call("./start.sh", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
+        return 0
+    except subprocess.CalledProcessError:
+        return 1
+ 
+def stop(logfile, errfile):
+    try:
+        subprocess.check_call("killall beam", shell=True, cwd="/usr/bin")
+        return 0
+    except subprocess.CalledProcessError:
+        return 1

+ 7 - 0
WeberFramework/start.sh

@@ -0,0 +1,7 @@
+#!/usr/bin/env sh
+
+if [ ! -f deps ]; then
+  mix deps.get && mix compile
+fi
+
+exec elixir --detached -S mix run --no-halt

+ 7 - 0
WeberFramework/test/WeberFramework_test.exs

@@ -0,0 +1,7 @@
+defmodule WeberFrameworkTest do
+  use ExUnit.Case
+
+  test "the truth" do
+    assert(true)
+  end
+end

+ 1 - 0
WeberFramework/test/test_helper.exs

@@ -0,0 +1 @@
+ExUnit.start

+ 1 - 1
config/10gen.list

@@ -1 +1 @@
-deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
+deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

+ 9 - 8
config/benchmark_profile

@@ -1,7 +1,7 @@
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=~/FrameworkBenchmarks/installs/resin-4.0.36
 export RESIN_HOME=~/FrameworkBenchmarks/installs/resin-4.0.36
-export GRAILS_HOME=~/FrameworkBenchmarks/installs/grails-2.3.3
-export VERTX_HOME=~/FrameworkBenchmarks/installs/vert.x-2.1M3
+export GRAILS_HOME=~/FrameworkBenchmarks/installs/grails-2.3.6
+export VERTX_HOME=~/FrameworkBenchmarks/installs/vert.x-2.1RC3
 export GOROOT=~/FrameworkBenchmarks/installs/go
 export GOROOT=~/FrameworkBenchmarks/installs/go
 export GOPATH=~/FrameworkBenchmarks/go:~/FrameworkBenchmarks/webgo:~/FrameworkBenchmarks/revel
 export GOPATH=~/FrameworkBenchmarks/go:~/FrameworkBenchmarks/webgo:~/FrameworkBenchmarks/revel
 export TOMCAT_HOME=~/FrameworkBenchmarks/installs/apache-tomcat-7.0.35
 export TOMCAT_HOME=~/FrameworkBenchmarks/installs/apache-tomcat-7.0.35
@@ -15,15 +15,16 @@ export PYTHON_HOME=~/FrameworkBenchmarks/installs/python-2.7.5
 export RACKET_HOME=~/FrameworkBenchmarks/installs/racket-5.3.6
 export RACKET_HOME=~/FrameworkBenchmarks/installs/racket-5.3.6
 export NIMROD_HOME=~/FrameworkBenchmarks/installs/nimrod
 export NIMROD_HOME=~/FrameworkBenchmarks/installs/nimrod
 export NGINX_HOME=/usr/local/nginx
 export NGINX_HOME=/usr/local/nginx
+export ELIXIR_HOME=~/FrameworkBenchmarks/installs/elixir-0.13.3
 
 
-export PATH="$PYTHON_HOME/bin:$PATH$JAVA_HOME/bin:$GRAILS_HOME/bin:$PLAY_HOME:$PLAY1_HOME:$VERTX_HOME/bin:$GOROOT/bin:$NODE_HOME/bin:$HOME/FrameworkBenchmarks/installs/bin:$MAVEN_HOME/bin:$PERL_HOME/bin:$PERL_HOME/site/bin:$DART_HOME/bin:$RACKET_HOME/bin:$NIMROD_HOME/bin:$NGINX_HOME/sbin:$PATH"
+export PATH="$PYTHON_HOME/bin:$PATH$JAVA_HOME/bin:$GRAILS_HOME/bin:$PLAY_HOME:$PLAY1_HOME:$VERTX_HOME/bin:$GOROOT/bin:$NODE_HOME/bin:$HOME/FrameworkBenchmarks/installs/bin:$MAVEN_HOME/bin:$PERL_HOME/bin:$PERL_HOME/site/bin:$DART_HOME/bin:$RACKET_HOME/bin:$NIMROD_HOME/bin:$NGINX_HOME/sbin:$ELIXIR_HOME/bin:$PATH"
 
 
 export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
 export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'
 
 
-export TFB_SERVER_HOST=172.16.98.122'
-export TFB_CLIENT_HOST='172.16.98.98'
+export TFB_SERVER_HOST='localhost'
+export TFB_CLIENT_HOST='localhost'
 export TFB_CLIENT_USER='tfb'
 export TFB_CLIENT_USER='tfb'
-export TFB_CLIENT_IDENTITY_FILE='/home/tfb/.ssh/id_rsa-tfb-1'
-export TFB_DATABASE_HOST='172.16.98.118'
+export TFB_CLIENT_IDENTITY_FILE='/home/tfb/.ssh/id_rsa'
+export TFB_DATABASE_HOST='localhost'
 
 
-source ~/.rvm/scripts/'rvm'
+. ~/.rvm/scripts/'rvm'

+ 3 - 0
config/database_sftp_batch

@@ -1,3 +1,4 @@
+lcd ..
 put config/my.cnf
 put config/my.cnf
 put config/mongodb.conf
 put config/mongodb.conf
 put config/create.sql
 put config/create.sql
@@ -9,3 +10,5 @@ put config/postgresql.conf
 put config/pg_hba.conf
 put config/pg_hba.conf
 put config/usr.sbin.mysqld
 put config/usr.sbin.mysqld
 put config/60-postgresql-shm.conf
 put config/60-postgresql-shm.conf
+put config/mysql
+put config/mysql.conf

+ 1 - 8
config/erlang.list

@@ -1,8 +1 @@
-deb http://binaries.erlang-solutions.com/debian quantal contrib
-deb http://binaries.erlang-solutions.com/debian precise contrib
-deb http://binaries.erlang-solutions.com/debian oneiric contrib
-deb http://binaries.erlang-solutions.com/debian natty contrib
-deb http://binaries.erlang-solutions.com/debian maverick contrib
-deb http://binaries.erlang-solutions.com/debian lucid contrib
-
-deb http://binaries.erlang-solutions.com/debian squeeze contrib
+deb http://packages.erlang-solutions.com/debian trusty contrib

+ 188 - 0
config/mysql

@@ -0,0 +1,188 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop the mysql database server daemon
+# Description:       Controls the main MySQL database server daemon "mysqld"
+#                    and its wrapper script "mysqld_safe".
+### END INIT INFO
+#
+set -e
+set -u
+${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
+
+test -x /usr/bin/mysqld_safe || exit 0
+
+. /lib/lsb/init-functions
+
+SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
+CONF=/etc/mysql/my.cnf
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+
+# priority can be overriden and "-s" adds output to stderr
+ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
+
+# Safeguard (relative paths, core dumps..)
+cd /
+umask 077
+
+# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
+# as many admins e.g. only store a password without a username there and
+# so break my scripts.
+export HOME=/etc/mysql/
+
+## Fetch a particular option from mysql's invocation.
+#
+# Usage: void mysqld_get_param option
+mysqld_get_param() {
+	/usr/sbin/mysqld --print-defaults \
+		| tr " " "\n" \
+		| grep -- "--$1" \
+		| tail -n 1 \
+		| cut -d= -f2
+}
+
+## Do some sanity checks before even trying to start mysqld.
+sanity_checks() {
+  # check for config file
+  if [ ! -r /etc/mysql/my.cnf ]; then
+    log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
+    echo                "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
+  fi
+
+  # check for diskspace shortage
+#  datadir=`mysqld_get_param datadir`
+#  if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
+#    log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
+#    echo                "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
+#    exit 1
+#  fi
+}
+
+## Checks if there is a server running and if so if it is accessible.
+#
+# check_alive insists on a pingable server
+# check_dead also fails if there is a lost mysqld in the process list
+#
+# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
+mysqld_status () {
+    ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
+
+    ps_alive=0
+    pidfile=`mysqld_get_param pid-file`
+    if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
+    
+    if [ "$1" = "check_alive"  -a  $ping_alive = 1 ] ||
+       [ "$1" = "check_dead"   -a  $ping_alive = 0  -a  $ps_alive = 0 ]; then
+	return 0 # EXIT_SUCCESS
+    else
+  	if [ "$2" = "warn" ]; then
+  	    echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
+	fi
+  	return 1 # EXIT_FAILURE
+    fi
+}
+
+#
+# main()
+#
+
+case "${1:-''}" in
+  'start')
+	sanity_checks;
+	# Start daemon
+	log_daemon_msg "Starting MySQL database server" "mysqld"
+	if mysqld_status check_alive nowarn; then
+	   log_progress_msg "already running"
+	   log_end_msg 0
+	else
+	    # Could be removed during boot
+	    test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
+
+	    # Start MySQL! 
+  	    su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null 2>&1 &"
+
+	    # 6s was reported in #352070 to be too few when using ndbcluster
+	    # 14s was reported in #736452 to be too few with large installs
+	    for i in $(seq 1 30); do
+                sleep 1
+	        if mysqld_status check_alive nowarn ; then break; fi
+		log_progress_msg "."
+	    done
+	    if mysqld_status check_alive warn; then
+                log_end_msg 0
+	        # Now start mysqlcheck or whatever the admin wants.
+	        output=$(/etc/mysql/debian-start)
+		[ -n "$output" ] && log_action_msg "$output"
+	    else
+	        log_end_msg 1
+		log_failure_msg "Please take a look at the syslog"
+	    fi
+	fi
+	;;
+
+  'stop')
+	# * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
+	# at least for cron, we can rely on it here, too. (although we have 
+	# to specify it explicit as e.g. sudo environments points to the normal
+	# users home and not /root)
+	log_daemon_msg "Stopping MySQL database server" "mysqld"
+	if ! mysqld_status check_dead nowarn; then
+	  set +e
+	  shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
+	  set -e
+	  if [ "$r" -ne 0 ]; then
+	    log_end_msg 1
+	    [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
+	    log_daemon_msg "Killing MySQL database server by signal" "mysqld"
+	    killall -15 mysqld
+            server_down=
+	    for i in 1 2 3 4 5 6 7 8 9 10; do
+              sleep 1
+              if mysqld_status check_dead nowarn; then server_down=1; break; fi
+            done
+          if test -z "$server_down"; then killall -9 mysqld; fi
+	  fi
+        fi
+
+        if ! mysqld_status check_dead warn; then
+	  log_end_msg 1
+	  log_failure_msg "Please stop MySQL manually and read /usr/share/doc/mysql-server-5.6/README.Debian.gz!"
+	  exit -1
+	else
+	  log_end_msg 0
+        fi
+	;;
+
+  'restart')
+	set +e; $SELF stop; set -e
+	$SELF start 
+	;;
+
+  'reload'|'force-reload')
+  	log_daemon_msg "Reloading MySQL database server" "mysqld"
+	$MYADMIN reload
+	log_end_msg 0
+	;;
+
+  'status')
+	if mysqld_status check_alive nowarn; then
+	  log_action_msg "$($MYADMIN version)"
+	else
+	  log_action_msg "MySQL is stopped."
+	  exit 3
+	fi
+  	;;
+
+  *)
+	echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+	exit 1
+	;;
+esac
+

+ 63 - 0
config/mysql.conf

@@ -0,0 +1,63 @@
+description     "MySQL 5.6 Server"
+author          "Mario Limonciello <[email protected]>"
+
+start on runlevel [2345]
+stop on starting rc RUNLEVEL=[016]
+
+respawn
+respawn limit 2 5
+
+env HOME=/etc/mysql
+umask 007
+
+# The default of 5 seconds is too low for mysql which needs to flush buffers
+kill timeout 300
+
+pre-start script
+    ## Fetch a particular option from mysql's invocation.
+    # Usage: void mysqld_get_param option
+    mysqld_get_param() {
+      /usr/sbin/mysqld --print-defaults \
+        | tr " " "\n" \
+        | grep -- "--$1" \
+        | tail -n 1 \
+        | cut -d= -f2
+    }
+
+    # priority can be overriden and "-s" adds output to stderr
+    ERR_LOGGER="logger -p daemon.err -t /etc/init/mysql.conf -i"
+
+    #Sanity checks
+    [ -r $HOME/my.cnf ]
+    [ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld
+    /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+    # check for diskspace shortage
+#    datadir=`mysqld_get_param datadir`
+#    BLOCKSIZE=`LC_ALL=C df --portability $datadir/. | tail -n 1 | awk '{print $4}'`
+#    if [ $BLOCKSIZE -le 4096 ] ; then
+#      echo "$0: ERROR: The partition with $datadir is too full!" >&2
+#      echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
+#      exit 1
+#    fi
+end script
+
+exec /usr/sbin/mysqld
+
+post-start script
+   for i in `seq 1 30` ; do
+        /usr/bin/mysqladmin --defaults-file="${HOME}"/debian.cnf ping && {
+            exec "${HOME}"/debian-start
+            # should not reach this line
+            exit 2
+        }
+        statusnow=`status`
+        if echo $statusnow | grep -q 'stop/' ; then
+            exit 0
+        elif echo $statusnow | grep -q 'respawn/' ; then
+            exit 1
+        fi
+        sleep 1
+    done
+    exit 1
+end script

+ 1 - 1
config/postgresql.conf

@@ -61,7 +61,7 @@ listen_addresses = '*'		# what IP address(es) to listen on;
 					# defaults to 'localhost', '*' = all
 					# defaults to 'localhost', '*' = all
 					# (change requires restart)
 					# (change requires restart)
 port = 5432				# (change requires restart)
 port = 5432				# (change requires restart)
-max_connections = 512			# (change requires restart)
+max_connections = 2000			# (change requires restart)
 # Note:  Increasing max_connections costs ~400 bytes of shared memory per
 # Note:  Increasing max_connections costs ~400 bytes of shared memory per
 # connection slot, plus lock space (see max_locks_per_transaction).
 # connection slot, plus lock space (see max_locks_per_transaction).
 #superuser_reserved_connections = 3	# (change requires restart)
 #superuser_reserved_connections = 3	# (change requires restart)

+ 7 - 0
curacao/.gitignore

@@ -0,0 +1,7 @@
+/project/.*
+/project/target
+/target
+/.project
+/.classpath
+/.cache
+/dist

+ 24 - 0
curacao/README.md

@@ -0,0 +1,24 @@
+# Curacao Benchmarking Test
+
+This is the Curacao portion of TechEmpower's [benchmarking test suite](../) comparing a variety of web development platforms.
+
+## Versions
+
+Curacao 2.0-M10 https://github.com/markkolich/curacao
+
+## Tests
+
+### JSON Serialization
+
+Uses [Google's GSON](https://code.google.com/p/google-gson/) under-the-hood.
+
+See the `json` method in [Benchmarks.java](src/main/java/benchmark/Benchmarks.java)
+
+    http://localhost:8080/json
+
+### Plaintext
+
+See the `plainText` method in [Benchmarks.java](src/main/java/benchmark/Benchmarks.java)
+
+    http://localhost:8080/plaintext
+

+ 0 - 0
curacao/__init__.py


+ 24 - 0
curacao/benchmark_config

@@ -0,0 +1,24 @@
+{
+  "framework" : "curacao",
+  "tests" : [{
+    "default" : {
+      "setup_file" : "setup",
+      "json_url" : "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "None",
+      "framework": "curacao",
+      "language": "Java",
+      "orm": "Raw",
+      "platform": "Curacao",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Curacao",
+      "notes": "",
+      "versus": ""
+    }
+  }]
+}

+ 35 - 0
curacao/build.sbt

@@ -0,0 +1,35 @@
+import AssemblyKeys._
+
+name := "curacao-benchmark"
+
+organization := "com.kolich"
+
+scalaVersion := "2.10.3"
+
+version := "1.0"
+
+resolvers ++= Seq(
+  "markkolich.github.io repo" at "http://markkolich.github.io/repo"
+)
+
+libraryDependencies ++= Seq(
+  "com.kolich.curacao" % "curacao" % "2.6.2" % "compile",
+  "com.kolich.curacao" % "curacao-gson" % "2.6.2" % "compile",
+  "org.eclipse.jetty" % "jetty-webapp" % "9.2.0.v20140526" % "compile",
+  "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
+  "org.slf4j" % "slf4j-api" % "1.7.2" % "compile",
+  "ch.qos.logback" % "logback-core" % "1.0.7" % "compile",
+  "ch.qos.logback" % "logback-classic" % "1.0.7" % "compile"
+)
+
+classDirectory in Compile <<= baseDirectory(new File(_, "target/classes"))
+
+sbtassembly.Plugin.assemblySettings
+
+mainClass in assembly := Some("benchmark.Bootstrap")
+
+outputPath in assembly := file("dist/curacao-standalone.jar")
+
+assemblyOption in assembly ~= { _.copy(includeScala = false) }
+
+test in assembly := {}

+ 1 - 0
curacao/project/build.properties

@@ -0,0 +1 @@
+sbt.version=0.13.2

+ 3 - 0
curacao/project/plugins.sbt

@@ -0,0 +1,3 @@
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")
+
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")

+ 35 - 0
curacao/setup.py

@@ -0,0 +1,35 @@
+
+import subprocess
+import sys
+import time
+import os
+
+def start(args, logfile, errfile):
+  if os.name == 'nt':
+    subprocess.check_call('"..\\sbt\\sbt.bat" assembly', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+  else:
+    subprocess.check_call("../sbt/sbt assembly", shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+
+  subprocess.Popen("java -jar dist/curacao-standalone.jar", shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
+   
+  time.sleep(5)
+  return 0
+
+def stop(logfile, errfile):
+  if os.name == 'nt':
+    subprocess.check_call("wmic process where \"CommandLine LIKE '%curacao-standalone%'\" call terminate", stderr=errfile, stdout=logfile)
+  else:
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'curacao-standalone' in line:
+        try:
+          pid = int(line.split(None, 2)[1])
+          os.kill(pid, 15)
+        except OSError:
+          pass
+  
+  return 0
+
+##start([], open('log.out','a'), open('error.out','a'))
+##stop(open('log.out','a'), open('error.out','a'))

+ 5 - 0
curacao/source_code

@@ -0,0 +1,5 @@
+./curacao/src/main/java/benchmark
+./curacao/src/main/java/benchmark/Bootstrap.java
+./curacao/src/main/java/benchmark/Benchmarks.java
+./curacao/src/main/java/benchmark/entities
+./curacao/src/main/java/benchmark/entities/HelloWorld.java

+ 21 - 0
curacao/src/main/java/benchmark/Benchmarks.java

@@ -0,0 +1,21 @@
+package benchmark;
+
+import benchmark.entities.HelloWorld;
+import com.kolich.curacao.annotations.Controller;
+import com.kolich.curacao.annotations.methods.RequestMapping;
+import com.kolich.curacao.handlers.requests.matchers.AntPathMatcher;
+
+@Controller
+public final class Benchmarks {
+
+    @RequestMapping(value="/json", matcher=AntPathMatcher.class)
+    public final HelloWorld json() {
+        return new HelloWorld("Hello, World!");
+    }
+
+    @RequestMapping(value="/plaintext", matcher=AntPathMatcher.class)
+    public final String plainText() {
+        return "Hello, World!";
+    }
+
+}

+ 52 - 0
curacao/src/main/java/benchmark/Bootstrap.java

@@ -0,0 +1,52 @@
+package benchmark;
+
+import com.kolich.curacao.CuracaoContextListener;
+import com.kolich.curacao.CuracaoDispatcherServlet;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.webapp.WebAppContext;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public final class Bootstrap {
+
+    private static final int DEFAULT_SERVER_LISTEN_PORT = 8080;
+
+    public static void main(final String[] args) throws Exception {
+
+        final File workingDir = getWorkingDir();
+
+        int port;
+        try {
+            port = Integer.parseInt(args[0]);
+        } catch (Exception e) {
+            port = DEFAULT_SERVER_LISTEN_PORT;
+        }
+
+        final Server server = new Server(port);
+
+        final ServletHolder holder = new ServletHolder(CuracaoDispatcherServlet.class);
+        holder.setAsyncSupported(true); // Async supported = true
+        holder.setInitOrder(1); // Load on startup = true
+
+        final WebAppContext context = new WebAppContext();
+        context.addEventListener(new CuracaoContextListener()); // Required
+        context.setContextPath("/");
+        context.setResourceBase(workingDir.getAbsolutePath());
+        context.addServlet(holder, "/*");
+
+        server.setHandler(context);
+
+        server.start();
+        server.join();
+
+    }
+
+    private static final File getWorkingDir() {
+        final Path currentRelativePath = Paths.get("");
+        return currentRelativePath.toAbsolutePath().toFile();
+    }
+
+}

+ 21 - 0
curacao/src/main/java/benchmark/entities/HelloWorld.java

@@ -0,0 +1,21 @@
+package benchmark.entities;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.annotations.SerializedName;
+import com.kolich.curacao.gson.GsonAppendableCuracaoEntity;
+
+public final class HelloWorld extends GsonAppendableCuracaoEntity {
+
+    private static final Gson gson__ =
+        new GsonBuilder().serializeNulls().create();
+
+    @SerializedName("message")
+    private final String message_;
+
+    public HelloWorld(final String message) {
+        super(gson__);
+        message_ = message;
+    }
+
+}

+ 12 - 0
curacao/src/main/resources/application.conf

@@ -0,0 +1,12 @@
+curacao {
+
+  boot-package = "benchmark"
+
+  ## Never timeout.
+  async-context-timeout = 0
+
+  ## Both the request and response thread pools are "unbounded" intentionally.
+  pools.request.size = 0
+  pools.response.size = 0
+
+}

+ 23 - 0
curacao/src/main/resources/logback.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <target>System.out</target>
+        <encoder>
+            <pattern>%date{MM/dd HH:mm:ss.SSS} %-5level[%.15thread] %logger{1} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <logger name="org.reflections" additivity="false" level="WARN">
+        <appender-ref ref="CONSOLE"/>
+    </logger>
+
+    <logger name="com.kolich.curacao" additivity="false" level="ERROR">
+        <appender-ref ref="CONSOLE"/>
+    </logger>
+
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+    </root>
+
+</configuration>

+ 0 - 0
dropwizard-mongodb/__init__.py


+ 25 - 0
dropwizard-mongodb/benchmark_config

@@ -0,0 +1,25 @@
+{
+  "framework": "dropwizard-mongodb",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/db?queries=",
+      "port": 9000,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MongoDB",
+      "framework": "dropwizard",
+      "language": "Java",
+      "orm": "Full",
+      "platform": "Jetty",
+      "webserver": "Jetty",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "dropwizard-mongodb",
+      "notes": "mongodb implementation of dropwizard example",
+      "versus": ""
+    }
+  }]
+}

+ 20 - 0
dropwizard-mongodb/hello-world.yml

@@ -0,0 +1,20 @@
+http:
+  port: 9000
+
+  requestLog:
+
+    # Settings for logging to stdout.
+    console:
+      # If true, log requests to stdout.
+      enabled: false
+
+logging:
+
+  # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
+  level: OFF
+
+  console:
+
+    # If true, write log statements to stdout.
+    enabled: false
+

+ 84 - 0
dropwizard-mongodb/pom.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.danielt</groupId>
+    <artifactId>dropwizard-mongodb</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.yammer.dropwizard</groupId>
+            <artifactId>dropwizard-core</artifactId>
+            <version>0.6.2</version>
+        </dependency>
+		<dependency>
+			<groupId>org.mongojack</groupId>
+			<artifactId>mongojack</artifactId>
+			<version>2.0.0</version>
+		</dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>1.6</version>
+                <configuration>
+                    <createDependencyReducedPom>true</createDependencyReducedPom>
+                    <filters>
+                        <filter>
+                            <artifact>*:*</artifact>
+                            <excludes>
+                                <exclude>META-INF/*.SF</exclude>
+                                <exclude>META-INF/*.DSA</exclude>
+                                <exclude>META-INF/*.RSA</exclude>
+                            </excludes>
+                        </filter>
+                    </filters>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>com.example.helloworld.HelloWorldService</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 23 - 0
dropwizard-mongodb/setup.py

@@ -0,0 +1,23 @@
+import subprocess
+import sys
+import setup_util
+from os.path import expanduser
+import os
+
+home = expanduser("~")
+
+def start(args, logfile, errfile):
+    try:
+        subprocess.check_call("mvn clean package;", shell=True, cwd="dropwizard-mongodb", stderr=errfile, stdout=logfile)
+        subprocess.Popen("java -jar target/dropwizard-mongodb-0.0.1-SNAPSHOT.jar server hello-world.yml", shell=True, cwd="dropwizard-mongodb", stderr=errfile, stdout=logfile)
+        return 0
+    except subprocess.CalledProcessError:
+        return 1
+def stop(logfile, errfile):
+  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+  out, err = p.communicate()
+  for line in out.splitlines():
+    if 'hello-world' in line:
+      pid = int(line.split(None, 2)[1])
+      os.kill(pid, 15)
+  return 0

+ 11 - 0
dropwizard-mongodb/source_code

@@ -0,0 +1,11 @@
+./dropwizard-mongodb/src/main/java/com/example/helloworld/
+./dropwizard-mongodb/src/main/java/com/example/helloworld/db
+./dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/resources
+./dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/core
+./dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java
+./dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java

+ 27 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldConfiguration.java

@@ -0,0 +1,27 @@
+
+package com.example.helloworld;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+import org.hibernate.validator.constraints.NotEmpty;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.yammer.dropwizard.config.Configuration;
+
+public class HelloWorldConfiguration
+    extends Configuration
+{
+	@JsonProperty
+    @NotEmpty
+    public String mongohost = "localhost";
+ 
+    @JsonProperty
+    @Min(1)
+    @Max(65535)
+    public int mongoport = 27017;
+ 
+    @JsonProperty
+    @NotEmpty
+    public String mongodb = "hello_world";
+}

+ 47 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/HelloWorldService.java

@@ -0,0 +1,47 @@
+
+package com.example.helloworld;
+
+import java.net.UnknownHostException;
+
+import org.mongojack.JacksonDBCollection;
+
+import com.example.helloworld.core.World;
+import com.example.helloworld.db.MongoHealthCheck;
+import com.example.helloworld.db.MongoManaged;
+import com.example.helloworld.resources.JsonResource;
+import com.example.helloworld.resources.WorldResource;
+import com.mongodb.DB;
+import com.mongodb.Mongo;
+import com.yammer.dropwizard.Service;
+import com.yammer.dropwizard.config.Bootstrap;
+import com.yammer.dropwizard.config.Environment;
+
+public class HelloWorldService
+    extends Service<HelloWorldConfiguration>
+{
+
+  public static void main(String[] args) throws Exception
+  {
+    new HelloWorldService().run(args);
+  }
+
+  @Override
+  public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap)
+  {
+    bootstrap.setName("hello-world");
+  }
+
+  @Override
+  public void run(HelloWorldConfiguration config, Environment environment) throws UnknownHostException
+  {
+    Mongo mongo = new Mongo(config.mongohost, config.mongoport);
+    MongoManaged mongoManaged = new MongoManaged(mongo);
+    environment.manage(mongoManaged);
+    environment.addHealthCheck(new MongoHealthCheck(mongo));
+    DB db = mongo.getDB(config.mongodb);
+    JacksonDBCollection<World, String> worlds = JacksonDBCollection.wrap(db.getCollection("world"), World.class, String.class);
+    environment.addResource(new WorldResource(worlds));
+    environment.addResource(new JsonResource());
+  }
+
+}

+ 40 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/core/World.java

@@ -0,0 +1,40 @@
+
+package com.example.helloworld.core;
+
+import javax.persistence.*;
+
+import org.mongojack.Id;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+@Entity
+@Table(name = "World")
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class World
+{
+  @Id
+  private long id;
+
+  @Column(name = "randomNumber", nullable = false)
+  private long randomNumber;
+
+  public long getId()
+  {
+    return id;
+  }
+
+  public void setId(long id)
+  {
+    this.id = id;
+  }
+
+  public long getRandomNumber()
+  {
+    return this.randomNumber;
+  }
+
+  public void setRandomNumber(long randomNumber)
+  {
+    this.randomNumber = randomNumber;
+  }
+}

+ 21 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoHealthCheck.java

@@ -0,0 +1,21 @@
+package com.example.helloworld.db;
+
+import com.mongodb.Mongo;
+import com.yammer.metrics.core.HealthCheck;
+ 
+public class MongoHealthCheck extends HealthCheck {
+ 
+    private Mongo mongo;
+ 
+    public MongoHealthCheck(Mongo mongo) {
+        super("MongoDBHealthCheck");
+        this.mongo = mongo;
+    }
+ 
+    @Override
+    protected Result check() throws Exception {
+        mongo.getDatabaseNames();
+        return Result.healthy();
+    }
+ 
+}

+ 23 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/db/MongoManaged.java

@@ -0,0 +1,23 @@
+package com.example.helloworld.db;
+
+import com.mongodb.Mongo;
+import com.yammer.dropwizard.lifecycle.Managed;
+ 
+public class MongoManaged implements Managed {
+ 
+    private Mongo mongo;
+ 
+    public MongoManaged(Mongo mongo) {
+        this.mongo = mongo;
+    }
+ 
+    @Override
+    public void start() throws Exception {
+    }
+ 
+    @Override
+    public void stop() throws Exception {
+        mongo.close();
+    }
+ 
+}

+ 30 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/resources/JsonResource.java

@@ -0,0 +1,30 @@
+
+package com.example.helloworld.resources;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/json")
+@Produces(MediaType.APPLICATION_JSON)
+public class JsonResource
+{
+  // Response message class (copied from 'servlet' test)
+  public final static class HelloMessage {
+    public final String message;
+
+    public HelloMessage(String m) { message = m; }
+  }
+
+  public JsonResource() { }
+
+  @GET
+  public HelloMessage sayHello()
+  {
+    return new HelloMessage("Hello, World!");
+  }
+}

+ 47 - 0
dropwizard-mongodb/src/main/java/com/example/helloworld/resources/WorldResource.java

@@ -0,0 +1,47 @@
+package com.example.helloworld.resources;
+
+import java.util.Random;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.mongojack.DBCursor;
+import org.mongojack.JacksonDBCollection;
+
+import com.example.helloworld.core.World;
+import com.google.common.base.Optional;
+import com.mongodb.BasicDBObject;
+import com.mongodb.DBObject;
+
+@Path("/db")
+@Produces(MediaType.APPLICATION_JSON)
+public class WorldResource
+{
+
+  private JacksonDBCollection<World, String> collection;
+ 
+  public WorldResource(JacksonDBCollection<World, String> collection)
+  {
+    this.collection = collection;
+  }
+
+  @GET
+  public World[] dbTest(@QueryParam("queries") Optional<Integer> queries)
+  {
+    final int totalQueries = queries.or(1);
+    final World[] worlds = new World[queries.or(1)];
+    final Random random = new Random(System.currentTimeMillis());
+
+    for (int i = 0; i < totalQueries; i++)
+    {
+    	DBObject query = new BasicDBObject();
+    	query.put("_id", (random.nextInt(10000) + 1));
+    	DBCursor<World> dbCursor = collection.find(query);
+        worlds[i] = (dbCursor.hasNext()) ? dbCursor.next() : null;
+    }
+    return worlds;
+  }
+}

+ 1 - 1
grails/README.md

@@ -4,7 +4,7 @@ This is the Grails portion of a [benchmarking test suite](../) comparing a varie
 
 
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
 The tests were run with:
 The tests were run with:
-* [Grails 2.3.3](http://grails.org/)
+* [Grails 2.3.6](http://grails.org/)
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
 * [Resin 4.0.34](http://www.caucho.com/)
 * [Resin 4.0.34](http://www.caucho.com/)
 * [MySQL 5.5.29](https://dev.mysql.com/)
 * [MySQL 5.5.29](https://dev.mysql.com/)

+ 0 - 16
grails/hello/.classpath

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/java"/>
-	<classpathentry kind="src" path="src/groovy"/>
-	<classpathentry kind="src" path="grails-app/conf"/>
-	<classpathentry kind="src" path="grails-app/controllers"/>
-	<classpathentry kind="src" path="grails-app/domain"/>
-	<classpathentry kind="src" path="grails-app/services"/>
-	<classpathentry kind="src" path="grails-app/taglib"/>
-	<classpathentry kind="src" path="grails-app/utils"/>
-	<classpathentry kind="src" path="test/integration"/>
-	<classpathentry kind="src" path="test/unit"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
-	<classpathentry kind="output" path="target-eclipse/classes"/>
-</classpath>

+ 2 - 0
grails/hello/.gitignore

@@ -15,3 +15,5 @@ stacktrace.log
 /web-app/WEB-INF/classes
 /web-app/WEB-INF/classes
 /.link_to_grails_plugins/
 /.link_to_grails_plugins/
 /target-eclipse/
 /target-eclipse/
+.project
+.classpath

+ 0 - 25
grails/hello/.project

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>hello</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.wst.common.project.facet.core.builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.grails.ide.eclipse.core.nature</nature>
-		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
-	</natures>
-</projectDescription>

+ 2 - 2
grails/hello/application.properties

@@ -1,6 +1,6 @@
 #Grails Metadata file
 #Grails Metadata file
-#Sun Oct 20 22:08:59 EEST 2013
-app.grails.version=2.3.3
+#Tue Feb 25 10:29:09 EET 2014
+app.grails.version=2.3.6
 app.name=hello
 app.name=hello
 app.servlet.version=2.5
 app.servlet.version=2.5
 app.version=0.1
 app.version=0.1

+ 3 - 3
grails/hello/grails-app/conf/BuildConfig.groovy

@@ -59,11 +59,11 @@ grails.project.dependency.resolution = {
     dependencies {
     dependencies {
         // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
         // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
 
 
-        runtime 'mysql:mysql-connector-java:5.1.27'
+        runtime 'mysql:mysql-connector-java:5.1.29'
     }
     }
 
 
     plugins {
     plugins {
-        runtime ":hibernate:3.6.10.4"
+        runtime ":hibernate:3.6.10.8"
         //runtime ":jquery:1.10.2"
         //runtime ":jquery:1.10.2"
         //runtime ":resources:1.2.1"
         //runtime ":resources:1.2.1"
 
 
@@ -72,6 +72,6 @@ grails.project.dependency.resolution = {
         //runtime ":cached-resources:1.0"
         //runtime ":cached-resources:1.0"
         //runtime ":yui-minify-resources:0.1.4"
         //runtime ":yui-minify-resources:0.1.4"
 
 
-        build ":tomcat:7.0.47"
+        build ":tomcat:7.0.50.1"
     }
     }
 }
 }

+ 0 - 19
grails/hello/grails-app/conf/JsonWorkaroundBootStrap.groovy

@@ -1,19 +0,0 @@
-import org.codehaus.groovy.grails.web.json.JSONObject
-import org.springframework.util.ClassUtils
-import org.springframework.util.ReflectionUtils
-
-class JsonWorkaroundBootStrap {
-    def init = { servletContext ->
-        // activate workaround for GRAILS-10823
-        println("activating workaround for GRAILS-10823 - use this only for Grails 2.3.3")
-        def encoderInstance = ClassUtils.forName("org.codehaus.groovy.grails.plugins.codecs.JSONEncoder", JSONObject.class.getClassLoader()).newInstance()
-        ['javascriptEncoderStateless', 'javascriptEncoder'].each { fieldName ->
-            ReflectionUtils.findField(JSONObject, fieldName).with {
-                accessible = true
-                set(null, encoderInstance)
-            }
-        }
-    }
-    def destroy = {
-    }
-}

+ 9 - 15
grails/hello/grails-app/controllers/hello/HelloController.groovy

@@ -47,33 +47,27 @@ class HelloController {
         if(queries > 500) queries=500
         if(queries > 500) queries=500
         def random = ThreadLocalRandom.current()
         def random = ThreadLocalRandom.current()
 
 
-        List<Integer> worldIds = new ArrayList<Integer>(queries)
+        int[] worldIds = new int[queries]
         for (int i = 0; i < queries; i++) {
         for (int i = 0; i < queries; i++) {
-            worldIds.add(random.nextInt(10000) + 1)
+            worldIds[i] = (random.nextInt(10000) + 1)
         }
         }
-        List<World> worlds
+
+        List<World> worlds = new ArrayList<World>(queries)
         if (updateAlso) {
         if (updateAlso) {
-            worlds = getAllLocked(worldIds as Serializable[])
-            for (World world : worlds) {
+            Arrays.sort(worldIds)
+            for (int id : worldIds) {
+                World world = World.lock(id)
                 world.randomNumber = random.nextInt(10000) + 1
                 world.randomNumber = random.nextInt(10000) + 1
+                worlds.add(world)
             }
             }
         } else {
         } else {
-            worlds = new ArrayList<World>(queries)
-            for (Integer id : worldIds) {
+            for (int id : worldIds) {
                 worlds.add(World.read(id))
                 worlds.add(World.read(id))
             }
             }
         }
         }
         return worlds
         return worlds
     }
     }
     
     
-    @CompileStatic(TypeCheckingMode.SKIP)
-    private List<World> getAllLocked(Serializable[] worldIds) {
-        World.withCriteria {
-            'in'('id', worldIds as Serializable[])
-            lock true
-        }
-    }
-    
     // Test type 4: Fortunes
     // Test type 4: Fortunes
     @Transactional(readOnly=true)
     @Transactional(readOnly=true)
     def fortunes() {
     def fortunes() {

+ 5 - 5
hapi/app.js

@@ -9,7 +9,7 @@ var cluster = require('cluster'),
 	mongoose = require('mongoose'),
 	mongoose = require('mongoose'),
 	async = require('async'),
 	async = require('async'),
 	conn = mongoose.connect('mongodb://localhost/hello_world'),
 	conn = mongoose.connect('mongodb://localhost/hello_world'),
-	connMap = { user: 'benchmarkdbuser', password: 'benchmarkdbpass', database: 'hello_world', host: 'localhost' };
+	connMap = { user: 'benchmarkdbuser', password: 'benchmarkdbpass', database: 'hello_world', host: 'localhost', charset: 'utf8' };
 
 
 var WorldSchema = new mongoose.Schema({
 var WorldSchema = new mongoose.Schema({
 		id          : Number,
 		id          : Number,
@@ -80,10 +80,10 @@ if (cluster.isMaster) {
 	server.route({
 	server.route({
 		method: 'GET',
 		method: 'GET',
 		path: '/mysql-orm/{queries?}',
 		path: '/mysql-orm/{queries?}',
-		handler: function(req){
+		handler: function(req, reply){
 			if (windows) return req.reply(Hapi.error.internal('Not supported on windows'));
 			if (windows) return req.reply(Hapi.error.internal('Not supported on windows'));
 
 
-			var queries = req.params.queries || 1,
+			var queries = isNaN(req.params.queries) ? 1 : parseInt(req.params.queries, 10),
 				queryFunctions = [];
 				queryFunctions = [];
 
 
 			queries = Math.min(Math.max(queries, 1), 500);
 			queries = Math.min(Math.max(queries, 1), 500);
@@ -95,10 +95,10 @@ if (cluster.isMaster) {
 			}
 			}
 
 
 			async.parallel(queryFunctions, function(err, results){
 			async.parallel(queryFunctions, function(err, results){
-				if (queries == 1) {
+				if (!req.params.queries) {
 					results = results[0];
 					results = results[0];
 				}
 				}
-				req.reply(results).header('Server', 'hapi');
+				reply(results).header('Server', 'hapi');
 			});
 			});
 		}
 		}
 	});
 	});

+ 2 - 2
netty/README.md

@@ -8,8 +8,8 @@ This is the netty portion of a [benchmarking test suite](../) comparing a variet
 ## Versions
 ## Versions
 
 
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
 * [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
-* [Netty 4.0.14.Beta1](http://netty.io/)
-* [Jackson 2.3.0](http://wiki.fasterxml.com/JacksonHome)
+* [Netty 4.0.16](http://netty.io/)
+* [Jackson 2.3.1](http://wiki.fasterxml.com/JacksonHome)
 
 
 ## References
 ## References
 * https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/http/snoop
 * https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/http/snoop

+ 74 - 68
netty/pom.xml

@@ -1,72 +1,78 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
 
-  <modelVersion>4.0.0</modelVersion>
+	<modelVersion>4.0.0</modelVersion>
 
 
-  <groupId>com.techempower</groupId>
-  <artifactId>netty-example</artifactId>
-  <version>0.1</version>
-  
-  <packaging>jar</packaging>
+	<groupId>com.techempower</groupId>
+	<artifactId>netty-example</artifactId>
+	<version>0.1</version>
 
 
-  <dependencies>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec-http</artifactId>
-      <version>4.0.14.Beta1</version>
-    </dependency>
-	 <dependency>
-		<groupId>com.fasterxml.jackson.core</groupId>
-		<artifactId>jackson-databind</artifactId>
-		<version>2.3.0</version>
-	 </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-      <version>2.1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.javassist</groupId>
-      <artifactId>javassist</artifactId>
-      <version>3.18.0-GA</version>
-    </dependency>
-  </dependencies>
-  
-  <build>
-    <plugins>
-      <plugin>
-        <inherited>true</inherited>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.3.2</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-          <optimize>true</optimize>
-          <debug>false</debug>
-        </configuration>
-      </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>hello.HelloWebServer</mainClass>
-            </manifest>
-          </archive>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
-        </configuration>
-        <executions>
-          <execution>
-            <id>make-assembly</id> <!-- this is used for inheritance merges -->
-            <phase>package</phase> <!-- bind to the packaging phase -->
-            <goals>
-              <goal>single</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>io.netty</groupId>
+			<artifactId>netty-codec-http</artifactId>
+			<version>4.0.17.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>io.netty</groupId>
+			<artifactId>netty-transport-native-epoll</artifactId>
+			<version>4.0.17.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.module</groupId>
+			<artifactId>jackson-module-afterburner</artifactId>
+			<version>2.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>javassist</groupId>
+			<artifactId>javassist</artifactId>
+			<version>RELEASE</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<inherited>true</inherited>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+					<optimize>true</optimize>
+					<debug>false</debug>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<archive>
+						<manifest>
+							<mainClass>hello.HelloWebServer</mainClass>
+						</manifest>
+					</archive>
+					<descriptorRefs>
+						<descriptorRef>jar-with-dependencies</descriptorRef>
+					</descriptorRefs>
+				</configuration>
+				<executions>
+					<execution>
+						<id>make-assembly</id> <!-- this is used for inheritance merges -->
+						<phase>package</phase> <!-- bind to the packaging phase -->
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>
 </project>

+ 1 - 1
netty/setup.py

@@ -6,7 +6,7 @@ import os
 def start(args, logfile, errfile):
 def start(args, logfile, errfile):
   try:
   try:
     subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="netty", stderr=errfile, stdout=logfile)
     subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="netty", stderr=errfile, stdout=logfile)
-    subprocess.Popen("java -jar netty-example-0.1-jar-with-dependencies.jar".rsplit(" "), cwd="netty/target", stderr=errfile, stdout=logfile)
+    subprocess.Popen("java -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts -jar netty-example-0.1-jar-with-dependencies.jar".rsplit(" "), cwd="netty/target", stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1

+ 1 - 0
netty/source_code

@@ -5,3 +5,4 @@
 ./netty/src/main/java/hello/HelloServerInitializer.java
 ./netty/src/main/java/hello/HelloServerInitializer.java
 ./netty/src/main/java/hello/HelloWebServer.java
 ./netty/src/main/java/hello/HelloWebServer.java
 ./netty/src/main/java/hello/HelloServerHandler.java
 ./netty/src/main/java/hello/HelloServerHandler.java
+./netty/src/main/java/hello/Message.java

+ 42 - 43
netty/src/main/java/hello/HelloServerHandler.java

@@ -2,16 +2,8 @@ package hello;
 
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.buffer.Unpooled;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-import com.fasterxml.jackson.databind.*;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelFutureListener;
 import io.netty.channel.ChannelFutureListener;
+import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.handler.codec.http.DefaultFullHttpResponse;
 import io.netty.handler.codec.http.DefaultFullHttpResponse;
@@ -22,23 +14,56 @@ import io.netty.handler.codec.http.HttpResponseStatus;
 import io.netty.handler.codec.http.HttpVersion;
 import io.netty.handler.codec.http.HttpVersion;
 import io.netty.util.CharsetUtil;
 import io.netty.util.CharsetUtil;
 
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
 
 
[email protected]
 public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
 public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
-    private final SimpleDateFormat format = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
-    private CharSequence date;
+	private static final ThreadLocal<DateFormat> FORMAT = new ThreadLocal<DateFormat>() {
+        @Override
+        protected DateFormat initialValue() {
+            return new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
+        }
+    };
+
 
 
-    private static final ObjectMapper MAPPER = new ObjectMapper();
-    private final ByteBuf buffer = Unpooled.directBuffer().writeBytes("Hello, World!".getBytes(CharsetUtil.UTF_8));
-    private final CharSequence contentLength = HttpHeaders.newEntity(String.valueOf(buffer.readableBytes()));
+    private static final ByteBuf CONTENT_BUFFER = Unpooled.unreleasableBuffer(
+            Unpooled.directBuffer().writeBytes("Hello, World!".getBytes(CharsetUtil.UTF_8)));
+    private static final CharSequence contentLength = HttpHeaders.newEntity(
+            String.valueOf(CONTENT_BUFFER.readableBytes()));
 
 
     private static final CharSequence TYPE_PLAIN = HttpHeaders.newEntity("text/plain; charset=UTF-8");
     private static final CharSequence TYPE_PLAIN = HttpHeaders.newEntity("text/plain; charset=UTF-8");
     private static final CharSequence TYPE_JSON = HttpHeaders.newEntity("application/json; charset=UTF-8");
     private static final CharSequence TYPE_JSON = HttpHeaders.newEntity("application/json; charset=UTF-8");
-
     private static final CharSequence SERVER_NAME = HttpHeaders.newEntity("Netty");
     private static final CharSequence SERVER_NAME = HttpHeaders.newEntity("Netty");
     private static final CharSequence CONTENT_TYPE_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.CONTENT_TYPE);
     private static final CharSequence CONTENT_TYPE_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.CONTENT_TYPE);
     private static final CharSequence DATE_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.DATE);
     private static final CharSequence DATE_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.DATE);
     private static final CharSequence CONTENT_LENGTH_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.CONTENT_LENGTH);
     private static final CharSequence CONTENT_LENGTH_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.CONTENT_LENGTH);
     private static final CharSequence SERVER_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.SERVER);
     private static final CharSequence SERVER_ENTITY = HttpHeaders.newEntity(HttpHeaders.Names.SERVER);
+    private static final ObjectMapper MAPPER;
+    
+    static{
+    	MAPPER = new ObjectMapper();
+    	MAPPER.registerModule(new AfterburnerModule());
+    }
+    
+    private volatile CharSequence date = HttpHeaders.newEntity(FORMAT.get().format(new Date()));
+
+    HelloServerHandler(ScheduledExecutorService service) {
+        service.scheduleWithFixedDelay(new Runnable() {
+            private final DateFormat format = FORMAT.get();
+            @Override
+            public void run() {
+                date = HttpHeaders.newEntity(format.format(new Date()));
+            }
+        }, 1000, 1000, TimeUnit.MILLISECONDS);
+
+    }
 
 
     @Override
     @Override
     public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
     public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
@@ -47,10 +72,10 @@ public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
             String uri = request.getUri();
             String uri = request.getUri();
             switch (uri) {
             switch (uri) {
                 case "/plaintext":
                 case "/plaintext":
-                    writeResponse(ctx, request, buffer.duplicate().retain(), TYPE_PLAIN, contentLength);
+                    writeResponse(ctx, request, CONTENT_BUFFER.duplicate(), TYPE_PLAIN, contentLength);
                     return;
                     return;
                 case "/json":
                 case "/json":
-                    byte[] json = MAPPER.writeValueAsBytes(Collections.singletonMap("message", "Hello, World!"));
+                    byte[] json = MAPPER.writeValueAsBytes(new Message("Hello, World!"));
                     writeResponse(ctx, request, Unpooled.wrappedBuffer(json), TYPE_JSON,
                     writeResponse(ctx, request, Unpooled.wrappedBuffer(json), TYPE_JSON,
                             String.valueOf(json.length));
                             String.valueOf(json.length));
                     return;
                     return;
@@ -94,30 +119,4 @@ public class HelloServerHandler extends SimpleChannelInboundHandler<Object> {
     public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
     public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
         ctx.flush();
         ctx.flush();
     }
     }
-
-    @Override
-    public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
-        super.handlerRemoved(ctx);
-        buffer.release();
-    }
-
-    @Override
-    public void channelActive(ChannelHandlerContext ctx) throws Exception {
-        date = HttpHeaders.newEntity(format.format(new Date()));
-
-        Channel channel = ctx.channel();
-        final ScheduledFuture<?> future = channel.eventLoop().scheduleWithFixedDelay(new Runnable() {
-            @Override
-            public void run() {
-                date = HttpHeaders.newEntity(format.format(new Date()));
-            }
-        }, 1000, 1000, TimeUnit.MILLISECONDS);
-
-        channel.closeFuture().addListener(new ChannelFutureListener() {
-            @Override
-            public void operationComplete(ChannelFuture channelFuture) throws Exception {
-                future.cancel(false);
-            }
-        });
-    }
 }
 }

+ 8 - 1
netty/src/main/java/hello/HelloServerInitializer.java

@@ -1,17 +1,24 @@
 package hello;
 package hello;
 
 
+import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.handler.codec.http.HttpRequestDecoder;
 import io.netty.handler.codec.http.HttpRequestDecoder;
 import io.netty.handler.codec.http.HttpResponseEncoder;
 import io.netty.handler.codec.http.HttpResponseEncoder;
 
 
+import java.util.concurrent.ScheduledExecutorService;
+
 public class HelloServerInitializer extends ChannelInitializer<SocketChannel> {
 public class HelloServerInitializer extends ChannelInitializer<SocketChannel> {
+    private final ChannelHandler httpHandler;
+    public HelloServerInitializer(ScheduledExecutorService service) {
+        this.httpHandler = new HelloServerHandler(service);
+    }
     @Override
     @Override
     public void initChannel(SocketChannel ch) throws Exception {
     public void initChannel(SocketChannel ch) throws Exception {
         ChannelPipeline p = ch.pipeline();
         ChannelPipeline p = ch.pipeline();
         p.addLast("encoder", new HttpResponseEncoder());
         p.addLast("encoder", new HttpResponseEncoder());
         p.addLast("decoder", new HttpRequestDecoder(4096, 8192, 8192, false));
         p.addLast("decoder", new HttpRequestDecoder(4096, 8192, 8192, false));
-        p.addLast("handler", new HelloServerHandler());
+        p.addLast("handler", httpHandler);
     }
     }
 }
 }

+ 37 - 16
netty/src/main/java/hello/HelloWebServer.java

@@ -5,14 +5,19 @@ import io.netty.buffer.PooledByteBufAllocator;
 import io.netty.channel.Channel;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelOption;
 import io.netty.channel.ChannelOption;
 import io.netty.channel.EventLoopGroup;
 import io.netty.channel.EventLoopGroup;
+import io.netty.channel.ServerChannel;
+import io.netty.channel.epoll.EpollEventLoopGroup;
+import io.netty.channel.epoll.EpollServerSocketChannel;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.channel.socket.nio.NioServerSocketChannel;
 import io.netty.util.ResourceLeakDetector;
 import io.netty.util.ResourceLeakDetector;
+import io.netty.util.ResourceLeakDetector.Level;
 
 
 
 
 public class HelloWebServer {
 public class HelloWebServer {
+	private static int IO_THREADS = Runtime.getRuntime().availableProcessors() * 2;
     static {
     static {
-        ResourceLeakDetector.setEnabled(false);
+        ResourceLeakDetector.setLevel(Level.DISABLED);
     }
     }
 
 
     private final int port;
     private final int port;
@@ -22,22 +27,38 @@ public class HelloWebServer {
     }
     }
 
 
     public void run() throws Exception {
     public void run() throws Exception {
-        // Configure the server.
-        EventLoopGroup group = new NioEventLoopGroup();
-        try {
-            ServerBootstrap b = new ServerBootstrap();
-            b.group(group)
-             .childHandler(new HelloServerInitializer())
-             .channel(NioServerSocketChannel.class)
-             .option(ChannelOption.SO_BACKLOG, 1024)
-             .childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
-             
-            Channel ch = b.bind(port).sync().channel();
-            ch.closeFuture().sync();
-        } finally {
-            group.shutdownGracefully().sync();
-        }
+		// Configure the server.
+
+		String os = System.getProperty("os.name").toLowerCase();
+
+		boolean is_linux = os.contains("linux");
+		
+		if (is_linux) {
+			doRun( new EpollEventLoopGroup(), EpollServerSocketChannel.class);
+		}
+		else {
+			doRun(new NioEventLoopGroup(), NioServerSocketChannel.class);
+		} 
     }
     }
+    
+	private void doRun(EventLoopGroup loupGroup, Class<? extends ServerChannel> serverChannelClass) throws InterruptedException	{
+		try {
+			ServerBootstrap b = new ServerBootstrap();
+			b.option(ChannelOption.SO_BACKLOG, 1024);
+			b.option(ChannelOption.SO_REUSEADDR, true);
+			b.group(loupGroup).channel(serverChannelClass).childHandler(new HelloServerInitializer(loupGroup.next()));			
+            b.option(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);
+            b.childOption(ChannelOption.ALLOCATOR, new PooledByteBufAllocator(true, IO_THREADS, IO_THREADS, 8192, 11));
+            b.childOption(ChannelOption.SO_REUSEADDR, true);
+            b.childOption(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);
+
+			Channel ch = b.bind(port).sync().channel();
+			ch.closeFuture().sync();
+		}
+		finally {
+			loupGroup.shutdownGracefully().sync();
+		}
+	}
 
 
     public static void main(String[] args) throws Exception {
     public static void main(String[] args) throws Exception {
         int port;
         int port;

+ 15 - 0
netty/src/main/java/hello/Message.java

@@ -0,0 +1,15 @@
+package hello;
+
+public class Message {
+	
+	private final String message;
+
+	public Message(String message) {
+		super();
+		this.message = message;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+}

+ 2 - 3
openresty/nginx.conf

@@ -1,4 +1,3 @@
-#worker_processes  1;
 pid        /tmp/nginx.pid;
 pid        /tmp/nginx.pid;
 error_log stderr error;
 error_log stderr error;
 
 
@@ -9,8 +8,8 @@ events {
 http {
 http {
     resolver 127.0.0.1;
     resolver 127.0.0.1;
     access_log off;
     access_log off;
-    lua_package_path 'CWD/openresty/?.lua;;';
-    init_by_lua 'encode = require("cjson").encode mysql = require("resty.mysql")';
+    lua_package_path '/home/tfb/FrameworkBenchmarks/openresty/?.lua;;';
+    init_by_lua 'require "resty.core" encode = require("cjson").encode mysql = require("resty.mysql")';
     server {
     server {
         listen       8080;
         listen       8080;
         location /plaintext {
         location /plaintext {

+ 7 - 0
php-zend-framework/.gitignore

@@ -0,0 +1,7 @@
+/vendor
+/build
+/dist
+.DS_Store
+/tags
+.idea
+composer.lock

+ 0 - 0
php-zend-framework/__init__.py


+ 25 - 0
php-zend-framework/benchmark_config

@@ -0,0 +1,25 @@
+{
+  "framework": "ZendFramework",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/db-multi?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MySQL",
+      "framework": "Zend",
+      "language": "PHP",
+      "orm": "Full",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "zend",
+      "notes": "",
+      "versus": "php"
+    }
+  }]
+}

+ 19 - 0
php-zend-framework/composer.json

@@ -0,0 +1,19 @@
+{
+    "name": "zendframework/skeleton-application",
+    "description": "Skeleton Application for ZF2",
+    "license": "BSD-3-Clause",
+    "keywords": [
+        "framework",
+        "zf2"
+    ],
+    "homepage": "http://framework.zend.com/",
+    "require": {
+        "php": ">=5.3.3",
+        "zendframework/zendframework": "~2.2"
+    },
+    "autoload": {
+        "psr-0": {
+            "FrameworkBenchmarks": "module/FrameworkBenchmarks/src"
+        }
+    }
+}

+ 16 - 0
php-zend-framework/config/application.config.php

@@ -0,0 +1,16 @@
+<?php
+return array(
+    'modules' => array(
+        'FrameworkBenchmarks',
+    ),
+    'module_listener_options' => array(
+        'module_paths' => array(),
+        'config_glob_paths' => array(
+            'config/autoload/{,*.}{global,local}.php',
+        ),
+        'config_cache_enabled' => true,
+        'config_cache_key'     => 'config_cache',
+        'cache_dir'            => 'data/cache',
+        'check_dependencies'   => false,
+    ),
+);

+ 0 - 0
php-zend-framework/config/autoload/.gitkeep


+ 10 - 0
php-zend-framework/config/autoload/benchmarks.local.php

@@ -0,0 +1,10 @@
+<?php
+
+return array(
+    'db' => array(
+        'driver'   => 'Pdo',
+        'dsn'      => 'mysql:dbname=hello_world;host=localhost;port=3306',
+        'username' => 'benchmarkdbuser',
+        'password' => 'benchmarkdbpass'
+    ),
+);

+ 1 - 0
php-zend-framework/data/cache/.gitignore

@@ -0,0 +1 @@
+*

+ 133 - 0
php-zend-framework/deploy/nginx.conf

@@ -0,0 +1,133 @@
+#user  nobody;
+worker_processes  8;
+
+#error_log  logs/error.log;
+#error_log  logs/error.log  notice;
+#error_log  logs/error.log  info;
+error_log stderr error;
+
+#pid        logs/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       /usr/local/nginx/conf/mime.types;
+    default_type  application/octet-stream;
+
+    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+    #                  '$status $body_bytes_sent "$http_referer" '
+    #                  '"$http_user_agent" "$http_x_forwarded_for"';
+
+    #access_log  logs/access.log  main;
+    access_log off;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    #keepalive_timeout  0;
+    keepalive_timeout  65;
+
+    #gzip  on;
+
+    upstream fastcgi_backend {
+        server 127.0.0.1:9001;
+        keepalive 32;
+    }
+
+    server {
+        listen       8080;
+        server_name  localhost;
+
+        #charset koi8-r;
+
+        #access_log  logs/host.access.log  main;
+
+        #location / {
+        #    root   html;
+        #    index  index.html index.htm;
+        #}
+
+        #error_page  404              /404.html;
+
+        # redirect server error pages to the static page /50x.html
+        #
+        #error_page   500 502 503 504  /50x.html;
+        #location = /50x.html {
+        #    root   html;
+        #}
+
+        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+        #
+        #location ~ \.php$ {
+        #    proxy_pass   http://127.0.0.1;
+        #}
+
+        root /home/tfb/FrameworkBenchmarks/php-zend-framework/public/;
+        index  index.php;
+
+        location / {
+            try_files $uri $uri/ /index.php?$uri&$args;
+        }
+
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+        #
+        location ~ \.php$ {
+            try_files $uri =404;
+            fastcgi_pass   fastcgi_backend;
+            fastcgi_keep_conn on;
+            fastcgi_index  index.php;
+#            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            include        /usr/local/nginx/conf/fastcgi_params;
+        }
+
+        # deny access to .htaccess files, if Apache's document root
+        # concurs with nginx's one
+        #
+        #location ~ /\.ht {
+        #    deny  all;
+        #}
+    }
+
+
+    # another virtual host using mix of IP-, name-, and port-based configuration
+    #
+    #server {
+    #    listen       8000;
+    #    listen       somename:8080;
+    #    server_name  somename  alias  another.alias;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+
+    # HTTPS server
+    #
+    #server {
+    #    listen       443;
+    #    server_name  localhost;
+
+    #    ssl                  on;
+    #    ssl_certificate      cert.pem;
+    #    ssl_certificate_key  cert.key;
+
+    #    ssl_session_timeout  5m;
+
+    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
+    #    ssl_ciphers  HIGH:!aNULL:!MD5;
+    #    ssl_prefer_server_ciphers   on;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+}

+ 9 - 0
php-zend-framework/deploy/php-zend-framework

@@ -0,0 +1,9 @@
+<VirtualHost *:8080>
+  Alias /php-zend-framework/ "/home/ubuntu/FrameworkBenchmarks/php-zend-framework/public/"
+  <Directory /home/ubuntu/FrameworkBenchmarks/php-zend-framework/public/>
+          Options Indexes FollowSymLinks MultiViews
+          #AllowOverride None
+          Order allow,deny
+          allow from all
+  </Directory>
+</VirtualHost>

+ 63 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/DbController.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace FrameworkBenchmarks\Controller;
+
+use Zend\Mvc\Controller\AbstractActionController;
+use Zend\Stdlib\ArrayUtils;
+use Zend\View\Model\JsonModel;
+use Zend\Db\TableGateway\TableGateway;
+
+/**
+ * Controller that produces the json for the DB benchmarks of FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class DbController extends AbstractActionController
+{
+    /**
+     * @var \Zend\Db\TableGateway\TableGateway
+     */
+    protected $tableGateway;
+
+    /**
+     * @param TableGateway $tableGateway
+     */
+    public function __construct(TableGateway $tableGateway)
+    {
+        $this->tableGateway = $tableGateway;
+    }
+
+    /**
+     * @return \Zend\View\Model\JsonModel
+     */
+    public function dbAction()
+    {
+        $result = $this->tableGateway->select(array('id' => mt_rand(1, 10000)));
+
+        foreach ($result as $return) {
+            return new JsonModel($return);
+        }
+
+        return $this->notFoundAction();
+    }
+
+    /**
+     * @return \Zend\View\Model\JsonModel
+     */
+    public function dbMultiAction()
+    {
+        /* @var $request \Zend\Http\Request */
+        $request = $this->getRequest();
+        $queries = $request->getQuery('queries', 1);
+        $worlds  = array();
+
+        for ($i = 0; $i < $queries; $i += 1) {
+            foreach ($this->tableGateway->select(array('id' => mt_rand(1, 10000))) as $found) {
+                $worlds[] = $found;
+            }
+        }
+
+        return new JsonModel($worlds);
+    }
+}

+ 23 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Controller/JsonController.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace FrameworkBenchmarks\Controller;
+
+use Zend\Mvc\Controller\AbstractActionController;
+use Zend\View\Model\JsonModel;
+
+/**
+ * Controller that produces the `hello world` json for the benchmarks of FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class JsonController extends AbstractActionController
+{
+    /**
+     * @return \Zend\View\Model\JsonModel
+     */
+    public function indexAction()
+    {
+        return new JsonModel(array('message' => 'Hello, World!'));
+    }
+}

+ 41 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Entity/World.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace FrameworkBenchmarks\Entity;
+
+use Zend\Stdlib\ArrayObject;
+
+/**
+ * Entity that represents a single entry in the `World` collection of the benchmarks in FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class World extends ArrayObject
+{
+    /**
+     * @var int
+     */
+    public $id;
+
+    /**
+     * @var int
+     */
+    public $randomNumber;
+
+    /**
+     * @param array $data
+     */
+    public function exchangeArray($data)
+    {
+        $this->id           = $data['id'];
+        $this->randomNumber = $data['randomNumber'];
+    }
+
+    /**
+     * @return array
+     */
+    public function toArray()
+    {
+        return array('id' => $this->id, 'randomNumber' => $this->randomNumber);
+    }
+}

+ 78 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/Module.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace FrameworkBenchmarks;
+
+/**
+ * Module class for the benchmarks of FrameworkBenchmarks
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class Module
+{
+    /**
+     * @return array
+     */
+    public function getConfig()
+    {
+        return array(
+            'router' => array(
+                'routes' => array(
+                    'json' => array(
+                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'options' => array(
+                            'route' => '/json',
+                            'defaults' => array(
+                                'controller' => 'FrameworkBenchmarks\Controller\JsonController',
+                                'action' => 'index',
+                            ),
+                        ),
+                    ),
+                    'db' => array(
+                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'options' => array(
+                            'route' => '/db',
+                            'defaults' => array(
+                                'controller' => 'FrameworkBenchmarks\Controller\DbController',
+                                'action' => 'db',
+                            ),
+                        ),
+                    ),
+                    'db-multi' => array(
+                        'type' => 'Zend\Mvc\Router\Http\Literal',
+                        'options' => array(
+                            'route' => '/db-multi',
+                            'defaults' => array(
+                                'controller' => 'FrameworkBenchmarks\Controller\DbController',
+                                'action' => 'db-multi',
+                            ),
+                        ),
+                    ),
+                ),
+            ),
+            'db' => array(
+                'driver' => 'Pdo',
+                'dsn'    => 'mysql:dbname=hello_world;host=localhost',
+            ),
+            'controllers' => array(
+                'invokables' => array(
+                    'FrameworkBenchmarks\Controller\JsonController' => 'FrameworkBenchmarks\Controller\JsonController',
+                ),
+                'factories' => array(
+                    'FrameworkBenchmarks\Controller\DbController'
+                        => 'FrameworkBenchmarks\ServiceFactory\DbControllerServiceFactory'
+                ),
+            ),
+            'service_manager' => array(
+                'factories' => array(
+                    'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
+                ),
+            ),
+            'view_manager' => array(
+                'strategies' => array(
+                    'ViewJsonStrategy',
+                ),
+            ),
+        );
+    }
+}

+ 43 - 0
php-zend-framework/module/FrameworkBenchmarks/src/FrameworkBenchmarks/ServiceFactory/DbControllerServiceFactory.php

@@ -0,0 +1,43 @@
+<?php
+/**
+ * Created by JetBrains PhpStorm.
+ * User: ocramius
+ * Date: 4/28/13
+ * Time: 9:29 PM
+ * To change this template use File | Settings | File Templates.
+ */
+
+namespace FrameworkBenchmarks\ServiceFactory;
+
+use FrameworkBenchmarks\Controller\DbController;
+use FrameworkBenchmarks\Entity\World;
+use Zend\Db\ResultSet\ResultSet;
+use Zend\Db\TableGateway\TableGateway;
+use Zend\ServiceManager\FactoryInterface;
+use Zend\ServiceManager\ServiceLocatorInterface;
+
+/**
+ * Factory responsible for instantiating {@see \FrameworkBenchmarks\Controller\DbController}
+ *
+ * @author Marco Pivetta <[email protected]>
+ * @link   http://www.techempower.com/benchmarks
+ */
+class DbControllerServiceFactory implements FactoryInterface
+{
+    /**
+     * {@inheritDoc}
+     *
+     * @return \FrameworkBenchmarks\Controller\DbController
+     */
+    public function createService(ServiceLocatorInterface $serviceLocator)
+    {
+        /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager */
+        /* @var $dbAdapter \Zend\Db\Adapter\AdapterInterface */
+        $dbAdapter          = $serviceLocator->getServiceLocator()->get('Zend\Db\Adapter\Adapter');
+        $resultSetPrototype = new ResultSet();
+
+        $resultSetPrototype->setArrayObjectPrototype(new World());
+
+        return new DbController(new TableGateway('World', $dbAdapter, null, $resultSetPrototype));
+    }
+}

+ 16 - 0
php-zend-framework/public/.htaccess

@@ -0,0 +1,16 @@
+RewriteEngine On
+# The following rule tells Apache that if the requested filename
+# exists, simply serve it.
+RewriteCond %{REQUEST_FILENAME} -s [OR]
+RewriteCond %{REQUEST_FILENAME} -l [OR]
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteRule ^.*$ - [NC,L]
+# The following rewrites all other queries to index.php. The
+# condition ensures that if you are using Apache aliases to do
+# mass virtual hosting, the base path will be prepended to
+# allow proper resolution of the index.php file; it will work
+# in non-aliased environments as well, providing a safe, one-size
+# fits all solution.
+RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
+RewriteRule ^(.*) - [E=BASE:%1]
+RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

+ 6 - 0
php-zend-framework/public/index.php

@@ -0,0 +1,6 @@
+<?php
+chdir(dirname(__DIR__));
+
+require __DIR__ . '/../vendor/autoload.php';
+
+Zend\Mvc\Application::init(require 'config/application.config.php')->run();

+ 27 - 0
php-zend-framework/setup.py

@@ -0,0 +1,27 @@
+import subprocess
+import sys
+import setup_util
+from os.path import expanduser
+
+home = expanduser("~")
+
+def start(args, logfile, errfile):
+  setup_util.replace_text("php-zend-framework/config/autoload/benchmarks.local.php", "host=localhost", "host=" + args.database_host)
+  setup_util.replace_text("php-zend-framework/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
+
+  try:
+    subprocess.check_call("composer.phar install --optimize-autoloader", shell=True, cwd="php-zend-framework", stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo chown -R www-data:www-data php-zend-framework", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/php-fpm.pid", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-zend-framework/deploy/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
+    return 0
+  except subprocess.CalledProcessError:
+    return 1
+def stop(logfile, errfile):
+  try:
+    subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.call("sudo kill -QUIT $( cat php-zend-framework/deploy/php-fpm.pid )", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo chown -R $USER:$USER php-zend-framework", shell=True, stderr=errfile, stdout=logfile)
+    return 0
+  except subprocess.CalledProcessError:
+    return 1

+ 2 - 1
ringojs-convenient/app/models.js

@@ -6,8 +6,9 @@ var dbHost = '172.16.98.98';
 
 
 // create and configure store
 // create and configure store
 var connectionPool = module.singleton("connectionPool", function() {
 var connectionPool = module.singleton("connectionPool", function() {
+    var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
     return new ConnectionPool({
     return new ConnectionPool({
-        "url": "jdbc:mysql://" + dbHost + "/hello_world",
+        "url": "jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties,
         "driver": "com.mysql.jdbc.Driver",
         "driver": "com.mysql.jdbc.Driver",
         "username": "benchmarkdbuser",
         "username": "benchmarkdbuser",
         "password": "benchmarkdbpass"
         "password": "benchmarkdbpass"

+ 1 - 8
ringojs-convenient/app/views.js

@@ -23,7 +23,6 @@ app.get('/db/:queries?', function(request, queries) {
    for (var i = 0; i < queries; i++) {
    for (var i = 0; i < queries; i++) {
       randId = ((Math.random() * 10000) | 0) + 1;
       randId = ((Math.random() * 10000) | 0) + 1;
       world = models.store.query('select World.* from World where World.id = :id', {id: randId})[0];
       world = models.store.query('select World.* from World where World.id = :id', {id: randId})[0];
-      //worlds.push(world.toJSON());
       worlds.push({"id": world._id, "randomNumber" : world.randomNumber});
       worlds.push({"id": world._id, "randomNumber" : world.randomNumber});
    }
    }
    if (queries == 1) {
    if (queries == 1) {
@@ -43,13 +42,7 @@ app.get('/fortune', function() {
 });
 });
 
 
 app.get('/plaintext', function() {
 app.get('/plaintext', function() {
-   // @@ not available in ringojs 0.9
-   // return response.text('Hello World');
-   return {
-     status: 200,
-     headers: {"Content-Type": 'text/plain'},
-     body: ['Hello, World!']
-   };
+   return response.text('Hello, World!');
 });
 });
 
 
 app.get('/updates/:queries?', function(request, queries) {
 app.get('/updates/:queries?', function(request, queries) {

+ 1 - 1
ringojs-convenient/setup.py

@@ -17,7 +17,7 @@ def start(args, logfile, errfile):
 
 
     subprocess.check_call("sudo mkdir -p /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo mkdir -p /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo cp /usr/share/ringojs//packages/sql-ringojs-client/jars/mysql.jar /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo cp /usr/share/ringojs//packages/sql-ringojs-client/jars/mysql.jar /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("ringo --production -Dserver -DXmx=512m -DXms=512m ringo-main.js", shell=True, cwd="ringojs-convenient", stderr=errfile, stdout=logfile)
+    subprocess.Popen("ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js", shell=True, cwd="ringojs-convenient", stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1

+ 2 - 1
ringojs/ringo-main.js

@@ -120,7 +120,8 @@ exports.app = function(req) {
 
 
 
 
 var datasource = module.singleton('pooling-datasource', function() {
 var datasource = module.singleton('pooling-datasource', function() {
-  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world", 'benchmarkdbuser', 'benchmarkdbpass');
+  var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
+  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties, 'benchmarkdbuser', 'benchmarkdbpass');
 });
 });
 
 
 if (require.main == module) {
 if (require.main == module) {

+ 1 - 1
ringojs/setup.py

@@ -10,7 +10,7 @@ def start(args, logfile, errfile):
   try:
   try:
     subprocess.check_call("sudo rm -rf /usr/share/ringojs/packages/*", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo rm -rf /usr/share/ringojs/packages/*", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo ringo-admin install oberhamsi/sql-ringojs-client", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo ringo-admin install oberhamsi/sql-ringojs-client", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("ringo --production -Dserver -DXmx=512m -DXms=512m ringo-main.js", shell=True, cwd="ringojs", stderr=errfile, stdout=logfile)
+    subprocess.Popen("ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js", shell=True, cwd="ringojs", stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1

BIN
sbt/sbt-launch.jar


Some files were not shown because too many files changed in this diff