Permalink
Browse files

setup initial scene

  • Loading branch information...
1 parent 2e3636f commit f3c77f29055b602f436e4dc8bddcea89d5db15d0 @neuecc committed Jan 8, 2017
@@ -1,6 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Text;
@@ -142,4 +143,74 @@ public void Update()
}
}
+
+ public class ImmutableDictionary_Test : ITest
+ {
+ private string _filename;
+ private int _count;
+
+ ImmutableDictionary<int, TestDoc> dict;
+
+ public int Count { get { return _count; } }
+ public int FileLength { get { return (int)new FileInfo(_filename).Length; } }
+
+ public ImmutableDictionary_Test(int count)
+ {
+ _count = count;
+ _filename = "immutabledict-" + Guid.NewGuid().ToString("n") + ".db";
+ //dict = new ImmutableDictionary<int, TestPerfLiteDB.TestDoc>();
+ }
+
+ public void Insert()
+ {
+ var builder = ImmutableDictionary.CreateBuilder<int, TestDoc>();
+ foreach (var doc in Helper.GetDocs(_count))
+ {
+ var v = new TestDoc
+ {
+ id = doc["_id"].AsInt32,
+ name = doc["name"].AsString,
+ lorem = doc["lorem"].AsString
+ };
+
+ builder.Add(v.id, v);
+ }
+
+ dict = builder.ToImmutableDictionary();
+ }
+
+ public void Bulk()
+ {
+
+ }
+
+ public void CreateIndex()
+ {
+
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public void Prepare()
+ {
+
+ }
+
+ public void Query()
+ {
+ for (var i = 0; i < _count; i++)
+ {
+ TestDoc d;
+ dict.TryGetValue(i, out d);
+ }
+ }
+
+ public void Update()
+ {
+
+ }
+ }
}
@@ -29,6 +29,7 @@ static void Main(string[] args)
RunTest("Dictionary", new Dictionary_Test(5000));
RunTest("ConcurrentDictionary", new ConcurrentDictionary_Test(5000));
+ RunTest("ImmutableDictionary", new ImmutableDictionary_Test(5000));
RunTest("MasterMemory: Plain", new MasterMemory_Test(5000));
RunTest("MasterMemory: Loaded", new MasterMemoryDatabase_Test(5000));
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{EB6BB23F-48B9-294C-2047-886B6B94A5E7}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AssemblyName>Assembly-CSharp</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>
+ <CompilerResponseFile></CompilerResponseFile>
+ <UnityProjectType>Game:1</UnityProjectType>
+ <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
+ <UnityVersion>5.3.7p2</UnityVersion>
+ <RootNamespace></RootNamespace>
+ <LangVersion Condition=" '$(VisualStudioVersion)' != '10.0' ">4</LangVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
+ <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_7;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
+ <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_7;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.XML" />
+ <Reference Include="System.Core" />
+ <Reference Include="Boo.Lang" />
+ <Reference Include="UnityScript.Lang" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="UnityEngine">
+ <HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Networking">
+ <HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.Networking">
+ <HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEngine.UI">
+ <HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor">
+ <HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.iOS.Extensions.Xcode">
+ <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
+ </Reference>
+ <Reference Include="UnityEditor.iOS.Extensions.Common">
+ <HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Common.dll</HintPath>
+ </Reference>
+ <Reference Include="ZeroFormatter">
+ <HintPath>Assets\ZeroFormatter\ZeroFormatter.dll</HintPath>
+ </Reference>
+ <Reference Include="ZeroFormatter.Interfaces">
+ <HintPath>Assets\ZeroFormatter\ZeroFormatter.Interfaces.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Assets\MasterMemory\Database.cs" />
+ <Compile Include="Assets\MasterMemory\Internal\BinarySearch.cs" />
+ <Compile Include="Assets\MasterMemory\Internal\DictionaryView.cs" />
+ <Compile Include="Assets\MasterMemory\Internal\ExpandableArray.cs" />
+ <Compile Include="Assets\MasterMemory\Internal\KeyTupleComparerRegister.cs" />
+ <Compile Include="Assets\MasterMemory\Internal\KeyTupleMemory.cs" />
+ <Compile Include="Assets\MasterMemory\Internal\LookupView.cs" />
+ <Compile Include="Assets\MasterMemory\KeyTupleComparer.cs" />
+ <Compile Include="Assets\MasterMemory\MasterMemoryComparer.cs" />
+ <Compile Include="Assets\MasterMemory\Memory.cs" />
+ <Compile Include="Assets\MasterMemory\RangeView.cs" />
+ <Compile Include="Assets\RuntimeUnitTestToolkit\Assert.cs" />
+ <Compile Include="Assets\RuntimeUnitTestToolkit\ChainingAssertion.Unity.cs" />
+ <Compile Include="Assets\RuntimeUnitTestToolkit\UnitTestRunner.cs" />
+ <Compile Include="Assets\Scripts\BinarySearchTest.cs" />
+ <Compile Include="Assets\Scripts\DatabaseTest.cs" />
+ <Compile Include="Assets\Scripts\KeyTupleMemoryTest.cs" />
+ <Compile Include="Assets\Scripts\Loader.cs" />
+ <Compile Include="Assets\Scripts\MemoryTest.cs" />
+ <Compile Include="Assets\Scripts\RangeViewTest.cs" />
+ <Compile Include="Assets\Scripts\ZeroFormatterGenerated.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2015\UnityVS.CSharp.targets" />
+</Project>
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2015
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MasterMemory.UnityClient.CSharp", "MasterMemory.UnityClient.CSharp.csproj", "{EB6BB23F-48B9-294C-2047-886B6B94A5E7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EB6BB23F-48B9-294C-2047-886B6B94A5E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EB6BB23F-48B9-294C-2047-886B6B94A5E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EB6BB23F-48B9-294C-2047-886B6B94A5E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EB6BB23F-48B9-294C-2047-886B6B94A5E7}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

0 comments on commit f3c77f2

Please sign in to comment.