Permalink
Browse files

initial import

  • Loading branch information...
0 parents commit ea64f4feae7288b8b34b952d4fb1806feef12461 @sdether committed May 5, 2010
Showing with 36,063 additions and 0 deletions.
  1. +18 −0 Firkin.Test.Perf/App.config
  2. +30 −0 Firkin.Test.Perf/Diagnostics.cs
  3. +86 −0 Firkin.Test.Perf/Firkin.Test.Perf.csproj
  4. +38 −0 Firkin.Test.Perf/Properties/AssemblyInfo.cs
  5. +12 −0 Firkin.Test.Perf/Stackoverflow/Badge.cs
  6. +15 −0 Firkin.Test.Perf/Stackoverflow/Comment.cs
  7. +56 −0 Firkin.Test.Perf/Stackoverflow/Post.cs
  8. +52 −0 Firkin.Test.Perf/Stackoverflow/User.cs
  9. +31 −0 Firkin.Test.Perf/Stackoverflow/Votes.cs
  10. +167 −0 Firkin.Test.Perf/TStackoverflow.cs
  11. +18 −0 Firkin.Test/App.config
  12. +81 −0 Firkin.Test/Firkin.Test.csproj
  13. +38 −0 Firkin.Test/Properties/AssemblyInfo.cs
  14. +51 −0 Firkin.Test/TFirkinFile.cs
  15. +416 −0 Firkin.Test/TFirkinHash.cs
  16. +37 −0 Firkin.sln
  17. +26 −0 Firkin/Data/HintRecord.cs
  18. +23 −0 Firkin/Data/IKeySerializer.cs
  19. +32 −0 Firkin/Data/KeyInfo.cs
  20. +26 −0 Firkin/Data/KeyValuePair.cs
  21. +28 −0 Firkin/Data/KeyValueRecord.cs
  22. +78 −0 Firkin/Firkin.csproj
  23. +405 −0 Firkin/FirkinHash.cs
  24. +30 −0 Firkin/IFirkinHash.cs
  25. +239 −0 Firkin/IO/FirkinFile.cs
  26. +90 −0 Firkin/IO/FirkinHintFile.cs
  27. +25 −0 Firkin/IO/IFirkinActiveFile.cs
  28. +24 −0 Firkin/IO/IFirkinArchiveFile.cs
  29. +33 −0 Firkin/IO/IFirkinFile.cs
  30. +26 −0 Firkin/IO/IFirkinHintFile.cs
  31. +68 −0 Firkin/IO/StreamView.cs
  32. +36 −0 Firkin/Properties/AssemblyInfo.cs
  33. +54 −0 Firkin/Util/ArrayEx.cs
  34. +62 −0 Firkin/Util/StreamEx.cs
  35. +52 −0 README.rst
  36. BIN redist/Moq.dll
  37. +3,314 −0 redist/Moq.xml
  38. BIN redist/log4net.dll
  39. +28,655 −0 redist/log4net.xml
  40. BIN redist/nunit.framework.dll
  41. BIN redist/protobuf-net.dll
  42. +1,591 −0 redist/protobuf-net.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
+ </configSections>
+ <log4net>
+ <!--Use this appender to log to the console.-->
+ <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
+ <layout type="log4net.Layout.PatternLayout">
+ <conversionPattern value="%date{MM/dd HH:mm:ss} [%thread] %p : %C : %m%n" />
+ </layout>
+ </appender>
+ <root>
+ <level value="DEBUG" />
+ <appender-ref ref="ConsoleAppender" />
+ </root>
+ </log4net>
+</configuration>
@@ -0,0 +1,30 @@
+/*
+ * Firkin
+ * Copyright (C) 2010 Arne F. Claassen
+ * http://www.claassen.net/geek/blog geekblog [at] claassen [dot] net
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Diagnostics;
+
+namespace Droog.Firkin.Test.Perf {
+ public static class Diagnostics {
+ public static TimeSpan Time(Action action) {
+ var stopwatch = Stopwatch.StartNew();
+ action();
+ stopwatch.Stop();
+ return stopwatch.Elapsed;
+ }
+ }
+}
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C76884C3-3BEF-4B22-8808-4F547417B90D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Droog.Firkin.Test.Perf</RootNamespace>
+ <AssemblyName>Droog.Firkin.Test.Perf</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <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' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\redist\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\redist\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="protobuf-net, Version=1.0.0.274, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\redist\protobuf-net.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Diagnostics.cs" />
+ <Compile Include="Stackoverflow\Comment.cs" />
+ <Compile Include="Stackoverflow\Post.cs" />
+ <Compile Include="Stackoverflow\User.cs" />
+ <Compile Include="Stackoverflow\Votes.cs" />
+ <Compile Include="TStackoverflow.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Stackoverflow\Badge.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Firkin\Firkin.csproj">
+ <Project>{F5F73918-C281-4A75-93E6-C2D2D148D18A}</Project>
+ <Name>Firkin</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ </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>
@@ -0,0 +1,38 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Droog.Firkin.Test.Perf")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Droog.Firkin.Test.Perf")]
+[assembly: AssemblyCopyright("Copyright © Arne F. Claassen 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5d3a8b58-107f-4151-9d17-fab52ea0aeef")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Droog.Firkin.Test.Perf.Stackoverflow {
+ public class Badge {
+ public int UserId;
+ public string Name;
+ public DateTime Date;
+ }
+}
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Droog.Firkin.Test.Perf.Stackoverflow {
+ public class Comment {
+ public int Id;
+ public int PostId;
+ public int Score;
+ public string Text;
+ public DateTime CreateDate;
+ public int UserId;
+ }
+}
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+namespace Droog.Firkin.Test.Perf.Stackoverflow {
+ [XmlRoot("row")]
+ public class Post {
+ [XmlAttribute]
+ public int Id;
+ [XmlAttribute]
+ public PostType PostType;
+ [XmlAttribute]
+ public int? ParentId;
+ [XmlAttribute]
+ public int? AcceptedAnswerId;
+ [XmlAttribute]
+ public DateTime CreationDate;
+ [XmlAttribute]
+ public int Score;
+ [XmlAttribute]
+ public int ViewCount;
+ [XmlAttribute]
+ public string Body;
+ [XmlAttribute]
+ public int OwnerUserId;
+ [XmlAttribute]
+ public int LastEditorUserId;
+ [XmlAttribute]
+ public string LastEditorDisplayname;
+ [XmlAttribute]
+ public DateTime? LastEditDate;
+ [XmlAttribute]
+ public DateTime? LastActivityDate;
+ [XmlAttribute]
+ public DateTime? CommunityOnwedDate;
+ [XmlAttribute]
+ public DateTime? ClosedDate;
+ [XmlAttribute]
+ public string Title;
+ [XmlAttribute]
+ public string Tags;
+ [XmlAttribute]
+ public int AnswerCount;
+ [XmlAttribute]
+ public int CommentCount;
+ [XmlAttribute]
+ public int FavoriteCount;
+ }
+
+ public enum PostType {
+ Question = 1,
+ Answer = 2
+ }
+}
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+using ProtoBuf;
+
+namespace Droog.Firkin.Test.Perf.Stackoverflow {
+ [ProtoContract]
+ [XmlRoot("row")]
+ public class User {
+ [ProtoMember(1)]
+ [XmlAttribute]
+ public int Id;
+ [ProtoMember(2)]
+ [XmlAttribute]
+ public int Reputation;
+ [ProtoMember(3)]
+ [XmlAttribute]
+ public DateTime CreationDate;
+ [ProtoMember(4)]
+ [XmlAttribute]
+ public string DisplayName;
+ [ProtoMember(5)]
+ [XmlAttribute]
+ public string EmailHash;
+ [ProtoMember(6)]
+ [XmlAttribute]
+ public DateTime LastAccessDate;
+ [ProtoMember(7)]
+ [XmlAttribute]
+ public string WebsiteUrl;
+ [ProtoMember(8)]
+ [XmlAttribute]
+ public string Location;
+ [ProtoMember(9)]
+ [XmlAttribute]
+ public int Age;
+ [ProtoMember(10)]
+ [XmlAttribute]
+ public string AboutMe;
+ [ProtoMember(11)]
+ [XmlAttribute]
+ public int Views;
+ [ProtoMember(12)]
+ [XmlAttribute]
+ public int UpVotes;
+ [ProtoMember(13)]
+ [XmlAttribute]
+ public int DownVotes;
+ }
+}
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Droog.Firkin.Test.Perf.Stackoverflow {
+ public class Votes {
+ public int Id;
+ public int PostId;
+ public VoteType VoteType;
+ public DateTime CreationDate;
+ public int? UserId;
+ public int? BountyAmount;
+ }
+
+ public enum VoteType {
+ AcceptedByOriginator = 1,
+ UpMod = 2,
+ DownMod = 3,
+ Offensive = 4,
+ Favorite = 5,
+ Close = 6,
+ Reopen = 7,
+ BountyStart = 8,
+ BountyClose = 9,
+ Deletion = 10,
+ Undeletion = 11,
+ Spam = 12,
+ InformModerator = 13,
+ }
+}
Oops, something went wrong.

0 comments on commit ea64f4f

Please sign in to comment.