Commit c270d6bb authored by Marc Gravell's avatar Marc Gravell

Windows monobuild sorted

parent c2ee411b
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BE213DFB-5334-4441-B975-0DBCFD5F5A73}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BasicTest</RootNamespace>
<AssemblyName>BasicTest</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj">
<Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project>
<Name>StackExchange.Redis</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using StackExchange.Redis;
namespace BasicTest
{
class Program
{
static void Main()
{
MassiveBulkOpsAsync(true, true);
MassiveBulkOpsAsync(true, false);
MassiveBulkOpsAsync(false, true);
MassiveBulkOpsAsync(false, false);
}
const int AsyncOpsQty = 100000;
static void MassiveBulkOpsAsync(bool preserveOrder, bool withContinuation)
{
using (var muxer = ConnectionMultiplexer.Connect("127.0.0.1"))
{
muxer.PreserveAsyncOrder = preserveOrder;
RedisKey key = "MBOA";
var conn = muxer.GetDatabase();
muxer.Wait(conn.PingAsync());
Action<Task> nonTrivial = delegate
{
Thread.SpinWait(5);
};
var watch = Stopwatch.StartNew();
for (int i = 0; i <= AsyncOpsQty; i++)
{
var t = conn.StringSetAsync(key, i);
if (withContinuation) t.ContinueWith(nonTrivial);
}
int val = (int)muxer.Wait(conn.StringGetAsync(key));
watch.Stop();
Console.WriteLine("After {0}: {1}", AsyncOpsQty, val);
Console.WriteLine("({3}, {4})\r\n{2}: Time for {0} ops: {1}ms; ops/s: {5}", AsyncOpsQty, watch.ElapsedMilliseconds, Me(),
withContinuation ? "with continuation" : "no continuation", preserveOrder ? "preserve order" : "any order",
AsyncOpsQty / watch.Elapsed.TotalSeconds);
}
}
protected static string Me([CallerMemberName] string caller = null)
{
return caller;
}
}
}
......@@ -34,6 +34,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Redis Configs", "Redis Conf
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{709E0CE4-F0BA-4933-A4FD-4A8B6668A5D4}"
ProjectSection(SolutionItems) = preProject
monobuild.bash = monobuild.bash
monobuild.cmd = monobuild.cmd
StackExchange.Redis.nuspec = StackExchange.Redis.nuspec
EndProjectSection
EndProject
......@@ -41,6 +43,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionWatcher", "Connec
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Docs", "Docs\Docs.csproj", "{7909952C-0F38-4E62-A7BA-1A77E1452FDA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTest", "BasicTest\BasicTest.csproj", "{BE213DFB-5334-4441-B975-0DBCFD5F5A73}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -81,6 +85,14 @@ Global
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Release|Any CPU.Build.0 = Release|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{7909952C-0F38-4E62-A7BA-1A77E1452FDA}.Verbose|Any CPU.Build.0 = Release|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Log Output|Any CPU.Build.0 = Release|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Release|Any CPU.Build.0 = Release|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{BE213DFB-5334-4441-B975-0DBCFD5F5A73}.Verbose|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
rm -rf StackExchange.Redis/bin/mono
rm -rf BasicTest/bin/mono
mkdir StackExchange.Redis/bin/mono
mcs -recurse:StackExchange.Redis/*.cs -out:StackExchange.Redis/bin/mono/StackExchange.Redis.dll -target:library -unsafe+ -r:System.IO.Compression.dll -d:MONO
mkdir BasicTest/bin/mono
mcs -recurse:StackExchange.Redis/*.cs -out:StackExchange.Redis/bin/mono/StackExchange.Redis.dll -target:library -unsafe+ -o+ -r:System.IO.Compression.dll -d:MONO
mcs BasicTest/Program.cs -out:BasicTest/bin/mono/BasicTest.exe -target:exe -o+ -r:StackExchange.Redis/bin/mono/StackExchange.Redis.dll
rm -rf StackExchange.Redis\bin\mono
mkdir StackExchange.Redis\bin\mono
mcs -recurse:StackExchange.Redis\*.cs -out:StackExchange.Redis\bin\mono\StackExchange.Redis.dll -target:library -unsafe+ -r:System.IO.Compression.dll -d:MONO
@rd /s /q StackExchange.Redis\bin\mono
@rd /s /q BasicTest\bin\mono
@md StackExchange.Redis\bin\mono
@call mcs -recurse:StackExchange.Redis\*.cs -out:StackExchange.Redis\bin\mono\StackExchange.Redis.dll -target:library -unsafe+ -r:System.IO.Compression.dll -d:MONO
\ No newline at end of file
@md BasicTest\bin\mono
@echo Building StackExchange.Redis.dll ...
@call mcs -recurse:StackExchange.Redis\*.cs -out:StackExchange.Redis\bin\mono\StackExchange.Redis.dll -target:library -unsafe+ -o+ -r:System.IO.Compression.dll -d:MONO
@echo Building BasicTest.exe ...
@call mcs BasicTest\Program.cs -out:BasicTest\bin\mono\BasicTest.exe -target:exe -o+ -r:StackExchange.Redis\bin\mono\StackExchange.Redis.dll
@copy StackExchange.Redis\bin\mono\*.* BasicTest\bin\mono > nul
@call BasicTest\bin\mono\BasicTest.exe
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment