Skip to content

Commit

Permalink
- Improved compiled dll output size, compilation and cold run speed
Browse files Browse the repository at this point in the history
 - Added an option CompilerOptions.AlsoCompileInPlace (default: true)
 - Xamarin.Android dlls
 - RunSharp dependency updated
  • Loading branch information
AqlaSolutions committed May 28, 2016
1 parent de5e99b commit 0805752
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 33 deletions.
253 changes: 252 additions & 1 deletion AqlaSerializer.sln

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Examples/ComparisonToNDCS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ static List<BasicDto> GetTestData()
{
// just make up some gibberish
var rand = new Random(12345);
List<BasicDto> list = new List<BasicDto>(300000);
List<BasicDto> list = new List<BasicDto>(30000);
#if DEBUG
const int max = 100;
#else
const int max = 300000;
const int max = 30000;
#endif
for (int i = 0 ; i < max ; i++)
{
Expand Down
12 changes: 9 additions & 3 deletions Nuget/aqlaserializer.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>aqlaserializer</id>
<version>2.0.0.227</version>
<version>2.0.0.234</version>
<authors>Vladyslav Taranov</authors>
<copyright>Vladyslav Taranov 2016, fork source from Marc Gravell 2016</copyright>
<owners>Vladyslav Taranov</owners>
Expand All @@ -16,7 +16,7 @@ AqlaSerializer primary goal is to support important .NET features like nested co

Like protobuf-net AqlaSerializer makes possible to store objects as a small in size binary data (far smaller than xml). And it's more CPU effective than BinaryFormatter and other core .NET serializers (which could be unavailable on your target platform). Its format is designed to be: small in size - efficient data storage (far smaller than xml) cheap to process - both at the client and server platform independent - portable between different programming architectures extensible - to add new data to old messages.

The implementation is compatible with most of the .NET family, including .NET 2.0/3.0/3.5/4.0, Windows Phone 8, Silverlight, etc. The code is heavily based on Marc Gravell's protobuf-net but there are a lot of improvements and fixes.
The implementation is compatible with most of the .NET family, including .NET 2.0/3.0/3.5/4.0, Windows Phone 8, Silverlight, Xamarin.Android, etc. The code is heavily based on Marc Gravell's protobuf-net but there are a lot of improvements and fixes.

The original protobuf-net project contains many "red" unit tests but I managed to fix a lot of them.

Expand All @@ -27,6 +27,12 @@ Some build configurations may be not available through nuget, you can download t
<language>en-US</language>
<releaseNotes>

* 2.0.0.234:
- Improved compiled dll output size, compilation and cold run speed
- Added an option CompilerOptions.AlsoCompileInPlace (default: true)
- Xamarin.Android dlls
- RunSharp dependency updated

* 2.0.0.227: V2 release
- Added CompileOptions.IterativeMode
- Fixed incorrect IL generated when list.Add method has a return value
Expand Down Expand Up @@ -70,7 +76,7 @@ Some build configurations may be not available through nuget, you can download t

<dependencies>
<group>
<dependency id="aqla.runsharp" version="1.0.0.17" />
<dependency id="aqla.runsharp" version="1.0.0.18" />
</group>

</dependencies>
Expand Down
18 changes: 13 additions & 5 deletions READ IF YOU WANT TO BUILD.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
buildpack.cmd does the thing.
buildpack.cmd makes a package.

Before building replace Aqla.RunSharp project references with nuget dependencies
or download RunSharp sources https://github.com/AqlaSolutions/runsharp and put them to ..\RunSharp\src.
Also you will need to put your own snk for project signing.

The current used build machine has everything installed on Windows 10.

I have Visual Studio 2015 with Xamarin installed there.
I have "Visual Studio 2015 Community with Xamarin" installed there.

When you open solution Visual Studio will ask you to install some extra sdks.

When you open solution Visual Studio will ask you to install some sdks.
For Xamarin.Android run %ProgramFiles(x86)%\Android\android-sdk\SDK Manager.exe and install API 10 sdk (Android 2.3.3)

Install MSBuild Community Tasks https://github.com/loresoft/msbuildtasks/releases
To use buildpack.cmd install MSBuild Community Tasks https://github.com/loresoft/msbuildtasks/releases and MSBuild Extension Pack http://msbuildextensionpack.com

Some extra projects may require ASP .NET MVC (1.0, 2,) 3:
Some test projects may require ASP .NET MVC (1.0, 2,) 3:
http://www.microsoft.com/en-us/download/details.aspx?id=5388
http://www.microsoft.com/en-us/download/details.aspx?id=22079
http://www.microsoft.com/en-us/download/details.aspx?id=1491

Some dto projects may find their dependencies only after running all tests in Debug and Release configurations.

How to install WP8 sdk for Windows 7:
https://github.com/Xlab/wp8sdk-installer/tree/master/bin
http://habrahabr.ru/post/157427/
Expand Down
12 changes: 11 additions & 1 deletion all.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ProjectToBuild Include="protobuf-net_Portable\aqlaserializer_Portable.csproj"/>
<ProjectToBuild Include="protobuf-net_WinRT\aqlaserializer_WinRT.csproj"/>
<ProjectToBuild Include="protobuf-net_IKVM\aqlaserializer_IKVM.csproj"/>
<!-- <ProjectToBuild Include="protobuf-net_MonoDroid\aqlaserializer_MonoDroid.csproj"/> -->
<ProjectToBuild Include="protobuf-net_MonoDroid\aqlaserializer_MonoDroid.csproj"/>


</ItemGroup>
Expand Down Expand Up @@ -127,6 +127,11 @@
<PrecompileFiles Include="precompile\bin\Release\*.*"/>

<EnyimFiles Include="protobuf-net.Enyim\protobuf-net.Enyim\bin\Release\*.*" Exclude="protobuf-net.Enyim\protobuf-net.Enyim\bin\Release\Licence.txt"/>


<AndroidFiles Include="protobuf-net_MonoDroid\bin\Release\aqlaserializer.*"/>
<AndroidFilesDep Include="protobuf-net_MonoDroid\bin\Release\RunSharp.*"/>

</ItemGroup>

<Copy SourceFiles="@(Net20Files)" DestinationFolder="$(NugetDirectory)\net20"/>
Expand Down Expand Up @@ -188,6 +193,11 @@
<Copy SourceFiles="@(WP8Files_CoreOnly)" DestinationFolder="$(ZipDirectory)\CoreOnly\wp8"/>
<Copy SourceFiles="@(PortableFiles_CoreOnly)" DestinationFolder="$(ZipDirectory)\CoreOnly\portable"/>

<Copy SourceFiles="@(AndroidFiles)" DestinationFolder="$(ZipDirectory)\Full\android"/>
<Copy SourceFiles="@(AndroidFilesDep)" DestinationFolder="$(ZipDirectory)\Full\android"/>

<Copy SourceFiles="@(AndroidFiles)" DestinationFolder="$(NugetDirectory)\Xamarin.Android"/>

<Copy SourceFiles="@(EnyimFiles)" DestinationFolder="$(ZipDirectory)\Full\net30+enyim"/>

<Copy SourceFiles="@(PrecompileFiles)" DestinationFolder="$(ZipDirectory)\Precompile"/>
Expand Down
4 changes: 2 additions & 2 deletions precompile/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// 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("2.0.0.227")]
[assembly: AssemblyFileVersion("2.0.0.227")]
[assembly: AssemblyVersion("2.0.0.234")]
[assembly: AssemblyFileVersion("2.0.0.234")]
4 changes: 2 additions & 2 deletions protobuf-net.Extensions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// 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("2.0.0.227")]
[assembly: AssemblyVersion("2.0.0.234")]
#if !CF
[assembly: AssemblyFileVersion("2.0.0.227")]
[assembly: AssemblyFileVersion("2.0.0.234")]
#endif
[assembly: CLSCompliant(true)]
26 changes: 13 additions & 13 deletions protobuf-net/LinqBridge.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !NET_3_5 && !NET_4_0 && !NET_4_5 && !PORTABLE && !WINRT && !PHONE8
#if !NET_3_5 && !NET_4_0 && !NET_4_5 && !PORTABLE && !WINRT && !PHONE8 && !MONODROID
#region License, Terms and Author(s)
//
// LINQBridge
Expand Down Expand Up @@ -35,14 +35,14 @@

namespace AltLinq
{
#region Imports
#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

#endregion
#endregion

/// <summary>
/// Provides a set of static (Shared in Visual Basic) methods for
Expand Down Expand Up @@ -1784,12 +1784,12 @@ internal Grouping(K key)

namespace AltLinq
{
#region Imports
#region Imports

using System;
using System.Collections.Generic;

#endregion
#endregion

// This partial implementation was template-generated:
// Mon, 16 Apr 2012 20:05:53 GMT
Expand Down Expand Up @@ -2770,11 +2770,11 @@ namespace AltLinq

namespace AltLinq
{
#region Imports
#region Imports

using System.Collections.Generic;

#endregion
#endregion

/// <summary>
/// Represents a collection of objects that have a common key.
Expand Down Expand Up @@ -2814,12 +2814,12 @@ partial interface ILookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement

namespace AltLinq
{
#region Imports
#region Imports

using System;
using System.Collections.Generic;

#endregion
#endregion

/// <remarks>
/// This type is not intended to be used directly from user code.
Expand Down Expand Up @@ -2902,14 +2902,14 @@ IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey>(

namespace AltLinq
{
#region Imports
#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using IEnumerable=System.Collections.IEnumerable;

#endregion
#endregion

/// <summary>
/// Represents a collection of keys each mapped to one or more values.
Expand Down Expand Up @@ -3003,15 +3003,15 @@ IEnumerator IEnumerable.GetEnumerator()

namespace AltLinq
{
#region Imports
#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using AltLinq;

#endregion
#endregion

internal sealed class OrderedEnumerable<T, K> : IOrderedEnumerable<T>
{
Expand Down
4 changes: 2 additions & 2 deletions protobuf-net/Meta/RuntimeTypeModel.Compilation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public sealed class CompilerOptions
/// <summary>
/// Also compile in place this model; default: true.
/// </summary>
public bool CompileInPlace { get; set; } = true;
public bool AlsoCompileInPlace { get; set; } = true;

/// <summary>
/// Allows to avoid unnecessary recompilation
Expand Down Expand Up @@ -512,7 +512,7 @@ public TypeModel Compile(CompilerOptions options)
}
}

if (options.CompileInPlace)
if (options.AlsoCompileInPlace)
CompileInPlace();
Freeze();

Expand Down
4 changes: 2 additions & 2 deletions protobuf-net/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
// 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("2.0.0.227")]
[assembly: AssemblyVersion("2.0.0.234")]
#if !CF
[assembly: AssemblyFileVersion("2.0.0.227")]
[assembly: AssemblyFileVersion("2.0.0.234")]
#endif
#if !FX11
[assembly: InternalsVisibleTo("aqlaserializer.unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010091B11AB23561C227F083424C0162A38DA330B724B6E96C1BE6C5989BFDD5C1BA3E555D8F105DD352C2623FE6AF90F4FA3173C6120DD567283434513DA579728230E1697A156770A81B7FBF5535ECDB96D2737E74181A4D980647AE33CDFB6E0C1FF63065AE8E33BB27374090393685FF265563655DE4829B0E5C996B1CF9A3E3")]
Expand Down
84 changes: 84 additions & 0 deletions protobuf-net_MonoDroid/aqlaserializer_MonoDroid.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1F3DAD34-F2EF-402B-9D50-F106B4457B33}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AqlaSerializer</RootNamespace>
<AssemblyName>aqlaserializer</AssemblyName>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\AqlaSerializer2Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MONODROID FEAT_COMPILER PLAT_BINARYFORMATTER</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MONODROID FEAT_COMPILER PLAT_BINARYFORMATTER</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\Release\aqlaserializer.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'CoreOnly|AnyCPU'">
<OutputPath>bin\CoreOnly\</OutputPath>
<DefineConstants>TRACE;MONODROID FEAT_COMPILER PLAT_BINARYFORMATTER</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\aqlaserializer.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\protobuf-net\**\*.cs" />
<None Include="..\Licence.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\RunSharp\src\RunSharp\RunSharp.csproj">
<Project>{08f134ae-48e8-4a35-9dc7-2f31eaf4a66f}</Project>
<Name>RunSharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.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 comments on commit 0805752

Please sign in to comment.