Browse Source

Revenj.NET simplified. DSL compiler upgraded. Latest Revenj.Java (#2371)

knewmanTE 8 years ago
parent
commit
0acdabe825

+ 2 - 2
frameworks/CSharp/revenj/README.md

@@ -26,6 +26,6 @@ Data structures are defined in a DSL schema
 The tests were run with:
 The tests were run with:
 
 
  * [Mono 4.2](http://www.mono-project.com/)
  * [Mono 4.2](http://www.mono-project.com/)
- * [.NET 4.0](https://www.microsoft.com/net)
+ * [.NET 4.5](https://www.microsoft.com/net)
  * [Postgres 9.3](http://www.postgresql.org/)
  * [Postgres 9.3](http://www.postgresql.org/)
- * [Revenj.NET 1.3.1](http://github.com/ngs-doo/revenj)
+ * [Revenj.NET 1.4.1](http://github.com/ngs-doo/revenj)

+ 13 - 11
frameworks/CSharp/revenj/Revenj.Bench.sln

@@ -1,18 +1,11 @@
 
 
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Revenj.Bench", "Revenj.Bench\Revenj.Bench.csproj", "{14DC9873-30EA-41DA-8D7B-5AA03E7E2EE2}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Revenj.Bench", "Revenj.Bench\Revenj.Bench.csproj", "{14DC9873-30EA-41DA-8D7B-5AA03E7E2EE2}"
 EndProject
 EndProject
 Global
 Global
-	GlobalSection(DslPlatformSolutionProperties) = preSolution
-		Php.Name = Php
-		Php.Target = Php
-		Postgres.Compile = True
-		Postgres.Name = ServerModel
-		Postgres.Target = exe
-		Postgres.Dependencies = exe
-		Postgres.WithManualJson = True
-	EndGlobalSection
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
 		Release|Any CPU = Release|Any CPU
@@ -26,4 +19,13 @@ Global
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	EndGlobalSection
+	GlobalSection(DslPlatformSolutionProperties) = preSolution
+		Php.Name = Php
+		Php.Target = Php
+		Postgres.Compile = True
+		Postgres.Name = ServerModel
+		Postgres.Target = exe
+		Postgres.Dependencies = exe
+		Postgres.WithManualJson = True
+	EndGlobalSection
 EndGlobal
 EndGlobal

+ 33 - 16
frameworks/CSharp/revenj/Revenj.Bench/Context.cs

@@ -1,34 +1,51 @@
 using System;
 using System;
-using System.IO;
 using FrameworkBench;
 using FrameworkBench;
 using Revenj.DatabasePersistence;
 using Revenj.DatabasePersistence;
-using Revenj.DatabasePersistence.Postgres;
 using Revenj.DomainPatterns;
 using Revenj.DomainPatterns;
 using Revenj.Extensibility;
 using Revenj.Extensibility;
-using Revenj.Utility;
 
 
 namespace Revenj.Bench
 namespace Revenj.Bench
 {
 {
 	internal class Context
 	internal class Context
 	{
 	{
-		public readonly ChunkedMemoryStream Stream;
-		public readonly TextWriter Writer;
 		public readonly IPersistableRepository<World> WorldRepository;
 		public readonly IPersistableRepository<World> WorldRepository;
 		public readonly IQueryableRepository<Fortune> FortuneRepository;
 		public readonly IQueryableRepository<Fortune> FortuneRepository;
-		public readonly IRepositoryBulkReader BulkReader;
-		public readonly Lazy<World>[] LazyWorlds = new Lazy<World>[512];
+		public readonly Random Random = new Random(0);
 		public readonly World[] Worlds = new World[512];
 		public readonly World[] Worlds = new World[512];
+		//private readonly IRepositoryBulkReader BulkReader;
+		//private readonly Lazy<World>[] LazyWorlds = new Lazy<World>[512];
 
 
-		public Context(IServiceProvider service)
+		public Context(IObjectFactory factory, IDatabaseQueryManager manager)
 		{
 		{
-			Stream = ChunkedMemoryStream.Static();
-			Writer = Stream.GetWriter();
-			var dqm = service.Resolve<IDatabaseQueryManager>();
-			var factory = service.Resolve<IObjectFactory>().CreateInnerFactory();
-			factory.RegisterInterfaces(dqm.StartQuery(false));
-			WorldRepository = factory.Resolve<IPersistableRepository<World>>();
-			FortuneRepository = factory.Resolve<IQueryableRepository<Fortune>>();
-			BulkReader = factory.BulkRead(ChunkedMemoryStream.Static());
+			var scope = factory.CreateScope(null);
+			scope.RegisterInterfaces(manager.StartQuery(false));
+			WorldRepository = scope.Resolve<IPersistableRepository<World>>();
+			FortuneRepository = scope.Resolve<IQueryableRepository<Fortune>>();
+			//BulkReader = scope.BulkRead(ChunkedMemoryStream.Static());
+		}
+
+		/* bulk loading of worlds. use such pattern for production code */
+		/*public void LoadWorldsFast(int repeat, World[] worlds)
+		{
+			BulkReader.Reset(true);
+			for (int i = 0; i < repeat; i++)
+			{
+				var id = Random.Next(10000) + 1;
+				LazyWorlds[i] = BulkReader.Find<World>(id.ToString());
+			}
+			BulkReader.Execute();
+			for (int i = 0; i < repeat; i++)
+				worlds[i] = LazyWorlds[i].Value;
+		}*/
+
+		/* multiple roundtrips loading of worlds. don't write such production code */
+		public void LoadWorldsSlow(int repeat, World[] worlds)
+		{
+			for (int i = 0; i < repeat; i++)
+			{
+				var id = Random.Next(10000) + 1;
+				worlds[i] = WorldRepository.Find(id);
+			}
 		}
 		}
 	}
 	}
 }
 }

+ 19 - 6
frameworks/CSharp/revenj/Revenj.Bench/FortuneTemplate.cs

@@ -1,18 +1,31 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
+using System.Text;
+using System.Web;
+using Revenj.Http;
 
 
 namespace Revenj.Bench
 namespace Revenj.Bench
 {
 {
-	public partial class Fortunes
+	public partial class Fortunes : IHtmlView
 	{
 	{
-		private readonly TextWriter writer;
-
-		public Fortunes(List<KeyValuePair<int, string>> arg, TextWriter writer)
+		private readonly static StringBuilder Fake = new StringBuilder(0);
+		public Fortunes(List<KeyValuePair<int, string>> arg)
 		{
 		{
 			this._fortunesField = arg;
 			this._fortunesField = arg;
-			this.writer = writer;
+			this.GenerationEnvironment = Fake;
 		}
 		}
 
 
-		public new void Write(string what) { writer.Write(what); }
+		private new void Write(string what) { writer.Write(what); }
+
+		public void Show(int what) { writer.Write(what); }
+		public void Show(string what) { HttpUtility.HtmlEncode(what, writer); }
+
+		private TextWriter writer;
+
+		public void Render(TextWriter writer)
+		{
+			this.writer = writer;
+			TransformText();
+		}
 	}
 	}
 }
 }

+ 9 - 9
frameworks/CSharp/revenj/Revenj.Bench/Fortunes.cs

@@ -12,7 +12,7 @@ namespace Revenj.Bench
     using System;
     using System;
     
     
     
     
-    #line 1 "C:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
+    #line 1 "D:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
     [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "10.0.0.0")]
     [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "10.0.0.0")]
     public partial class Fortunes : FortunesBase
     public partial class Fortunes : FortunesBase
     {
     {
@@ -23,29 +23,29 @@ namespace Revenj.Bench
             this.Write("\n<!DOCTYPE html>\n<html>\n<head><title>Fortunes</title></head>\n<body><table><tr><th" +
             this.Write("\n<!DOCTYPE html>\n<html>\n<head><title>Fortunes</title></head>\n<body><table><tr><th" +
                     ">id</th><th>message</th></tr>\n");
                     ">id</th><th>message</th></tr>\n");
             
             
-            #line 1 "C:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
- for (var i=0; i<fortunes.Count;i++) {
+            #line 1 "D:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
+ for (var i=0; i<fortunes.Count;i++) {
 	var f = fortunes[i]; 
 	var f = fortunes[i]; 
             
             
             #line default
             #line default
             #line hidden
             #line hidden
             this.Write("\n<tr><td>");
             this.Write("\n<tr><td>");
             
             
-            #line 1 "C:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
- Write(f.Key.ToString()); 
+            #line 1 "D:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
+ Show(f.Key); 
             
             
             #line default
             #line default
             #line hidden
             #line hidden
             this.Write("</td><td>");
             this.Write("</td><td>");
             
             
-            #line 1 "C:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
- Write(System.Web.HttpUtility.HtmlEncode(f.Value)); 
+            #line 1 "D:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
+ Show(f.Value); 
             
             
             #line default
             #line default
             #line hidden
             #line hidden
             this.Write("</td></tr>\n");
             this.Write("</td></tr>\n");
             
             
-            #line 1 "C:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
+            #line 1 "D:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
  } 
  } 
             
             
             #line default
             #line default
@@ -54,7 +54,7 @@ namespace Revenj.Bench
             return this.GenerationEnvironment.ToString();
             return this.GenerationEnvironment.ToString();
         }
         }
         
         
-        #line 1 "C:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
+        #line 1 "D:\Projects\FrameworkBenchmarks\frameworks\CSharp\revenj\Revenj.Bench\Fortunes.tt"
 
 
 private global::System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<int, string>> _fortunesField;
 private global::System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<int, string>> _fortunesField;
 
 

+ 1 - 1
frameworks/CSharp/revenj/Revenj.Bench/Fortunes.tt

@@ -7,7 +7,7 @@
 <body><table><tr><th>id</th><th>message</th></tr>
 <body><table><tr><th>id</th><th>message</th></tr>
 <# for (var i=0; i<fortunes.Count;i++) {
 <# for (var i=0; i<fortunes.Count;i++) {
 	var f = fortunes[i]; #>
 	var f = fortunes[i]; #>
-<tr><td><# Write(f.Key.ToString()); #></td><td><# Write(System.Web.HttpUtility.HtmlEncode(f.Value)); #></td></tr>
+<tr><td><# Show(f.Key); #></td><td><# Show(f.Value); #></td></tr>
 <# } #>
 <# } #>
 </table>
 </table>
 </body>
 </body>

+ 37 - 119
frameworks/CSharp/revenj/Revenj.Bench/RestService.cs

@@ -1,187 +1,105 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
-using System.ServiceModel;
 using System.ServiceModel.Web;
 using System.ServiceModel.Web;
 using System.Text;
 using System.Text;
+using System.Threading;
 using FrameworkBench;
 using FrameworkBench;
 using Revenj.Api;
 using Revenj.Api;
+using Revenj.DatabasePersistence;
 using Revenj.DomainPatterns;
 using Revenj.DomainPatterns;
-using Revenj.Serialization;
+using Revenj.Extensibility;
+using Revenj.Http;
 using Revenj.Utility;
 using Revenj.Utility;
+using Revenj.Serialization;
 
 
 namespace Revenj.Bench
 namespace Revenj.Bench
 {
 {
-	[ServiceContract(Namespace = "https://github.com/ngs-doo/revenj")]
-	public interface IRestService
-	{
-		[OperationContract]
-		[WebGet(UriTemplate = "/plaintext")]
-		Stream PlainText();
-
-		[OperationContract]
-		[WebGet(UriTemplate = "/json")]
-		Stream JSON();
-
-		[OperationContract]
-		[WebGet(UriTemplate = "/db")]
-		Stream SingleQuery();
-
-		[OperationContract]
-		[WebGet(UriTemplate = "/queries/{count}")]
-		Stream MultipleQueries(string count);
-
-		[OperationContract]
-		[WebGet(UriTemplate = "/updates/{count}")]
-		Stream Updates(string count);
-
-		[OperationContract]
-		[WebGet(UriTemplate = "/fortunes")]
-		Stream Fortunes();
-	}
-
-	public class RestService : IRestService
+	[Controller("bench")]
+	public class RestService
 	{
 	{
 		private static readonly ChunkedMemoryStream HelloWorld = ChunkedMemoryStream.Static();
 		private static readonly ChunkedMemoryStream HelloWorld = ChunkedMemoryStream.Static();
-		private static readonly string[] IDs = new string[10001];
-		[ThreadStatic]
-		private static Context Context;
-		private static Context GetContext(IServiceProvider services)
-		{
-			if (Context == null)
-				Context = new Context(services);
-			Context.Stream.Reset();
-			return Context;
-		}
 
 
 		static RestService()
 		static RestService()
 		{
 		{
 			var hwText = Encoding.UTF8.GetBytes("Hello, World!");
 			var hwText = Encoding.UTF8.GetBytes("Hello, World!");
 			HelloWorld.Write(hwText, 0, hwText.Length);
 			HelloWorld.Write(hwText, 0, hwText.Length);
 			HelloWorld.Position = 0;
 			HelloWorld.Position = 0;
-			for (int i = 0; i < IDs.Length; i++)
-				IDs[i] = i.ToString();
 		}
 		}
 
 
-		private Random Random = new Random(0);
-		private readonly IServiceProvider Services;
+		private readonly ThreadLocal<Context> Context;
 
 
-		public RestService(IServiceProvider services)
+		public RestService(IObjectFactory factory, IDatabaseQueryManager queryManager)
 		{
 		{
-			this.Services = services;
+			this.Context = new ThreadLocal<Context>(() => new Context(factory, queryManager));
 		}
 		}
 
 
-		public Stream PlainText()
+		[WebGet(UriTemplate = "/plaintext")]
+		public Stream PlainText(IResponseContext response)
 		{
 		{
-			ThreadContext.Response.ContentType = "text/plain";
+			response.ContentType = "text/plain";
 			return HelloWorld;
 			return HelloWorld;
 		}
 		}
 
 
-		private Stream ReturnJSON(IJsonObject value, ChunkedMemoryStream cms)
-		{
-			value.Serialize(cms);
-			ThreadContext.Response.ContentType = "application/json";
-			return cms;
-		}
-
-		public Stream JSON()
-		{
-			var ctx = GetContext(Services);
-			return ReturnJSON(new Message { message = "Hello, World!" }, ctx.Stream);
-		}
-
-		public Stream SingleQuery()
-		{
-			var id = Random.Next(10000) + 1;
-			var ctx = GetContext(Services);
-			var world = ctx.WorldRepository.Find(IDs[id]);
-			return ReturnJSON(world, ctx.Stream);
-		}
-
-		/* bulk loading of worlds. use such pattern for production code */
-		private void LoadWorldsFast(int repeat, Context ctx)
+		[WebGet(UriTemplate = "/json")]
+		public Message JSON()
 		{
 		{
-			var reader = ctx.BulkReader;
-			var lazyResult = ctx.LazyWorlds;
-			var worlds = ctx.Worlds;
-			reader.Reset(true);
-			for (int i = 0; i < repeat; i++)
-			{
-				var id = Random.Next(10000) + 1;
-				lazyResult[i] = reader.Find<World>(IDs[id]);
-			}
-			reader.Execute();
-			for (int i = 0; i < repeat; i++)
-				worlds[i] = lazyResult[i].Value;
+			return new Message { message = "Hello, World!" };
 		}
 		}
 
 
-		/* multiple roundtrips loading of worlds. don't write such production code */
-		private void LoadWorldsSlow(int repeat, Context ctx)
+		[WebGet(UriTemplate = "/db")]
+		public World SingleQuery()
 		{
 		{
-			var worlds = ctx.Worlds;
-			var repository = ctx.WorldRepository;
-			for (int i = 0; i < repeat; i++)
-			{
-				var id = Random.Next(10000) + 1;
-				worlds[i] = repository.Find(IDs[id]);
-			}
+			var ctx = Context.Value;
+			var id = ctx.Random.Next(10000) + 1;
+			return ctx.WorldRepository.Find(id);
 		}
 		}
 
 
-		public Stream MultipleQueries(string count)
+		//while IList<World> would work, it would fall back to IEnumerable<IJsonObject> which would create garbage
+		[WebGet(UriTemplate = "/queries/{count}")]
+		public IList<IJsonObject> MultipleQueries(string count, IResponseContext response)
 		{
 		{
 			int repeat;
 			int repeat;
 			int.TryParse(count, out repeat);
 			int.TryParse(count, out repeat);
 			if (repeat < 1) repeat = 1;
 			if (repeat < 1) repeat = 1;
 			else if (repeat > 500) repeat = 500;
 			else if (repeat > 500) repeat = 500;
-			var ctx = GetContext(Services);
-			LoadWorldsSlow(repeat, ctx);
-			var cms = ctx.Stream;
-			ctx.Worlds.Serialize(cms, repeat);
-			ThreadContext.Response.ContentType = "application/json";
-			return cms;
+			var ctx = Context.Value;
+			ctx.LoadWorldsSlow(repeat, ctx.Worlds);
+			return new ArraySegment<IJsonObject>(ctx.Worlds, 0, repeat);
 		}
 		}
 
 
 		private static readonly Comparison<World> ASC = (l, r) => l.id - r.id;
 		private static readonly Comparison<World> ASC = (l, r) => l.id - r.id;
 
 
-		public Stream Updates(string count)
+		[WebGet(UriTemplate = "/updates/{count}")]
+		public World[] Updates(string count)
 		{
 		{
 			int repeat;
 			int repeat;
 			int.TryParse(count, out repeat);
 			int.TryParse(count, out repeat);
 			if (repeat < 1) repeat = 1;
 			if (repeat < 1) repeat = 1;
 			else if (repeat > 500) repeat = 500;
 			else if (repeat > 500) repeat = 500;
-			var ctx = GetContext(Services);
-			LoadWorldsSlow(repeat, ctx);
+			var ctx = Context.Value;
 			var result = new World[repeat];
 			var result = new World[repeat];
-			Array.Copy(ctx.Worlds, result, repeat);
+			ctx.LoadWorldsSlow(repeat, result);
 			for (int i = 0; i < result.Length; i++)
 			for (int i = 0; i < result.Length; i++)
-				result[i].randomNumber = Random.Next(10000) + 1;
+				result[i].randomNumber = ctx.Random.Next(10000) + 1;
 			Array.Sort(result, ASC);
 			Array.Sort(result, ASC);
 			ctx.WorldRepository.Update(result);
 			ctx.WorldRepository.Update(result);
-			var cms = ctx.Stream;
-			result.Serialize(cms);
-			ThreadContext.Response.ContentType = "application/json";
-			return cms;
+			return result;
 		}
 		}
 
 
 		private static readonly Comparison<KeyValuePair<int, string>> Comparison = (l, r) => string.Compare(l.Value, r.Value, StringComparison.Ordinal);
 		private static readonly Comparison<KeyValuePair<int, string>> Comparison = (l, r) => string.Compare(l.Value, r.Value, StringComparison.Ordinal);
 
 
-		public Stream Fortunes()
+		[WebGet(UriTemplate = "/fortunes")]
+		public Fortunes Fortunes()
 		{
 		{
-			var ctx = GetContext(Services);
+			var ctx = Context.Value;
 			var fortunes = ctx.FortuneRepository.Search();
 			var fortunes = ctx.FortuneRepository.Search();
 			var list = new List<KeyValuePair<int, string>>(fortunes.Length + 1);
 			var list = new List<KeyValuePair<int, string>>(fortunes.Length + 1);
 			foreach (var f in fortunes)
 			foreach (var f in fortunes)
 				list.Add(new KeyValuePair<int, string>(f.id, f.message));
 				list.Add(new KeyValuePair<int, string>(f.id, f.message));
 			list.Add(new KeyValuePair<int, string>(0, "Additional fortune added at request time."));
 			list.Add(new KeyValuePair<int, string>(0, "Additional fortune added at request time."));
 			list.Sort(Comparison);
 			list.Sort(Comparison);
-			var cms = ctx.Stream;
-			var writer = cms.GetWriter();
-			var template = new Fortunes(list, writer);
-			template.TransformText();
-			writer.Flush();
-			cms.Position = 0;
-			ThreadContext.Response.ContentType = "text/html; charset=UTF-8";
-			return cms;
+			return new Fortunes(list);
 		}
 		}
 	}
 	}
 }
 }

+ 13 - 30
frameworks/CSharp/revenj/Revenj.Bench/Revenj.Bench.csproj

@@ -10,8 +10,9 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Revenj.Bench</RootNamespace>
     <RootNamespace>Revenj.Bench</RootNamespace>
     <AssemblyName>Revenj.Bench</AssemblyName>
     <AssemblyName>Revenj.Bench</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugSymbols>true</DebugSymbols>
@@ -21,6 +22,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <DebugType>pdbonly</DebugType>
@@ -29,43 +31,24 @@
     <DefineConstants>TRACE</DefineConstants>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
-    <Reference Include="Revenj.Api.Interface">
+    <Reference Include="Revenj.Api.Interface" >
       <HintPath>..\exe\Revenj.Api.Interface.dll</HintPath>
       <HintPath>..\exe\Revenj.Api.Interface.dll</HintPath>
-      <Private>False</Private>
     </Reference>
     </Reference>
-    <Reference Include="Revenj.DatabasePersistence.Interface">
-      <HintPath>..\exe\Revenj.DatabasePersistence.Interface.dll</HintPath>
-      <Private>False</Private>
+    <Reference Include="Revenj.Core" >
+      <HintPath>..\exe\Revenj.Core.dll</HintPath>
     </Reference>
     </Reference>
-    <Reference Include="Revenj.DatabasePersistence.Postgres">
-      <HintPath>..\exe\Revenj.DatabasePersistence.Postgres.dll</HintPath>
-      <Private>False</Private>
+    <Reference Include="Revenj.Core.Interface" >
+      <HintPath>..\exe\Revenj.Core.Interface.dll</HintPath>
     </Reference>
     </Reference>
-    <Reference Include="Revenj.DomainPatterns.Interface">
-      <HintPath>..\exe\Revenj.DomainPatterns.Interface.dll</HintPath>
-      <Private>False</Private>
+    <Reference Include="Revenj.Http">
+      <HintPath>..\exe\Revenj.Http.exe</HintPath>
+      <ExecutableExtension>.exe</ExecutableExtension>
     </Reference>
     </Reference>
-    <Reference Include="Revenj.Extensibility.Interface">
-      <HintPath>..\exe\Revenj.Extensibility.Interface.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Revenj.Processing">
+    <Reference Include="Revenj.Processing" >
       <HintPath>..\exe\Revenj.Processing.dll</HintPath>
       <HintPath>..\exe\Revenj.Processing.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Revenj.Serialization">
-      <HintPath>..\exe\Revenj.Serialization.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Revenj.Serialization.Interface">
-      <HintPath>..\exe\Revenj.Serialization.Interface.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Revenj.Utility">
-      <HintPath>..\exe\Revenj.Utility.dll</HintPath>
-      <Private>False</Private>
     </Reference>
     </Reference>
     <Reference Include="ServerModel">
     <Reference Include="ServerModel">
       <HintPath>..\exe\ServerModel.dll</HintPath>
       <HintPath>..\exe\ServerModel.dll</HintPath>

+ 3 - 10
frameworks/CSharp/revenj/Revenj.Http.exe.config

@@ -1,30 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 <configuration>
   <configSections>
   <configSections>
-    <section name="autofacConfiguration" type="Revenj.Extensibility.Autofac.Configuration.SectionHandler, Revenj.Extensibility" />
+    <section name="autofacConfiguration" type="Revenj.Extensibility.Autofac.Configuration.SectionHandler, Revenj.Core" />
   </configSections>
   </configSections>
   <appSettings>
   <appSettings>
     <add key="PluginsPath" value="." />
     <add key="PluginsPath" value="." />
     <add key="ServerAssembly" value="ServerModel.dll"/>
     <add key="ServerAssembly" value="ServerModel.dll"/>
     <add key="ConnectionString" value="server=localhost;port=5432;database=hello_world;user=benchmarkdbuser;password=benchmarkdbpass" />
     <add key="ConnectionString" value="server=localhost;port=5432;database=hello_world;user=benchmarkdbuser;password=benchmarkdbpass" />
     <add key="HttpAddress_local" value="http://0.0.0.0:8080/" />
     <add key="HttpAddress_local" value="http://0.0.0.0:8080/" />
-    <add key="Revenj.HttpServer" value="Socket"/>
+    <add key="Revenj.HttpServer" value="Revenj"/>
     <add key="CustomAuth" value="Revenj.Http.NoAuth"/>
     <add key="CustomAuth" value="Revenj.Http.NoAuth"/>
     <add key="Revenj.Notifications" value="disabled"/>
     <add key="Revenj.Notifications" value="disabled"/>
   </appSettings>
   </appSettings>
-  <system.serviceModel>
-    <serviceHostingEnvironment>
-      <serviceActivations>
-        <add relativeAddress="bench" service="Revenj.Bench.RestService, Revenj.Bench" />
-      </serviceActivations>
-    </serviceHostingEnvironment>
-  </system.serviceModel>
   <autofacConfiguration>
   <autofacConfiguration>
     <modules>
     <modules>
       <module type="Revenj.Wcf.StandardModule, Revenj.Wcf" />
       <module type="Revenj.Wcf.StandardModule, Revenj.Wcf" />
     </modules>
     </modules>
     <components>
     <components>
-      <component type="Revenj.Http.NoAuth, Revenj.Http" service="Revenj.Security.IPermissionManager, Revenj.Security.Interface" />
+      <component type="Revenj.Http.NoAuth, Revenj.Http" service="Revenj.Security.IPermissionManager, Revenj.Core.Interface" />
     </components>
     </components>
   </autofacConfiguration>
   </autofacConfiguration>
 </configuration>
 </configuration>

+ 2 - 2
frameworks/CSharp/revenj/setup.ps1

@@ -39,11 +39,11 @@ if ($action -eq 'start') {
 
 
 	echo "Download DSL compiler client"
 	echo "Download DSL compiler client"
 	$client = new-object System.Net.WebClient
 	$client = new-object System.Net.WebClient
-	$client.DownloadFile( "https://github.com/ngs-doo/dsl-compiler-client/releases/download/1.7.0/dsl-clc.jar", $dslclc )
+	$client.DownloadFile( "https://github.com/ngs-doo/dsl-compiler-client/releases/download/1.8.2/dsl-clc.jar", $dslclc )
 
 
 	echo "Download Revenj HTTP server"
 	echo "Download Revenj HTTP server"
 	$client = new-object System.Net.WebClient
 	$client = new-object System.Net.WebClient
-	$client.DownloadFile( "https://github.com/ngs-doo/revenj/releases/download/1.3.1/http-server.zip", $httpZip )
+	$client.DownloadFile( "https://github.com/ngs-doo/revenj/releases/download/1.4.1/http-server.zip", $httpZip )
 
 
 	echo "Unzipping HTTP server"
 	echo "Unzipping HTTP server"
 	[System.IO.Compression.ZipFile]::ExtractToDirectory($httpZip, $exe)
 	[System.IO.Compression.ZipFile]::ExtractToDirectory($httpZip, $exe)

+ 3 - 3
frameworks/CSharp/revenj/setup.sh

@@ -6,10 +6,10 @@ echo "Cleaning up..."
 rm -rf $TROOT/exe $TROOT/tmp $TROOT/dsl-clc.jar $TROOT/http-server.zip
 rm -rf $TROOT/exe $TROOT/tmp $TROOT/dsl-clc.jar $TROOT/http-server.zip
 
 
 echo "Download DSL compiler client"
 echo "Download DSL compiler client"
-wget -O $TROOT/dsl-clc.jar https://github.com/ngs-doo/dsl-compiler-client/releases/download/1.7.0/dsl-clc.jar
+wget -O $TROOT/dsl-clc.jar https://github.com/ngs-doo/dsl-compiler-client/releases/download/1.8.2/dsl-clc.jar
 
 
-echo "Download Revenj.NET HTTP server 1.3.1"
-wget -O $TROOT/http-server.zip https://github.com/ngs-doo/revenj/releases/download/1.3.1/http-server.zip
+echo "Download Revenj.NET HTTP server 1.4.1"
+wget -O $TROOT/http-server.zip https://github.com/ngs-doo/revenj/releases/download/1.4.1/http-server.zip
 
 
 echo "Unzipping HTTP server"
 echo "Unzipping HTTP server"
 unzip $TROOT/http-server.zip -d $TROOT/exe
 unzip $TROOT/http-server.zip -d $TROOT/exe

+ 2 - 2
frameworks/Java/revenj/README.md

@@ -24,8 +24,8 @@ The tests were run with:
  * [Oracle Java 1.8](https://www.oracle.com/java/)
  * [Oracle Java 1.8](https://www.oracle.com/java/)
  * [Postgres 9.3](http://www.postgresql.org/)
  * [Postgres 9.3](http://www.postgresql.org/)
  * [Resin 4.0](http://www.caucho.com/)
  * [Resin 4.0](http://www.caucho.com/)
- * [DSL JSON 1.0.0](http://github.com/ngs-doo/dsl-json)
- * [Revenj.Java 0.9.7](http://github.com/ngs-doo/revenj)
+ * [DSL JSON 1.2.0](http://github.com/ngs-doo/dsl-json)
+ * [Revenj.Java 1.0.2](http://github.com/ngs-doo/revenj)
 
 
 ## Test URLs
 ## Test URLs
 
 

+ 8 - 8
frameworks/Java/revenj/pom.xml

@@ -6,7 +6,7 @@
 	<artifactId>revenj</artifactId>
 	<artifactId>revenj</artifactId>
 	<name>Revenj.JVM</name>
 	<name>Revenj.JVM</name>
 	<packaging>war</packaging>
 	<packaging>war</packaging>
-	<version>1.0.0</version>
+	<version>1.0.2</version>
 	<properties>
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 	</properties>
 	</properties>
@@ -14,13 +14,13 @@
 		<dependency>
 		<dependency>
 			<groupId>org.revenj</groupId>
 			<groupId>org.revenj</groupId>
 			<artifactId>revenj-core</artifactId>
 			<artifactId>revenj-core</artifactId>
-			<version>0.9.9</version>
+			<version>1.0.2</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>3.4</version>
 		</dependency>
 		</dependency>
-                <dependency>
-                        <groupId>org.apache.commons</groupId>
-                        <artifactId>commons-lang3</artifactId>
-                        <version>3.4</version>
-                </dependency>
 		<dependency>
 		<dependency>
 			<groupId>javax.servlet</groupId>
 			<groupId>javax.servlet</groupId>
 			<artifactId>servlet-api</artifactId>
 			<artifactId>servlet-api</artifactId>
@@ -33,7 +33,7 @@
 			<plugin>
 			<plugin>
 				<groupId>com.dslplatform</groupId>
 				<groupId>com.dslplatform</groupId>
 				<artifactId>dsl-platform-maven-plugin</artifactId>
 				<artifactId>dsl-platform-maven-plugin</artifactId>
-				<version>0.9</version>
+				<version>1.0.1</version>
 				<executions>
 				<executions>
 					<execution>
 					<execution>
 						<phase>generate-sources</phase>
 						<phase>generate-sources</phase>

+ 5 - 5
frameworks/Java/revenj/src/main/java/hello/Context.java

@@ -33,9 +33,9 @@ class Context {
 	public final FortuneRepository fortunes;
 	public final FortuneRepository fortunes;
 	public final Connection connection;
 	public final Connection connection;
 	private final ThreadLocalRandom random;
 	private final ThreadLocalRandom random;
-	public final RepositoryBulkReader bulkReader;
+	//public final RepositoryBulkReader bulkReader;
 	private final World[] buffer = new World[512];
 	private final World[] buffer = new World[512];
-	private final Callable[] callables = new Callable[512];
+	//private final Callable[] callables = new Callable[512];
 
 
 	public Context() {
 	public Context() {
 		try {
 		try {
@@ -47,7 +47,7 @@ class Context {
 			this.random = ThreadLocalRandom.current();
 			this.random = ThreadLocalRandom.current();
 			this.worlds = ctx.resolve(WorldRepository.class);
 			this.worlds = ctx.resolve(WorldRepository.class);
 			this.fortunes = ctx.resolve(FortuneRepository.class);
 			this.fortunes = ctx.resolve(FortuneRepository.class);
-			this.bulkReader = ctx.resolve(RepositoryBulkReader.class);
+			//this.bulkReader = ctx.resolve(RepositoryBulkReader.class);
 		} catch (Exception e) {
 		} catch (Exception e) {
 			throw new RuntimeException(e);
 			throw new RuntimeException(e);
 		}
 		}
@@ -58,7 +58,7 @@ class Context {
 	}
 	}
 
 
 	/* bulk loading of worlds. use such pattern for production code */
 	/* bulk loading of worlds. use such pattern for production code */
-	@SuppressWarnings("unchecked")
+	/*@SuppressWarnings("unchecked")
 	public World[] loadWorldsFast(final int count) throws IOException {
 	public World[] loadWorldsFast(final int count) throws IOException {
 		bulkReader.reset();
 		bulkReader.reset();
 		for (int i = 0; i < count; i++) {
 		for (int i = 0; i < count; i++) {
@@ -73,7 +73,7 @@ class Context {
 			throw new IOException(e);
 			throw new IOException(e);
 		}
 		}
 		return buffer;
 		return buffer;
-	}
+	}*/
 
 
 	/* multiple roundtrips loading of worlds. don't write such production code */
 	/* multiple roundtrips loading of worlds. don't write such production code */
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")

+ 3 - 3
toolset/setup/linux/languages/dsl_platform.sh

@@ -1,11 +1,11 @@
 #!/bin/bash
 #!/bin/bash
 
 
-RETCODE=$(fw_exists ${IROOT}/dsl-compiler-1.6.installed)
+RETCODE=$(fw_exists ${IROOT}/dsl-compiler-1.7.installed)
 [ ! "$RETCODE" == 0 ] || { \
 [ ! "$RETCODE" == 0 ] || { \
   return 0; }
   return 0; }
 
 
-wget -O $IROOT/dsl-compiler.zip https://github.com/ngs-doo/revenj/releases/download/1.4.0/dsl-compiler.zip
+wget -O $IROOT/dsl-compiler.zip https://github.com/ngs-doo/revenj/releases/download/1.4.1/dsl-compiler.zip
 unzip -o $IROOT/dsl-compiler.zip -d $IROOT
 unzip -o $IROOT/dsl-compiler.zip -d $IROOT
 rm $IROOT/dsl-compiler.zip
 rm $IROOT/dsl-compiler.zip
 
 
-echo "1.6" > $IROOT/dsl-compiler-1.6.installed
+echo "1.7" > $IROOT/dsl-compiler-1.7.installed