Skip to content

Commit

Permalink
Use paket magic mode to ensure v4.4.0
Browse files Browse the repository at this point in the history
Add Benchmark.csproj
Use some C# 7 features in AST composition
  • Loading branch information
bchavez committed Apr 25, 2017
1 parent cb56e79 commit 4eb6361
Show file tree
Hide file tree
Showing 19 changed files with 489 additions and 208 deletions.
Binary file renamed .paket/paket.bootstrapper.exe → .paket/paket.exe
Binary file not shown.
62 changes: 0 additions & 62 deletions .paket/paket.targets

This file was deleted.

8 changes: 6 additions & 2 deletions Builder/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ let TestGridProject = TestProject("RethinkDb.Driver.ReGrid.Tests", Folders)

open AssemblyInfoFile

let MakeAttributes (includeSnk:bool) (testProjects : string list ) =
let MakeAttributes (includeSnk:bool) (testProjects : string list ) =
let attrs = [
Attribute.Description GitHubUrl
Attribute.Description GitHubUrl
]
@ if not includeSnk then
[ Attribute.InternalsVisibleTo("Benchmark") ]
else
[]

let mapInternalName (projectName : string) =
if includeSnk then
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v2.3.18
* Use some C# 7 features in AST composition for performance.

## v2.3.17
* Move to Visual Studio 2017 RTM Build Tools
* .NET Core Tooling and Framework Reference Update
Expand Down
66 changes: 66 additions & 0 deletions Source/Benchmark/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.FileVersionInfo" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
56 changes: 56 additions & 0 deletions Source/Benchmark/BenchReqlAst.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Exporters;
using RethinkDb.Driver;
using RethinkDb.Driver.Ast;

namespace Benchmark
{
[RPlotExporter]
public class BenchReqlAst
{
RethinkDB R = RethinkDB.R;

[Benchmark]
public void CSharp7()
{
R.Db("Test")
.Table("Foo")
.Insert(new
{
someValue = "fff",
someObject = new
{
someNested = 25,
someNested2 = false
},
someOtherProp = Guid.Parse("E111E216-EBD6-47CE-B2DE-CE5F60E2FA8F")
})
.Filter( x => x["someRow"] == 25)
.Filter( x => x["someOtherRow"].Gt(44))
.Delete()
.Build();
}

[Benchmark]
public void CSharp6()
{
R.Db("Test")
.Table("Foo")
.Insert(new
{
someValue = "fff",
someObject = new
{
someNested = 25,
someNested2 = false
},
someOtherProp = Guid.Parse("E111E216-EBD6-47CE-B2DE-CE5F60E2FA8F")
})
.Filter(x => x["someRow"] == 25)
.Filter(x => x["someOtherRow"].Gt(44))
.Delete()
.Build();
}
}
}
Loading

0 comments on commit 4eb6361

Please sign in to comment.