Browse Source

Merge branch 'master' into python-web2py

Keith Newman 10 years ago
parent
commit
959d5e5b2a
100 changed files with 513 additions and 505 deletions
  1. 17 1
      .mailmap
  2. 0 1
      .travis.yml
  3. 2 0
      README.md
  4. 10 1
      deployment/vagrant-common/bootstrap.sh
  5. 13 2
      deployment/vagrant-common/core.rb
  6. 0 16
      frameworks/C++/ULib/bash_profile.sh
  7. 4 0
      frameworks/C++/ULib/setup.sh
  8. 4 0
      frameworks/C++/ULib/setup_mysql.sh
  9. 4 0
      frameworks/C++/ULib/setup_sqlite.sh
  10. 0 3
      frameworks/C++/cpoll_cppsp/bash_profile.sh
  11. 1 0
      frameworks/C++/cpoll_cppsp/setup.sh
  12. 0 11
      frameworks/C++/wt/bash_profile.sh
  13. 10 0
      frameworks/C++/wt/install.sh
  14. 7 0
      frameworks/C++/wt/setup.sh
  15. 8 0
      frameworks/C++/wt/setup_postgres.sh
  16. 0 3
      frameworks/C/duda/bash_profile.sh
  17. 1 0
      frameworks/C/duda/setup.sh
  18. 2 2
      frameworks/CSharp/aspnet/.gitignore
  19. 7 28
      frameworks/CSharp/aspnet/README.md
  20. 0 8
      frameworks/CSharp/aspnet/bash_profile.sh
  21. BIN
      frameworks/CSharp/aspnet/lib/.nuget/NuGet.exe
  22. 0 135
      frameworks/CSharp/aspnet/lib/.nuget/NuGet.targets
  23. 17 1
      frameworks/CSharp/aspnet/nginx.conf
  24. 0 45
      frameworks/CSharp/aspnet/setup_nginx.py
  25. 23 16
      frameworks/CSharp/aspnet/setup_nginx.sh
  26. 0 34
      frameworks/CSharp/aspnet/setup_xsp.py
  27. 56 0
      frameworks/CSharp/aspnet/src/Benchmarks.build.proj
  28. 24 28
      frameworks/CSharp/aspnet/src/Benchmarks.csproj
  29. 1 1
      frameworks/CSharp/aspnet/src/Benchmarks.sln
  30. 1 1
      frameworks/CSharp/aspnet/src/Models/MongoDB.cs
  31. 0 1
      frameworks/CSharp/aspnet/src/Views/Fortunes.cshtml
  32. 4 4
      frameworks/CSharp/aspnet/src/Views/Web.config
  33. 4 4
      frameworks/CSharp/aspnet/src/Web.config
  34. 15 0
      frameworks/CSharp/aspnet/src/packages.config
  35. 0 5
      frameworks/Clojure/compojure/bash_profile.sh
  36. 3 0
      frameworks/Clojure/compojure/setup.sh
  37. 0 5
      frameworks/Clojure/http-kit/bash_profile.sh
  38. 2 0
      frameworks/Clojure/http-kit/setup.sh
  39. 0 2
      frameworks/Clojure/luminus/bash_profile.sh
  40. 2 0
      frameworks/Clojure/luminus/setup.sh
  41. 0 5
      frameworks/Dart/dart-redstone/bash_profile.sh
  42. 2 0
      frameworks/Dart/dart-redstone/setup.sh
  43. 0 7
      frameworks/Dart/dart-start/bash_profile.sh
  44. 3 0
      frameworks/Dart/dart-start/setup.sh
  45. 0 7
      frameworks/Dart/dart-stream/bash_profile.sh
  46. 3 0
      frameworks/Dart/dart-stream/setup.sh
  47. 0 5
      frameworks/Dart/dart/bash_profile.sh
  48. 20 15
      frameworks/Dart/dart/server.dart
  49. 5 1
      frameworks/Dart/dart/setup.sh
  50. 0 3
      frameworks/Erlang/cowboy/bash_profile.sh
  51. 1 0
      frameworks/Erlang/cowboy/setup_erlang.sh
  52. 0 3
      frameworks/Erlang/elli/bash_profile.sh
  53. 1 0
      frameworks/Erlang/elli/setup_erlang.sh
  54. 0 6
      frameworks/Go/beego/bash_profile.sh
  55. 3 0
      frameworks/Go/beego/setup.sh
  56. 0 6
      frameworks/Go/falcore/bash_profile.sh
  57. 3 0
      frameworks/Go/falcore/setup.sh
  58. 0 6
      frameworks/Go/gin/bash_profile.sh
  59. 3 0
      frameworks/Go/gin/setup.sh
  60. 0 4
      frameworks/Go/go/bash_profile.sh
  61. 23 0
      frameworks/Go/go/benchmark_config
  62. 3 0
      frameworks/Go/go/setup.sh
  63. 10 0
      frameworks/Go/go/setup_prefork.sh
  64. 66 2
      frameworks/Go/go/src/hello/hello.go
  65. 0 6
      frameworks/Go/revel-jet/bash_profile.sh
  66. 3 0
      frameworks/Go/revel-jet/setup.sh
  67. 0 4
      frameworks/Go/revel-qbs/bash_profile.sh
  68. 3 0
      frameworks/Go/revel-qbs/setup.sh
  69. 0 4
      frameworks/Go/revel/bash_profile.sh
  70. 3 0
      frameworks/Go/revel/setup.sh
  71. 0 6
      frameworks/Go/webgo/bash_profile.sh
  72. 3 0
      frameworks/Go/webgo/setup.sh
  73. 3 3
      frameworks/Groovy/grails/setup.sh
  74. 0 5
      frameworks/Haskell/snap/bash_profile.sh
  75. 3 0
      frameworks/Haskell/snap/setup.sh
  76. 0 5
      frameworks/Haskell/wai/bash_profile.sh
  77. 3 0
      frameworks/Haskell/wai/setup.sh
  78. 1 1
      frameworks/Java/README.md
  79. 0 2
      frameworks/Java/activeweb/bash_profile.sh
  80. 2 0
      frameworks/Java/activeweb/setup.sh
  81. 0 2
      frameworks/Java/gemini/bash_profile.sh
  82. 3 0
      frameworks/Java/gemini/setup.sh
  83. 1 0
      frameworks/Java/grizzly-jersey/source_code
  84. 20 0
      frameworks/Java/grizzly-jersey/src/main/java/hello/Common.java
  85. 38 6
      frameworks/Java/grizzly-jersey/src/main/java/hello/DbResource.java
  86. 3 3
      frameworks/Java/grizzly-jersey/src/main/resources/hibernate.cfg.xml
  87. 0 3
      frameworks/Java/play1/bash_profile.sh
  88. 1 0
      frameworks/Java/play1/setup.sh
  89. 0 4
      frameworks/Java/play1siena/bash_profile.sh
  90. 2 0
      frameworks/Java/play1siena/setup.sh
  91. 0 1
      frameworks/Java/play2-java/bash_profile.sh
  92. 0 1
      frameworks/Java/servlet/bash_profile.sh
  93. 1 0
      frameworks/Java/servlet/setup.sh
  94. 0 3
      frameworks/Java/servlet3-cass/bash_profile.sh
  95. 2 2
      frameworks/Java/servlet3-cass/setup.sh
  96. 0 2
      frameworks/Java/spark/bash_profile.sh
  97. 2 0
      frameworks/Java/spark/setup.sh
  98. 0 2
      frameworks/Java/tapestry/bash_profile.sh
  99. 2 0
      frameworks/Java/tapestry/setup.sh
  100. 26 12
      frameworks/Java/undertow/src/main/java/hello/DbSqlHandler.java

+ 17 - 1
.mailmap

@@ -3,17 +3,27 @@ Adam Chlipala <[email protected]> <[email protected]>
 Alex Schneider <[email protected]> <aschneider@techempower> Alexander Schneider
 Alex Schneider <[email protected]> Alexander Schneider <[email protected]>
 
+Aoyama Kazuharu <[email protected]> AOYAMA Kazuharu <[email protected]> 
+Aoyama Kazuharu <[email protected]> AOYAMA Kazuharu <[email protected]>
+
+Brian Clozel <[email protected]> Brian Clozel <[email protected]> 
+
 Christian Knuth <[email protected]> <[email protected]>
 
 Donovan Muller <[email protected]> donovanmuller <[email protected]>
 
 Eduardo Silva <[email protected]> <[email protected]>
 
+Finn Bock <[email protected]> bckfnn <[email protected]>
+
 Gerard Roche <[email protected]> <[email protected]>
 
 Gjero Krsteski <[email protected]> gjerokrsteski <[email protected]> 
 Gjero Krsteski <[email protected]> g.krsteski <[email protected]>
 
+Haley Young <[email protected]> haleyyoung <[email protected]>
+Haley Young <[email protected]> haleyyoung <[email protected]>
+
 INADA Naoki <[email protected]> <[email protected]> 
 INADA Naoki <[email protected]> <[email protected]>
 
@@ -23,7 +33,8 @@ Juan José Aguililla <[email protected]> jamming <juanjoaguililla@gmail.
 
 Karol Buček <[email protected]> kares <[email protected]> 
 
-Lari Hotari <[email protected]> <[email protected]>
+Lari Hotari <[email protected]> Lari Hotari <[email protected]>
+Lari Hotari <[email protected]> Lari Hotari <[email protected]>
 
 Leandro Pereira <[email protected]> <[email protected]>
 
@@ -41,6 +52,7 @@ mcocciaTE <[email protected]> mcoccia <[email protected]>
 
 Mike Smith <[email protected]> Mike Smith <[email protected]>
 Mike Smith <[email protected]> msmith-techempower <[email protected]>
+Mike Smith <[email protected]> msmith <[email protected]>
 
 Raphael Andre Bauer <[email protected]> reyez <[email protected]>
 
@@ -50,6 +62,10 @@ Stefan Geneshky <[email protected]> Stefan G <[email protected]>
 
 Stefano Casazza <[email protected]> stefanocasazza <[email protected]>
 Stefano Casazza <[email protected]> stefanocasazza <[email protected]>
+Stefano Casazza <[email protected]> stefano casazza <[email protected]>
+
+Shengjun Yu <[email protected]> shengjun yu <[email protected]>
+Shengjun Yu <[email protected]> yushengjun <[email protected]>
 
 Skamander <[email protected]> sksamuel <[email protected]>
 

+ 0 - 1
.travis.yml

@@ -166,4 +166,3 @@ install:
 script: 
   # Pick one test in this directory and verify
   - time ./toolset/run-ci.py verify "$TESTDIR"
-  

+ 2 - 0
README.md

@@ -1,6 +1,8 @@
 # Welcome to [TechEmpower Framework Benchmarks (TFB)](http://www.techempower.com/benchmarks/) 
 [![Build Status](https://travis-ci.org/TechEmpower/FrameworkBenchmarks.svg?branch=master)](https://travis-ci.org/TechEmpower/FrameworkBenchmarks) 
 [![Documentation Status](https://readthedocs.org/projects/frameworkbenchmarks/badge/?version=latest)](https://readthedocs.org/projects/frameworkbenchmarks/?badge=latest)
+[![Issue Stats](http://www.issuestats.com/github/TechEmpower/FrameworkBenchmarks/badge/issue?style=flat)](http://www.issuestats.com/github/TechEmpower/FrameworkBenchmarks)
+[![Issue Stats](http://www.issuestats.com/github/TechEmpower/FrameworkBenchmarks/badge/pr?style=flat)](http://www.issuestats.com/github/TechEmpower/FrameworkBenchmarks)
 
 This project provides representative performance measures across a wide field of web 
 application frameworks. With much help from the community, coverage is quite broad and 

+ 10 - 1
deployment/vagrant-common/bootstrap.sh

@@ -106,8 +106,17 @@ if [ ! -e "~/.firstboot" ]; then
   # If they didn't sync, we need to clone it
   if [ -d "/FrameworkBenchmarks" ]; then
     ln -s /FrameworkBenchmarks $FWROOT
-    echo "Removing installs/ and results/ folders so they do not interfere"
+    echo "Removing your current results folder to avoid interference"
     rm -rf $FWROOT/installs $FWROOT/results
+
+    # vboxfs does not support chown or chmod, which we need. 
+    # We therefore bind-mount a normal linux directory so we can
+    # use these operations. This enables us to 
+    # use `chown -R testrunner:testrunner $FWROOT/installs` later
+    echo "Mounting over your installs folder"
+    mkdir -p /tmp/TFB_installs
+    mkdir -p /FrameworkBenchmarks/installs
+    sudo mount -o bind /tmp/TFB_installs $FWROOT/installs
   else
     # If there is no synced folder, clone the project
     echo "Cloning project from $GH_REPO $GH_BRANCH"

+ 13 - 2
deployment/vagrant-common/core.rb

@@ -98,8 +98,19 @@ def provider_virtualbox(config, role, ip_address='172.16.0.16')
     vb.memory = ENV.fetch('TFB_VB_MEM', 3022)
     vb.cpus = ENV.fetch('TFB_VB_CPU', 2)
 
-    # mount_options addresses issue mitchellh/vagrant#4997
-    override.vm.synced_folder "../..", "/FrameworkBenchmarks", mount_options: ['fmode=777', 'dmode=777']
+    # The VirtualBox file system for shared folders (vboxfs)
+    # does not support posix's chown/chmod - these can only 
+    # be set at mount time, and they are uniform for the entire
+    # shared directory. We require chown, because we have the 
+    # testrunner user account, so this is a problem. To mitigate
+    # the effects, we set the folders and files to 777 permissions. 
+    # Even though we cannot chown them to testrunner, with 777 and 
+    # owner vagrant *most* of the software works ok. Occasional 
+    # issues are still possible. 
+    #
+    # See mitchellh/vagrant#4997
+    # See http://superuser.com/a/640028/136050
+    override.vm.synced_folder "../..", "/FrameworkBenchmarks", :mount_options => ["dmode=777", "fmode=777"]
 
     if role.eql? "all" or role.eql? "app"
       override.vm.network :forwarded_port, guest: 8080, host: 28080

+ 0 - 16
frameworks/C++/ULib/bash_profile.sh

@@ -1,16 +0,0 @@
-#---------------------------------------------------------------------------------------------------------
-# bash_profile.sh - set the environment of our ULib installation
-#---------------------------------------------------------------------------------------------------------
-# TROOT - Path of this test's directory
-# IROOT - Path of this test's install directory ($FWROOT/installs or $FWROOT/installs/pertest/<test-name>)
-#---------------------------------------------------------------------------------------------------------
-# INFO:root:Running installation for ULib
-# INSTALL: 
-#    export TROOT=$FWROOT/ULib && 
-#    export IROOT=$FWROOT/installs && 
-#    . $FWROOT/toolset/setup/linux/bash_functions.sh && 
-#    . $FWROOT/ULib/install.sh (cwd=$FWROOT//installs)
-#---------------------------------------------------------------------------------------------------------
-export ULIB_VERSION=1.4.2
-export ULIB_ROOT=$IROOT/ULib
-export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT

+ 4 - 0
frameworks/C++/ULib/setup.sh

@@ -1,5 +1,9 @@
 #!/bin/bash
 
+export ULIB_VERSION=1.4.2
+export ULIB_ROOT=$IROOT/ULib
+export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
+
 export UMEMPOOL="136,0,0,85,1160,155,-17,-22,40"
 
 # 1. Change ULib Server configuration

+ 4 - 0
frameworks/C++/ULib/setup_mysql.sh

@@ -1,5 +1,9 @@
 #!/bin/bash
 
+export ULIB_VERSION=1.4.2
+export ULIB_ROOT=$IROOT/ULib
+export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
+
 export ORM_DRIVER="mysql"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
 

+ 4 - 0
frameworks/C++/ULib/setup_sqlite.sh

@@ -1,5 +1,9 @@
 #!/bin/bash
 
+export ULIB_VERSION=1.4.2
+export ULIB_ROOT=$IROOT/ULib
+export ULIB_DOCUMENT_ROOT=${ULIB_ROOT}/ULIB_DOCUMENT_ROOT
+
 export ORM_DRIVER="sqlite"
 export ORM_OPTION="host=${DBHOST} user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=${ULIB_ROOT}/db/%.*s"
 

+ 0 - 3
frameworks/C++/cpoll_cppsp/bash_profile.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-export CPPSP_HOME=$IROOT/cppsp_0.2.3

+ 1 - 0
frameworks/C++/cpoll_cppsp/setup.sh

@@ -1,4 +1,5 @@
 #!/bin/bash
+export CPPSP_HOME=$IROOT/cppsp_0.2.3
 
 sed -i 's|#define BENCHMARK_DB_HOST ".*"|#define BENCHMARK_DB_HOST "'"$DBHOST"'"|g' www/connectioninfo.H
 

+ 0 - 11
frameworks/C++/wt/bash_profile.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-export BOOST_ROOT=/usr/local
-export BOOST_INC=${BOOST_ROOT}/include
-export BOOST_LIB=${BOOST_ROOT}/lib
-
-export WT_ROOT=${IROOT}/wt
-export WT_LIB=${WT_ROOT}/lib
-export WT_INC=${WT_ROOT}/include
-
-export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"

+ 10 - 0
frameworks/C++/wt/install.sh

@@ -1,3 +1,13 @@
 #!/bin/bash
 
+export BOOST_ROOT=/usr/local
+export BOOST_INC=${BOOST_ROOT}/include
+export BOOST_LIB=${BOOST_ROOT}/lib
+
+export WT_ROOT=${IROOT}/wt
+export WT_LIB=${WT_ROOT}/lib
+export WT_INC=${WT_ROOT}/include
+
+export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
+
 fw_depends apache wt

+ 7 - 0
frameworks/C++/wt/setup.sh

@@ -1,4 +1,11 @@
 #!/bin/bash
+export BOOST_ROOT=/usr/local
+export BOOST_INC=${BOOST_ROOT}/include
+export BOOST_LIB=${BOOST_ROOT}/lib
+
+export WT_ROOT=${IROOT}/wt
+export WT_LIB=${WT_ROOT}/lib
+export WT_INC=${WT_ROOT}/include
 
 # This has to be included here since it is one of the vars NOT copied from the original environment
 export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"

+ 8 - 0
frameworks/C++/wt/setup_postgres.sh

@@ -1,7 +1,15 @@
 #!/bin/bash
+export BOOST_ROOT=/usr/local
+export BOOST_INC=${BOOST_ROOT}/include
+export BOOST_LIB=${BOOST_ROOT}/lib
+
+export WT_ROOT=${IROOT}/wt
+export WT_LIB=${WT_ROOT}/lib
+export WT_INC=${WT_ROOT}/include
 
 # This has to be included here since it is one of the vars NOT copied from the original environment
 export LD_LIBRARY_PATH="${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}"
+export CPLUS_INCLUDE_PATH=/usr/include/postgresql:/usr/include/postgresql/9.3/server:$CPLUS_INCLUDE_PATH
 
 sed -i 's|INSERT_DB_HOST_HERE|'"${DBHOST}"'|g' benchmark.cpp
 

+ 0 - 3
frameworks/C/duda/bash_profile.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-export DUDA_HOME=${IROOT}/dudac-0.23

+ 1 - 0
frameworks/C/duda/setup.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
 
+export DUDA_HOME=${IROOT}/dudac-0.23
 export PATH=${DUDA_HOME}:$PATH
 
 dudac -w $TROOT/webservice -p 2001 &

+ 2 - 2
frameworks/CSharp/aspnet/.gitignore

@@ -2,5 +2,5 @@
 *.suo
 */bin/*
 */obj/*
-lib/*
-!lib/.nuget
+*/packages/*
+nginx.upstream.conf

+ 7 - 28
frameworks/CSharp/aspnet/README.md

@@ -18,7 +18,7 @@
 **Platforms**
 
 * .NET Framework 4.5 (Windows)
-* Mono 3.2.8 (Linux)
+* Mono 3.99.0 (Linux)
 
 **Web Servers**
 
@@ -29,37 +29,16 @@
 **Web Stack**
 
 * ASP.NET 4.5
-* ASP.NET MVC Framework 5.1.0
+* ASP.NET MVC Framework 5.2.2
+* ASP.NET Razor 3.2.2
 
 **Databases**
 
-* MySQL Connector/Net 6.8.3
-* Npgsql 2.0.14.3
-* Entity Framework 6.0.2
-* Mongo C# Driver 1.8.3
+* MySQL Connector/Net 6.9.5
+* Npgsql 2.2.3
+* Entity Framework 6.1.1
+* Mongo C# Driver 1.9.2
 
 **Developer Tools**
 
 * Visual Studio 2012
-
-## Mono Installation
-
-    sudo apt-get install git-core build-essential autoconf automake libtool zlib1g-dev pkg-config gettext
-
-    git clone git://github.com/mono/mono
-    cd mono
-    git checkout mono-3.2.8
-    ./autogen.sh --prefix=/usr/local
-    make get-monolite-latest
-    make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
-    sudo make install
-
-    cd ..
-
-    git clone git://github.com/mono/xsp
-    cd xsp
-    ./autogen.sh --prefix=/usr/local
-    make
-    sudo make install
-    
-    mozroots --import --sync

+ 0 - 8
frameworks/CSharp/aspnet/bash_profile.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-
-export MONO_ROOT=${IROOT}/mono-3.6.0-install
-
-# Needed to find Mono's shared libraries
-export LD_LIBRARY_PATH="$MONO_ROOT/lib"
-
-export NGINX_HOME=${IROOT}/nginx

BIN
frameworks/CSharp/aspnet/lib/.nuget/NuGet.exe


+ 0 - 135
frameworks/CSharp/aspnet/lib/.nuget/NuGet.targets

@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-    <PropertyGroup>
-        <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
-        
-        <!-- Enable the restore command to run before builds -->
-        <RestorePackages Condition="  '$(RestorePackages)' == '' ">false</RestorePackages>
-
-        <!-- Property that enables building a package from a project -->
-        <BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
-
-        <!-- Determines if package restore consent is required to restore packages -->
-        <RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">false</RequireRestoreConsent>
-        
-        <!-- Download NuGet.exe if it does not already exist -->
-        <DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
-    </PropertyGroup>
-    
-    <ItemGroup Condition=" '$(PackageSources)' == '' ">
-        <!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
-        <!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
-        <!--
-            <PackageSource Include="https://nuget.org/api/v2/" />
-            <PackageSource Include="https://my-nuget-source/nuget/" />
-        -->
-    </ItemGroup>
-
-    <PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
-        <!-- Windows specific commands -->
-        <NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), "..", "lib", ".nuget"))</NuGetToolsPath>
-        <PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "..", "lib", "packages.config"))</PackagesConfig>
-        <RepositoryPath>$([System.IO.Path]::Combine($(SolutionDir), "..", "lib"))</RepositoryPath>
-    </PropertyGroup>
-    
-    <PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
-        <!-- We need to launch nuget.exe with the mono command if we're not on windows -->
-        <NuGetToolsPath>$(SolutionDir)..\lib\.nuget</NuGetToolsPath>
-        <PackagesConfig>$(SolutionDir)..\lib\packages.config</PackagesConfig>
-        <RepositoryPath>$(SolutionDir)..\lib</RepositoryPath>
-    </PropertyGroup>
-    
-    <PropertyGroup>
-        <!-- NuGet command -->
-        <NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
-        <PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
-        
-        <NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
-        <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono $(NuGetExePath)</NuGetCommand>
-
-        <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
-        
-        <RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
-        <NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
-        
-        <!-- Commands -->
-        <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)"  $(NonInteractiveSwitch) $(RequireConsentSwitch) -OutputDirectory "$(RepositoryPath)"</RestoreCommand>
-        <BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
-
-        <!-- We need to ensure packages are restored prior to assembly resolve -->
-        <BuildDependsOn Condition="$(RestorePackages) == 'true'">
-            RestorePackages;
-            $(BuildDependsOn);
-        </BuildDependsOn>
-
-        <!-- Make the build depend on restore packages -->
-        <BuildDependsOn Condition="$(BuildPackage) == 'true'">
-            $(BuildDependsOn);
-            BuildPackage;
-        </BuildDependsOn>
-    </PropertyGroup>
-
-    <Target Name="CheckPrerequisites">
-        <!-- Raise an error if we're unable to locate nuget.exe  -->
-        <Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
-        <!--
-        Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
-        This effectively acts as a lock that makes sure that the download operation will only happen once and all
-        parallel builds will have to wait for it to complete.
-        -->
-        <MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
-    </Target>
-
-    <Target Name="_DownloadNuGet">
-        <DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
-    </Target>
-
-    <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
-        <Exec Command="$(RestoreCommand)"
-              Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
-              
-        <Exec Command="$(RestoreCommand)"
-              LogStandardErrorAsError="true"
-              Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
-    </Target>
-
-    <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
-        <Exec Command="$(BuildCommand)" 
-              Condition=" '$(OS)' != 'Windows_NT' " />
-              
-        <Exec Command="$(BuildCommand)"
-              LogStandardErrorAsError="true"
-              Condition=" '$(OS)' == 'Windows_NT' " />
-    </Target>
-    
-    <UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
-        <ParameterGroup>
-            <OutputFilename ParameterType="System.String" Required="true" />
-        </ParameterGroup>
-        <Task>
-            <Reference Include="System.Core" />
-            <Using Namespace="System" />
-            <Using Namespace="System.IO" />
-            <Using Namespace="System.Net" />
-            <Using Namespace="Microsoft.Build.Framework" />
-            <Using Namespace="Microsoft.Build.Utilities" />
-            <Code Type="Fragment" Language="cs">
-                <![CDATA[
-                try {
-                    OutputFilename = Path.GetFullPath(OutputFilename);
-
-                    Log.LogMessage("Downloading latest version of NuGet.exe...");
-                    WebClient webClient = new WebClient();
-                    webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
-
-                    return true;
-                }
-                catch (Exception ex) {
-                    Log.LogErrorFromException(ex);
-                    return false;
-                }
-            ]]>
-            </Code>
-        </Task>
-    </UsingTask>
-</Project>

+ 17 - 1
frameworks/CSharp/aspnet/nginx.conf

@@ -19,7 +19,23 @@ http {
 
         location / {
             fastcgi_pass mono;
-            include /usr/local/nginx/conf/fastcgi_params;
+            fastcgi_param  QUERY_STRING       $query_string;
+            fastcgi_param  REQUEST_METHOD     $request_method;
+            fastcgi_param  CONTENT_TYPE       $content_type;
+            fastcgi_param  CONTENT_LENGTH     $content_length;
+            fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
+            fastcgi_param  REQUEST_URI        $request_uri;
+            fastcgi_param  DOCUMENT_URI       $document_uri;
+            fastcgi_param  DOCUMENT_ROOT      $document_root;
+            fastcgi_param  SERVER_PROTOCOL    $server_protocol;
+            fastcgi_param  HTTPS              $https if_not_empty;
+            fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
+            fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
+            fastcgi_param  REMOTE_ADDR        $remote_addr;
+            fastcgi_param  REMOTE_PORT        $remote_port;
+            fastcgi_param  SERVER_ADDR        $server_addr;
+            fastcgi_param  SERVER_PORT        $server_port;
+            fastcgi_param  SERVER_NAME        $server_name;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
         }
     }

+ 0 - 45
frameworks/CSharp/aspnet/setup_nginx.py

@@ -1,45 +0,0 @@
-import subprocess
-import sys
-import setup_util
-import os
-
-def start(args, logfile, errfile):
-  if os.name == 'nt':
-    return 1
-  
-  setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host)
-
-  # build
-  subprocess.check_call("rm -rf bin obj", shell=True, cwd="aspnet", stderr=errfile, stdout=logfile)
-  subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-  subprocess.check_call("sudo chown -R $USER:$USER $MONO_ROOT", shell=True, stderr=errfile, stdout=logfile)
-  
-  # nginx
-  workers = 'worker_processes ' + str(args.max_threads) + ';'
-  logfile.write("Setting up workers as %s\n\n" % workers)
-  subprocess.check_call("echo Hello there", shell=True, stderr=errfile, stdout=logfile);
-  command = 'echo "upstream mono {\n' + ';\n'.join('\tserver 127.0.0.1:' + str(port) for port in range(9001, 9001 + args.max_threads)) + ';\n}" > $TROOT/nginx.upstream.conf'
-  logfile.write("Using command %s" % command)
-  subprocess.check_call(command, shell=True, stderr=errfile, stdout=logfile);
-  subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf -g "' + workers + '"', shell=True, stderr=errfile, stdout=logfile)
-  
-  # Start fastcgi for each thread
-  # To debug, use --printlog --verbose --loglevels=All
-  for port in range(9001, 9001 + args.max_threads):
-    subprocess.Popen("MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:%s/src --socket=tcp:127.0.0.1:%s " % (args.directory, port), shell=True, cwd="aspnet", stderr=errfile, stdout=logfile)
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    return 0
-  
-  subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf -s stop", shell=True, stderr=errfile, stdout=logfile)
-  subprocess.check_call("rm -f $TROOT/nginx.upstream.conf", shell=True, stderr=errfile, stdout=logfile)
-  #
-  # stop mono
-  #
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'mono-server' in line and not 'run-ci' in line and not 'run-tests' in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)

+ 23 - 16
frameworks/CSharp/aspnet/setup_nginx.sh

@@ -1,30 +1,37 @@
 #!/bin/bash
 
+set -e
+
+# mono environment variables
+. ${IROOT}/mono.installed
+
+export NGINX_HOME=${IROOT}/nginx
+
 sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config
 
-# build
-rm -rf bin obj
-cd src
-$MONO_ROOT/bin/xbuild /p:Configuration=Release
+# extra cleaning
+rm -rf src/bin src/obj
+rm -rf /tmp/nuget
+
+xbuild src/Benchmarks.build.proj /t:Clean
+xbuild src/Benchmarks.build.proj /t:Build
+
+# one fastcgi instance for each thread
+# load balanced by nginx
+port_start=9001
+port_end=$(($port_start+$MAX_THREADS))
 
 # nginx
 conf="upstream mono {\n"
-current=9001
-end=$(($current+$MAX_THREADS))
-while [ $current -lt $end ]; do
-  conf+="\tserver 127.0.0.1:${current};\n"
-  let current=current+1
+for port in $(seq $port_start $port_end); do
+  conf+="\tserver 127.0.0.1:${port};\n"
 done
 conf+="}"
 echo -e $conf > $TROOT/nginx.upstream.conf
 
-$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "${MAX_THREADS}"
+$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes ${MAX_THREADS};"
 
-# Start fastcgi for each thread
 # To debug, use --printlog --verbose --loglevels=All
-current=9001
-end=$(($current+$MAX_THREADS))
-while [ $current -lt $end ]; do
-  MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:$(pwd)/src --socket=tcp:127.0.0.1:$current
-  let current=current+1
+for port in $(seq $port_start $port_end); do
+  fastcgi-mono-server4 --applications=/:${TROOT}/src --socket=tcp:127.0.0.1:$port &
 done

+ 0 - 34
frameworks/CSharp/aspnet/setup_xsp.py

@@ -1,34 +0,0 @@
-import subprocess
-import sys
-import setup_util
-import os
-
-def start(args, logfile, errfile):
-  if os.name == 'nt':
-    return 1
-  
-  setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host)
-
-  try:
-    subprocess.check_call("rm -rf bin obj", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-    subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-    subprocess.check_call("sudo chown -R ubuntu:ubuntu /usr/local/etc/mono", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("MONO_OPTIONS=--gc=sgen xsp4 --nonstop", shell=True, cwd="aspnet/src", stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    return 0
-  
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'xsp4' in line:
-      pid = int(line.split(None, 2)[1])
-      try:
-        os.kill(pid, 15)
-      except OSError:
-        pass
-  return 0

+ 56 - 0
frameworks/CSharp/aspnet/src/Benchmarks.build.proj

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
+    <Configuration Condition=" '$(Configuration)'=='' ">Release</Configuration>
+    <NuGetExe Condition=" '$(NuGetExe)'=='' ">packages/nuget.exe</NuGetExe>
+    <NuGetExeDir>packages/</NuGetExeDir>
+    <NuGetDownloadAddress Condition=" '$(NuGetDownloadAddress)'=='' ">http://nuget.org/nuget.exe</NuGetDownloadAddress>
+    <NuGetCommand Condition=" '$(NuGetCommand)'=='' AND '$(OS)' == 'Windows_NT'">"$(NuGetExe)"</NuGetCommand>
+    <NuGetCommand Condition=" '$(NuGetCommand)'=='' AND '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExe)"</NuGetCommand>
+    <Properties>Configuration=$(Configuration);SolutionDir=$(SolutionDir)</Properties>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Solution Include="*.sln" />
+  </ItemGroup>
+
+  <UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" Condition=" '$(OS)' == 'Windows_NT' ">
+    <ParameterGroup>
+      <Address ParameterType="System.String" Required="true"/>
+      <OutputFilename ParameterType="System.String" Required="true" />
+    </ParameterGroup>
+    <Task>
+      <Reference Include="System" />
+      <Code Type="Fragment" Language="cs">
+        <![CDATA[
+            new System.Net.WebClient().DownloadFile(Address, OutputFilename);
+        ]]>
+      </Code>
+    </Task>
+  </UsingTask>
+
+  <Target Name="DownloadNuGet">
+    <MakeDir Directories="$(NuGetExeDir)" Condition=" !Exists('$(NuGetExeDir)') " />
+    <DownloadFile Address="$(NuGetDownloadAddress)" OutputFilename="$(NuGetExe)" Condition=" '$(OS)' == 'Windows_NT' AND !Exists('$(NuGetExe)')" />
+    <Exec Command="wget $(NuGetDownloadAddress) -O $(NuGetExe)" Condition=" '$(OS)' != 'Windows_NT' AND !Exists('$(NuGetExe)') " />
+  </Target>
+
+  <Target Name="RestorePackages" DependsOnTargets="DownloadNuGet">
+    <Exec Command="$(NuGetCommand) restore &quot;%(Solution.Identity)&quot;" />
+  </Target>
+
+  <Target Name="Clean">
+    <MSBuild Targets="Clean" Projects="@(Solution)" Properties="$(Properties)" />
+  </Target>
+
+  <Target Name="Build" DependsOnTargets="RestorePackages">
+    <MSBuild Targets="Build" Projects="@(Solution)" Properties="$(Properties)" />
+  </Target>
+
+  <Target Name="Rebuild" DependsOnTargets="RestorePackages">
+    <MSBuild Targets="Rebuild" Projects="@(Solution)" Properties="$(Properties)" />
+  </Target>
+
+</Project>

+ 24 - 28
frameworks/CSharp/aspnet/src/Benchmarks.AspNet.csproj → frameworks/CSharp/aspnet/src/Benchmarks.csproj

@@ -45,69 +45,61 @@
     <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Web.Mvc">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.Mvc.5.1.0\lib\net45\System.Web.Mvc.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.Helpers">
-      <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.Helpers.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.Mvc.5.2.2\lib\net45\System.Web.Mvc.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.Razor">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.Razor.3.1.0\lib\net45\System.Web.Razor.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.Razor.3.2.2\lib\net45\System.Web.Razor.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Web.WebPages.Deployment">
-      <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.dll</HintPath>
     </Reference>
     <Reference Include="System.Web.WebPages.Razor">
       <Private>True</Private>
-      <HintPath>..\lib\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Web.Infrastructure">
-      <Private>True</Private>
-      <HintPath>..\lib\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json">
-      <HintPath>..\lib\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="ServiceStack.Text">
-      <HintPath>..\lib\ServiceStack.Text.4.0.8\lib\net40\ServiceStack.Text.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\ServiceStack.Text.4.0.34\lib\net40\ServiceStack.Text.dll</HintPath>
     </Reference>
     <Reference Include="EntityFramework">
       <Private>True</Private>
-      <HintPath>..\lib\EntityFramework.6.0.2\lib\net45\EntityFramework.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.dll</HintPath>
     </Reference>
     <Reference Include="EntityFramework">
       <Private>True</Private>
-      <HintPath>..\lib\EntityFramework.6.0.2\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
     </Reference>
     <Reference Include="MySql">
       <Private>True</Private>
-      <HintPath>..\lib\MySql.Data.6.8.3\lib\net45\MySql.Data.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\MySql.Data.6.9.5\lib\net45\MySql.Data.dll</HintPath>
     </Reference>
     <Reference Include="MySql">
       <Private>True</Private>
-      <HintPath>..\lib\MySql.Data.Entities.6.8.3.0\lib\net45\mysql.data.entity.EF6.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\MySql.Data.Entity.6.9.5\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
     </Reference>
     <Reference Include="Npgsql">
       <Private>True</Private>
-      <HintPath>..\lib\Npgsql.2.0.14.3\lib\net45\Npgsql.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Npgsql.2.2.3\lib\net45\Npgsql.dll</HintPath>
     </Reference>
     <Reference Include="Npgsql">
       <Private>True</Private>
-      <HintPath>..\lib\Npgsql.2.0.14.3\lib\net45\Mono.Security.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\Npgsql.EntityFramework.2.2.3\lib\net45\Npgsql.EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="Npgsql">
+      <Private>True</Private>
+      <HintPath>$(SolutionDir)\packages\Npgsql.2.2.3\lib\net45\Mono.Security.dll</HintPath>
     </Reference>
     <Reference Include="MongoDB">
       <Private>True</Private>
-      <HintPath>..\lib\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Bson.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Bson.dll</HintPath>
     </Reference>
     <Reference Include="MongoDB">
       <Private>True</Private>
-      <HintPath>..\lib\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Driver.dll</HintPath>
+      <HintPath>$(SolutionDir)\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Driver.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -137,6 +129,11 @@
       <SubType>Designer</SubType>
     </Content>
   </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config">
+      <SubType>Designer</SubType>
+    </None>
+  </ItemGroup>
   <ItemGroup>
     <None Include="Properties\PublishProfiles\IIS.pubxml" />
   </ItemGroup>
@@ -147,8 +144,7 @@
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != '' And Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
-  <Import Project="..\lib\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="('$(VSToolsPath)' == '' Or !Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')) And Exists('..\lib\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets')" />
-  <Import Project="..\lib\.nuget\NuGet.targets" Condition="Exists('..\lib\.nuget\NuGet.targets')" />
+  <Import Project="$(SolutionDir)\packages\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="('$(VSToolsPath)' == '' Or !Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')) And Exists('$(SolutionDir)\packages\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets')" />
   <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)' == 'true'">
     <AspNetCompiler VirtualPath="/" PhysicalPath="$(WebProjectOutputDir)" />
   </Target>

+ 1 - 1
frameworks/CSharp/aspnet/src/Benchmarks.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks.AspNet", "Benchmarks.AspNet.csproj", "{62C3DEA2-2696-4200-BD83-011679316847}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Benchmarks.csproj", "{62C3DEA2-2696-4200-BD83-011679316847}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 1 - 1
frameworks/CSharp/aspnet/src/Models/MongoDB.cs

@@ -48,6 +48,6 @@ namespace Benchmarks.AspNet.Models
     public class MongoWorld : World
     {
         [ScriptIgnore]
-        public ObjectId _id { get; set; }
+        public object _id { get; set; }
     }
 }

+ 0 - 1
frameworks/CSharp/aspnet/src/Views/Fortunes.cshtml

@@ -3,7 +3,6 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <meta charset="utf-8">
     <title>Fortunes</title>
 </head>
 <body>

+ 4 - 4
frameworks/CSharp/aspnet/src/Views/Web.config

@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
 <configuration>
   <configSections>
-    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
-      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
+    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
+      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
+      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
     </sectionGroup>
   </configSections>
   <system.web.webPages.razor>
-    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <pages pageBaseType="System.Web.Mvc.WebViewPage">
       <namespaces>
         <add namespace="System.Web.Mvc" />

+ 4 - 4
frameworks/CSharp/aspnet/src/Web.config

@@ -15,16 +15,16 @@
   <system.data>
     <DbProviderFactories>
       <clear/>
-      <add name="MySql.Data.MySqlClient" description="Data Provider for MySQL" invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.2.0"/>
-      <add name="Npgsql" description="Data Provider for PostgreSQL" invariant="Npgsql" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.13.91"/>
+      <add name="MySql.Data.MySqlClient" description="Data Provider for MySQL" invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.5"/>
+      <add name="Npgsql" description="Data Provider for PostgreSQL" invariant="Npgsql" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.3"/>
       <add name="System.Data.SqlClient" description="Data Provider for Microsoft SQL Server" invariant="System.Data.SqlClient" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=4.0.0.0"/>
     </DbProviderFactories>
   </system.data>
   <!-- Entity Framework -->
   <entityFramework>
     <providers>
-      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity, Version=6.7.2.0"/>
-      <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql, Version=2.0.13.91"/>
+      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.5"/>
+      <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework, Version=2.2.3"/>
       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
     </providers>
   </entityFramework>

+ 15 - 0
frameworks/CSharp/aspnet/src/packages.config

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="6.1.1" targetFramework="net45" />
+  <package id="Microsoft.AspNet.Mvc" version="5.2.2" targetFramework="net45" />
+  <package id="Microsoft.AspNet.Razor" version="3.2.2" targetFramework="net45" />
+  <package id="Microsoft.AspNet.WebPages" version="3.2.2" targetFramework="net45" />
+  <package id="MSBuild.Microsoft.VisualStudio.Web.targets" version="11.0.2.1" />
+  <package id="mongocsharpdriver" version="1.9.2" targetFramework="net45" />
+  <package id="MySql.Data" version="6.9.5" targetFramework="net45" />
+  <package id="MySql.Data.Entity" version="6.9.5" targetFramework="net45" />
+  <package id="Npgsql" version="2.2.3" targetFramework="net45" />
+  <package id="Npgsql.EntityFramework" version="2.2.3" targetFramework="net45" />
+  <package id="Newtonsoft.Json" version="6.0.6" targetFramework="net45" />
+  <package id="ServiceStack.Text" version="4.0.34" targetFramework="net45" />
+</packages>

+ 0 - 5
frameworks/Clojure/compojure/bash_profile.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41
-export LEIN_HOME=$IROOT/lein

+ 3 - 0
frameworks/Clojure/compojure/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
+export LEIN_HOME=$IROOT/lein
 
 # Path vars must be set here
 export PATH="$JAVA_HOME/bin:$PATH"

+ 0 - 5
frameworks/Clojure/http-kit/bash_profile.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-
-export LEIN_HOME=$IROOT/lein

+ 2 - 0
frameworks/Clojure/http-kit/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export LEIN_HOME=$IROOT/lein
 
 cd hello
 $LEIN_HOME/bin/lein clean

+ 0 - 2
frameworks/Clojure/luminus/bash_profile.sh

@@ -1,2 +0,0 @@
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 2 - 0
frameworks/Clojure/luminus/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 # Path vars must be set here
 export PATH="$JAVA_HOME/bin:$PATH"

+ 0 - 5
frameworks/Dart/dart-redstone/bash_profile.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export DART_HOME=$IROOT/dart-sdk
-
-export PUB_CACHE=$IROOT/.pubcache

+ 2 - 0
frameworks/Dart/dart-redstone/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export DART_HOME=$IROOT/dart-sdk
+export PUB_CACHE=$IROOT/.pubcache
 
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' postgresql.yaml
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' mongodb.yaml

+ 0 - 7
frameworks/Dart/dart-start/bash_profile.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export DART_HOME=$IROOT/dart-sdk
-
-export PUB_CACHE=$IROOT/.pubcache
-
-export NGINX_HOME=$IROOT/nginx

+ 3 - 0
frameworks/Dart/dart-start/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+export DART_HOME=$IROOT/dart-sdk
+export PUB_CACHE=$IROOT/.pubcache
+export NGINX_HOME=$IROOT/nginx
 
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' postgresql.yaml
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' mongodb.yaml

+ 0 - 7
frameworks/Dart/dart-stream/bash_profile.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export DART_HOME=$IROOT/dart-sdk
-
-export PUB_CACHE=$IROOT/.pubcache
-
-export NGINX_HOME=$IROOT/nginx

+ 3 - 0
frameworks/Dart/dart-stream/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+export DART_HOME=$IROOT/dart-sdk
+export PUB_CACHE=$IROOT/.pubcache
+export NGINX_HOME=$IROOT/nginx
 
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' postgresql.yaml
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' mongodb.yaml

+ 0 - 5
frameworks/Dart/dart/bash_profile.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export DART_HOME=$IROOT/dart-sdk
-
-export PUB_CACHE=$IROOT/.pubcache

+ 20 - 15
frameworks/Dart/dart/server.dart

@@ -9,21 +9,24 @@ import 'package:postgresql/postgresql.dart' as pg;
 import 'package:postgresql/postgresql_pool.dart' as pgpool;
 import 'package:yaml/yaml.dart' as yaml;
 
+final _encoder = new JsonUtf8Encoder();
+
 /// Starts a new HTTP server that implements the tests to be benchmarked.  The
 /// address and port for incoming connections is configurable via command line
 /// arguments, as is the number of database connections to be maintained in the
 /// connection pool.
 void main(List<String> args) {
-  var parser = new ArgParser();
-  parser.addOption('address', abbr: 'a', defaultsTo: '0.0.0.0');
-  parser.addOption('port', abbr: 'p', defaultsTo: '8080');
-  parser.addOption('dbconnections', abbr: 'd', defaultsTo: '256');
-  parser.addOption('isolates', abbr: 'i', defaultsTo: '1');
+  var parser = new ArgParser()
+    ..addOption('address', abbr: 'a', defaultsTo: '0.0.0.0')
+    ..addOption('port', abbr: 'p', defaultsTo: '8080')
+    ..addOption('dbconnections', abbr: 'd', defaultsTo: '256')
+    ..addOption('isolates', abbr: 'i', defaultsTo: '1');
   var arguments = parser.parse(args);
   var isolates = int.parse(arguments['isolates']);
   var dbConnections = int.parse(arguments['dbconnections']) ~/ isolates;
-  ServerSocket.bind(arguments['address'], int.parse(arguments['port'])).then(
-      (server) {
+  ServerSocket
+      .bind(arguments['address'], int.parse(arguments['port']))
+      .then((server) {
     var ref = server.reference;
     for (int i = 1; i < isolates; i++) {
       Isolate.spawn(startInIsolate, [ref, dbConnections]);
@@ -128,16 +131,16 @@ int _parseInt(String text) =>
 
 /// Completes the given [request] by writing the [response] with the given
 /// [statusCode] and [type].
-void _sendResponse(HttpRequest request, int statusCode, [type, response]) {
+void _sendResponse(HttpRequest request, int statusCode,
+    {ContentType type, List<int> response}) {
   request.response.statusCode = statusCode;
   request.response.headers.date = new DateTime.now();
   if (type != null) {
     request.response.headers.contentType = type;
   }
   if (response != null) {
-    var data = UTF8.encode(response);
-    request.response.contentLength = data.length;
-    request.response.add(data);
+    request.response.contentLength = response.length;
+    request.response.add(response);
   } else {
     request.response.contentLength = 0;
   }
@@ -146,18 +149,20 @@ void _sendResponse(HttpRequest request, int statusCode, [type, response]) {
 
 /// Completes the given [request] by writing the [response] as HTML.
 void _sendHtml(HttpRequest request, String response) {
-  _sendResponse(request, HttpStatus.OK, ContentType.HTML, response);
+  _sendResponse(request, HttpStatus.OK,
+      type: ContentType.HTML, response: UTF8.encode(response));
 }
 
 /// Completes the given [request] by writing the [response] as JSON.
 void _sendJson(HttpRequest request, Object response) {
-  _sendResponse(
-      request, HttpStatus.OK, ContentType.JSON, JSON.encode(response));
+  _sendResponse(request, HttpStatus.OK,
+      type: ContentType.JSON, response: _encoder.convert(response));
 }
 
 /// Completes the given [request] by writing the [response] as plain text.
 void _sendText(HttpRequest request, String response) {
-  _sendResponse(request, HttpStatus.OK, ContentType.TEXT, response);
+  _sendResponse(request, HttpStatus.OK,
+      type: ContentType.TEXT, response: UTF8.encode(response));
 }
 
 /// Responds with the JSON test to the [request].

+ 5 - 1
frameworks/Dart/dart/setup.sh

@@ -2,6 +2,10 @@
 
 sed -i 's|host: .*|host: '"${DBHOST}"'|g' postgresql.yaml
 
+export DART_HOME=$IROOT/dart-sdk
+
+export PUB_CACHE=$IROOT/.pubcache
+
 $DART_HOME/bin/pub upgrade
 
-$DART_HOME/bin/dart server.dart -a 0.0.0.0 -p 8080 -d ${MAX_THREADS} -i ${MAX_THREADS} &
+$DART_HOME/bin/dart server.dart -a 0.0.0.0 -p 8080 -d ${MAX_THREADS} -i ${MAX_THREADS} &

+ 0 - 3
frameworks/Erlang/cowboy/bash_profile.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-export REBAR_HOME=$IROOT/rebar

+ 1 - 0
frameworks/Erlang/cowboy/setup_erlang.sh

@@ -1,4 +1,5 @@
 #!/bin/bash
+export REBAR_HOME=$IROOT/rebar
 
 sed -i 's|"benchmarkdbpass", ".*", 3306|"benchmarkdbpass", "'"${DBHOST}"'", 3306|g' src/hello_world_app.erl
 

+ 0 - 3
frameworks/Erlang/elli/bash_profile.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-export REBAR_HOME=$IROOT/rebar

+ 1 - 0
frameworks/Erlang/elli/setup_erlang.sh

@@ -1,4 +1,5 @@
 #!/bin/bash
+export REBAR_HOME=$IROOT/rebar
 
 sed -i 's|"benchmarkdbpass", ".*", 3306|"benchmarkdbpass", "'"${DBHOST}"'", 3306|g' src/elli_bench_sup.erl
 

+ 0 - 6
frameworks/Go/beego/bash_profile.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/beego/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/hello/hello.go
 

+ 0 - 6
frameworks/Go/falcore/bash_profile.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/falcore/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/framework_benchmarks/falcore.go
 

+ 0 - 6
frameworks/Go/gin/bash_profile.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/gin/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 # Where to find the go executable
 export PATH="$GOROOT/bin:$PATH"

+ 0 - 4
frameworks/Go/go/bash_profile.sh

@@ -1,4 +0,0 @@
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 23 - 0
frameworks/Go/go/benchmark_config

@@ -23,6 +23,29 @@
       "display_name": "go",
       "notes": "",
       "versus": "go"
+    },
+    "prefork": {
+      "setup_file": "setup_prefork",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/queries?queries=",
+      "fortune_url": "/fortune",
+      "update_url": "/update?queries=",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "MySQL",
+      "framework": "go",
+      "language": "Go",
+      "orm": "Raw",
+      "platform": "Go",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "go",
+      "notes": "",
+      "versus": "go"
     }
   }]
 }

+ 3 - 0
frameworks/Go/go/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/hello/hello.go
 

+ 10 - 0
frameworks/Go/go/setup_prefork.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/hello/hello.go
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+
+go run src/hello/hello.go -prefork &

+ 66 - 2
frameworks/Go/go/src/hello/hello.go

@@ -3,10 +3,14 @@ package main
 import (
 	"database/sql"
 	"encoding/json"
+	"flag"
 	"html/template"
 	"log"
 	"math/rand"
+	"net"
 	"net/http"
+	"os"
+	"os/exec"
 	"runtime"
 	"sort"
 	"strconv"
@@ -52,8 +56,17 @@ var (
 	helloWorldBytes = []byte(helloWorldString)
 )
 
+var prefork = flag.Bool("prefork", false, "use prefork")
+var child = flag.Bool("child", false, "is child proc")
+
 func main() {
-	runtime.GOMAXPROCS(runtime.NumCPU())
+	var listener net.Listener
+	flag.Parse()
+	if !*prefork {
+		runtime.GOMAXPROCS(runtime.NumCPU())
+	} else {
+		listener = doPrefork()
+	}
 
 	db, err := sql.Open("mysql", connectionString)
 	if err != nil {
@@ -79,7 +92,58 @@ func main() {
 	http.HandleFunc("/fortune", fortuneHandler)
 	http.HandleFunc("/update", updateHandler)
 	http.HandleFunc("/plaintext", plaintextHandler)
-	http.ListenAndServe(":8080", nil)
+	if !*prefork {
+		http.ListenAndServe(":8080", nil)
+	} else {
+		http.Serve(listener, nil)
+	}
+}
+
+func doPrefork() (listener net.Listener) {
+	var err error
+	var fl *os.File
+	var tcplistener *net.TCPListener
+	if !*child {
+		var addr *net.TCPAddr
+		addr, err = net.ResolveTCPAddr("tcp", ":8080")
+		if err != nil {
+			log.Fatal(err)
+		}
+		tcplistener, err = net.ListenTCP("tcp", addr)
+		if err != nil {
+			log.Fatal(err)
+		}
+		fl, err = tcplistener.File()
+		if err != nil {
+			log.Fatal(err)
+		}
+		children := make([]*exec.Cmd, runtime.NumCPU()/2)
+		for i := range children {
+			children[i] = exec.Command(os.Args[0], "-prefork", "-child")
+			children[i].Stdout = os.Stdout
+			children[i].Stderr = os.Stderr
+			children[i].ExtraFiles = []*os.File{fl}
+			err = children[i].Start()
+			if err != nil {
+				log.Fatal(err)
+			}
+		}
+		for _, ch := range children {
+			var err error = ch.Wait()
+			if err != nil {
+				log.Print(err)
+			}
+		}
+		os.Exit(0)
+	} else {
+		fl = os.NewFile(3, "")
+		listener, err = net.FileListener(fl)
+		if err != nil {
+			log.Fatal(err)
+		}
+		runtime.GOMAXPROCS(2)
+	}
+	return listener
 }
 
 // Test 1: JSON serialization

+ 0 - 6
frameworks/Go/revel-jet/bash_profile.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/revel-jet/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/benchmark/conf/app.conf
 

+ 0 - 4
frameworks/Go/revel-qbs/bash_profile.sh

@@ -1,4 +0,0 @@
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/revel-qbs/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/benchmark/conf/app.conf
 

+ 0 - 4
frameworks/Go/revel/bash_profile.sh

@@ -1,4 +0,0 @@
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/revel/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/benchmark/conf/app.conf
 

+ 0 - 6
frameworks/Go/webgo/bash_profile.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 3 - 0
frameworks/Go/webgo/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+# Set the root of our go installation
+export GOROOT=${IROOT}/go
+export GOPATH=${TROOT}
 
 # Where to find the go executable
 export PATH="$GOROOT/bin:$PATH"

+ 3 - 3
frameworks/Groovy/grails/setup.sh

@@ -1,14 +1,14 @@
 #!/bin/bash
+
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=${IROOT}/resin-4.0.41
-
 export GRAILS_PATH=${IROOT}/grails-2.4.4/bin/
 
-sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' hello/grails-app/conf/DataSource.groovy
-
 export PATH=${GRAILS_PATH}:$PATH
 export GRAILS_AGENT_CACHE_DIR=${IROOT}/.grails/.slcache
 
+sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' hello/grails-app/conf/DataSource.groovy
+
 cd hello
 grails -Dgrails.work.dir=${IROOT}/.grails -non-interactive -plain-output refresh-dependencies
 grails -Dgrails.work.dir=${IROOT}/.grails -non-interactive -plain-output compile

+ 0 - 5
frameworks/Haskell/snap/bash_profile.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export CABAL_HOME=/opt/cabal/1.20
-export HASKELL_HOME=/opt/ghc/7.8.3
-export LANG=en_US.UTF-8

+ 3 - 0
frameworks/Haskell/snap/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+export CABAL_HOME=/opt/cabal/1.20
+export HASKELL_HOME=/opt/ghc/7.8.3
+export LANG=en_US.UTF-8
 
 sed -i 's|host=".*"|host="'"${DBHOST}"'"|g' bench/cfg/db.cfg
 

+ 0 - 5
frameworks/Haskell/wai/bash_profile.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-export CABAL_HOME=/opt/cabal/1.20
-export HASKELL_HOME=/opt/ghc/7.8.3
-export LANG=en_US.UTF-8

+ 3 - 0
frameworks/Haskell/wai/setup.sh

@@ -1,4 +1,7 @@
 #!/bin/bash
+export CABAL_HOME=/opt/cabal/1.20
+export HASKELL_HOME=/opt/ghc/7.8.3
+export LANG=en_US.UTF-8
 
 export PATH=${HASKELL_HOME}/bin:$PATH
 

+ 1 - 1
frameworks/Java/README.md

@@ -10,6 +10,6 @@ that contains at least
 This installs the OpenJDK 7 JVM.
 
 Frameworks can also choose to install Oracle Java 8 JVM by declaring a dependency on "java8"
-instead of java. In order to use Java 8 JVM frameworks need to add the following line in their "bash_profile.sh" file:
+instead of java. In order to use Java 8 JVM frameworks need to add the following line in their "setup.sh" file:
 
 export JAVA_HOME=/opt/java8

+ 0 - 2
frameworks/Java/activeweb/bash_profile.sh

@@ -1,2 +0,0 @@
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 2 - 0
frameworks/Java/activeweb/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 sed -i 's|localhost|'"${DBHOST}"'|g' src/main/webapp/WEB-INF/resin-web.xml
 sed -i 's|localhost|'"${DBHOST}"'|g' src/main/java/app/config/DbConfig.java

+ 0 - 2
frameworks/Java/gemini/bash_profile.sh

@@ -1,2 +0,0 @@
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 3 - 0
frameworks/Java/gemini/setup.sh

@@ -7,6 +7,9 @@
 # of their initial setup.  On Windows, the script can be run through 
 # Git bash.
 
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
+
 projectName="GeminiHello"
 machineNameUpper="`echo $HOSTNAME|tr '[a-z]' '[A-Z]'`"
 machineNameLower="`echo $HOSTNAME|tr '[A-Z]' '[a-z]'`"

+ 1 - 0
frameworks/Java/grizzly-jersey/source_code

@@ -1,6 +1,7 @@
 ./grizzly-jersey/src/main/
 ./grizzly-jersey/src/main/java
 ./grizzly-jersey/src/main/java/hello
+./grizzly-jersey/src/main/java/hello/Common.java
 ./grizzly-jersey/src/main/java/hello/DbResource.java
 ./grizzly-jersey/src/main/java/hello/FortunesResource.java
 ./grizzly-jersey/src/main/java/hello/SessionFactoryProvider.java

+ 20 - 0
frameworks/Java/grizzly-jersey/src/main/java/hello/Common.java

@@ -0,0 +1,20 @@
+package hello;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author denkab
+ */
+public class Common {
+
+    private static final int cpuCount = Runtime.getRuntime().availableProcessors();
+
+    public static ExecutorService EXECUTOR = new ThreadPoolExecutor(
+        cpuCount * 2, cpuCount * 25, 200, TimeUnit.MILLISECONDS,
+        new LinkedBlockingQueue<Runnable>(cpuCount * 100),
+        new ThreadPoolExecutor.CallerRunsPolicy());
+
+}

+ 38 - 6
frameworks/Java/grizzly-jersey/src/main/java/hello/DbResource.java

@@ -3,7 +3,12 @@ package hello;
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
 import hello.domain.World;
 
+import java.util.Map;
 import java.util.Random;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
 import java.util.concurrent.ThreadLocalRandom;
 
 import javax.ws.rs.DefaultValue;
@@ -13,6 +18,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 
+import org.hibernate.IdentifierLoadAccess;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 
@@ -29,17 +35,43 @@ public class DbResource {
   
   @GET
   @Produces(APPLICATION_JSON + "; charset=utf-8")
-  public Object db(@QueryParam("queries") @DefaultValue("1") final int queries) {
+  public Object db(@QueryParam("queries") String queriesParam)
+      throws ExecutionException, InterruptedException {
+
+    final int queries = getQueries(queriesParam);
     final World[] worlds = new World[queries];
     final Random random = ThreadLocalRandom.current();
     final Session session = sessionFactory.openSession();
-    
+    session.setDefaultReadOnly(true);
+    final IdentifierLoadAccess accessor = session.byId(World.class);
+
+    Map<Integer, Future<World>> futureWorlds = new ConcurrentHashMap<>();
+    for (int i = 0; i < queries; i++) {
+      futureWorlds.put(i, Common.EXECUTOR.submit(
+        new Callable<World>() {
+          @Override
+          public World call() throws Exception {
+            return (World) accessor.load(random.nextInt(DB_ROWS) + 1);
+          }
+        }
+      ));
+    }
+
     for (int i = 0; i < queries; i++) {
-        worlds[i] = (World) session.byId(World.class).load(random.nextInt(DB_ROWS) + 1);
+      worlds[i] = futureWorlds.get(i).get();
     }
-    
-    session.close();
+
     return queries == 1 ? worlds[0] : worlds;
   }
-  
+
+  private int getQueries(String proto) {
+    int result = 1;
+    try {
+      result = Integer.parseInt(proto);
+    } catch (NumberFormatException e) {
+      e.printStackTrace();
+    }
+
+    return Math.min(500, Math.max(1, result));
+  }
 }

+ 3 - 3
frameworks/Java/grizzly-jersey/src/main/resources/hibernate.cfg.xml

@@ -8,9 +8,9 @@
     <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
     <property name="hibernate.cache.use_query_cache">false</property>
     <property name="hibernate.show_sql">false</property>
-    <property name="hibernate.c3p0.min_size">5</property>
-    <property name="hibernate.c3p0.max_size">40</property>
+    <property name="hibernate.c3p0.min_size">256</property>
+    <property name="hibernate.c3p0.max_size">256</property>
     <property name="hibernate.c3p0.timeout">1800</property>
-    <property name="hibernate.c3p0.max_statements">50</property>
+    <property name="hibernate.c3p0.max_statements">2048</property>
   </session-factory>
 </hibernate-configuration>

+ 0 - 3
frameworks/Java/play1/bash_profile.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-export PLAY1_HOME=${IROOT}/play-1.2.5

+ 1 - 0
frameworks/Java/play1/setup.sh

@@ -1,4 +1,5 @@
 #!/bin/bash
+export PLAY1_HOME=${IROOT}/play-1.2.5
 
 sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
 

+ 0 - 4
frameworks/Java/play1siena/bash_profile.sh

@@ -1,4 +0,0 @@
-#!/bin/bash
-
-export PLAY1_HOME=${IROOT}/play-1.2.5
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 2 - 0
frameworks/Java/play1siena/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export PLAY1_HOME=${IROOT}/play-1.2.5
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
 

+ 0 - 1
frameworks/Java/play2-java/bash_profile.sh

@@ -1 +0,0 @@
-# Intentionally blank

+ 0 - 1
frameworks/Java/servlet/bash_profile.sh

@@ -1 +0,0 @@
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 1 - 0
frameworks/Java/servlet/setup.sh

@@ -1,4 +1,5 @@
 #!/bin/bash
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 sed -i 's|localhost|'"${DBHOST}"'|g' src/main/webapp/WEB-INF/resin-web.xml
 

+ 0 - 3
frameworks/Java/servlet3-cass/bash_profile.sh

@@ -1,3 +0,0 @@
-export JAVA_HOME=/opt/java8
-export JAVA_EXE=$JAVA_HOME/bin/java
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 2 - 2
frameworks/Java/servlet3-cass/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
-
-#!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 sed -i 's|localhost|'"${DBHOST}"'|g' src/main/resources/application.properties
 

+ 0 - 2
frameworks/Java/spark/bash_profile.sh

@@ -1,2 +0,0 @@
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 2 - 0
frameworks/Java/spark/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 sed -i 's|mysql://.*:3306|mysql://'"${DBHOST}"':3306|g' src/main/webapp/WEB-INF/resin-web.xml
 

+ 0 - 2
frameworks/Java/tapestry/bash_profile.sh

@@ -1,2 +0,0 @@
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41

+ 2 - 0
frameworks/Java/tapestry/setup.sh

@@ -1,4 +1,6 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
 sed -i 's|mysql://.*:3306|mysql://'"${DBHOST}"':3306|g' hello/src/main/webapp/WEB-INF/resin-web.xml
 

+ 26 - 12
frameworks/Java/undertow/src/main/java/hello/DbSqlHandler.java

@@ -11,7 +11,11 @@ import javax.sql.DataSource;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Future;
 
 import static hello.HelloWebServer.JSON_UTF8;
 
@@ -43,19 +47,29 @@ final class DbSqlHandler implements HttpHandler {
     }
     
     World[] worlds = new World[queries];
-    try (Connection connection = database.getConnection();
-         PreparedStatement statement = connection.prepareStatement(
-             "SELECT * FROM World WHERE id = ?",
-             ResultSet.TYPE_FORWARD_ONLY,
-             ResultSet.CONCUR_READ_ONLY)) {
+    try (final Connection connection = database.getConnection()) {
+      Map<Integer, Future<World>> futureWorlds = new ConcurrentHashMap<>();
       for (int i = 0; i < queries; i++) {
-        statement.setInt(1, Helper.randomWorld());
-        try (ResultSet resultSet = statement.executeQuery()) {
-          resultSet.next();
-          worlds[i] = new World(
-              resultSet.getInt("id"),
-              resultSet.getInt("randomNumber"));
-        }
+        futureWorlds.put(i, Helper.EXECUTOR.submit(new Callable<World>(){
+          @Override
+          public World call() throws Exception {
+            try (PreparedStatement statement = connection.prepareStatement(
+                "SELECT * FROM World WHERE id = ?",
+                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)) {
+
+              statement.setInt(1, Helper.randomWorld());
+              ResultSet resultSet = statement.executeQuery();
+              resultSet.next();
+              return new World(
+                resultSet.getInt("id"),
+                resultSet.getInt("randomNumber"));
+            }
+          }
+        }));
+      }
+
+      for (int i = 0; i < queries; i++) {
+        worlds[i] = futureWorlds.get(i).get();
       }
     }
     exchange.getResponseHeaders().put(

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