Browse Source

Merge branch 'evhttp-sharp' of https://github.com/kekekeks/FrameworkBenchmarks into 828

mcocciaTE 11 years ago
parent
commit
a0490cf68a
3 changed files with 5 additions and 4 deletions
  1. 1 1
      evhttp-sharp/setup.py
  2. 4 3
      evhttp-sharp/src/Program.cs
  3. BIN
      evhttp-sharp/src/lib/EvHttpSharp.dll

+ 1 - 1
evhttp-sharp/setup.py

@@ -14,7 +14,7 @@ def start(args, logfile, errfile):
     # build
     subprocess.check_call("rm -rf bin obj", shell=True, cwd=app, stdout=logfile, stderr=errfile)
     subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd=app, stdout=logfile, stderr=errfile)
-    
+    os.environ['MONO_GC_PARAMS']="nursery-size=64m"
     subprocess.Popen("mono -O=all bin/Release/EvHttpSharpBenchmark.exe 127.0.0.1 8085 " + str(args.max_threads) + " &", shell=True, cwd=app, stdout=logfile, stderr=errfile)
     return 0
   except subprocess.CalledProcessError:

+ 4 - 3
evhttp-sharp/src/Program.cs

@@ -15,8 +15,9 @@ namespace EvHttpSharpBenchmark
 
 		static void Main (string[] args)
 		{
-			var host = new EventHttpListener(Handler);
-			host.Start(args[0], ushort.Parse(args[1]), int.Parse(args[2]));
+            LibLocator.Init();
+		    var host = new EventHttpMultiworkerListener(Handler, int.Parse(args[2]));
+		    host.Start(args[0], ushort.Parse(args[1]));
 		}
 
 		private static void Handler(EventHttpRequest req)
@@ -27,7 +28,7 @@ namespace EvHttpSharpBenchmark
 			if (!req.Uri.Contains("plaintext"))
 			{
 				var sw = new StringWriter();
-				Serializer.Serialize(sw, new {message = "Hello, world"});
+				Serializer.Serialize(sw, new {message = "Hello, World!"});
 				resp = sw.ToString();
 				headers["Content-Type"] = "application/json";
 			}

BIN
evhttp-sharp/src/lib/EvHttpSharp.dll