Skip to content

Commit

Permalink
Merged PR 369: RELEASE: Version 3.2.16.2 released
Browse files Browse the repository at this point in the history
 - New project file that uses existing source files and targets .NET standard 1.6
 - Updated cache template values and comments
 - Updated lite data files for April 2017


Former-commit-id: 450d319ab76c0cf5d5b4a0d2e1e901c598e3bb6b
  • Loading branch information
Steve51D committed Apr 20, 2017
2 parents b815973 + 62acca0 commit b870dc7
Show file tree
Hide file tree
Showing 31 changed files with 4,594 additions and 231 deletions.
6 changes: 6 additions & 0 deletions 51degrees 4.sln
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "FiftyOne.Foundation SQL", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Caching Configuration", "Examples\Caching Configuration\Caching Configuration.csproj", "{D3C0A9BC-E020-4ED0-A24A-13402FB668D8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FiftyOne.Foundation.4.Core", "FoundationV3\FiftyOne.Foundation.4.Core.xproj", "{B1DBF0B9-FB93-4A5B-96B7-CF9FDADAD5BF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -137,6 +139,10 @@ Global
{D3C0A9BC-E020-4ED0-A24A-13402FB668D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3C0A9BC-E020-4ED0-A24A-13402FB668D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3C0A9BC-E020-4ED0-A24A-13402FB668D8}.Release|Any CPU.Build.0 = Release|Any CPU
{B1DBF0B9-FB93-4A5B-96B7-CF9FDADAD5BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1DBF0B9-FB93-4A5B-96B7-CF9FDADAD5BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1DBF0B9-FB93-4A5B-96B7-CF9FDADAD5BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1DBF0B9-FB93-4A5B-96B7-CF9FDADAD5BF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 1 addition & 7 deletions FoundationV3/FiftyOne.Foundation 4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,12 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="FiftyOne.Foundation 4.project.json" />
<None Include="packages.config" />
<None Include="README.md" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- 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">
Expand Down
8 changes: 8 additions & 0 deletions FoundationV3/FiftyOne.Foundation 4.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"runtimes": {
"win" : {}
},
"frameworks" : {
"net40" : {}
}
}
15 changes: 15 additions & 0 deletions FoundationV3/FiftyOne.Foundation 4.project.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"locked": false,
"version": 2,
"targets": {
".NETFramework,Version=v4.0": {},
".NETFramework,Version=v4.0/win": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"": [],
".NETFramework,Version=v4.0": []
},
"tools": {},
"projectFileToolGroups": {}
}
57 changes: 57 additions & 0 deletions FoundationV3/FiftyOne.Foundation.4.Core.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>b1dbf0b9-fb93-4a5b-96b7-cf9fdadad5bf</ProjectGuid>
<RootNamespace>FiftyOne.Foundation.4.Core</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="FiftyOne.Foundation SQL.dbmdl" />
<DnxInvisibleContent Include="FiftyOne.Foundation SQL.jfm" />
<DnxInvisibleContent Include="FiftyOne.Foundation SQL.sqlproj" />
<DnxInvisibleContent Include="PDA.ico" />
</ItemGroup>
<ItemGroup>
<DnxInvisibleFolder Include="Bases\" />
<DnxInvisibleFolder Include="Image\" />
<DnxInvisibleFolder Include="Licence\" />
<DnxInvisibleFolder Include="Mobile\Configuration\" />
<DnxInvisibleFolder Include="Mobile\Detection\Configuration\" />
<DnxInvisibleFolder Include="Mobile\Detection\Feature\" />
<DnxInvisibleFolder Include="Mobile\Redirection\" />
<DnxInvisibleFolder Include="UI\" />
</ItemGroup>
<ItemGroup>
<DnxInvisibleCompile Include="Activator.cs" />
<DnxInvisibleCompile Include="EventLog.cs" />
<DnxInvisibleCompile Include="Log.cs" />
<DnxInvisibleCompile Include="LogMessageEntity.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\AutoUpdate.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\BaseDataSet.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\DetectorModule.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\Entities\Utf8String.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\FiftyOneBrowserCapabilities.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\LicenceKey.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\MobileCapabilitiesOverride.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\MobileCapabilitiesProvider.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\NewDevice.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\RequestHelper.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\SQL.cs" />
<DnxInvisibleCompile Include="Mobile\Detection\WebProvider.cs" />
<DnxInvisibleCompile Include="Properties\LicenceConstants.cs" />
<DnxInvisibleCompile Include="Properties\RedirectionConstants.cs" />
<DnxInvisibleCompile Include="Properties\RetailerConstants.cs" />
<DnxInvisibleCompile Include="Properties\UIConstants.cs" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
150 changes: 117 additions & 33 deletions FoundationV3/Mobile/Detection/DataSetBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,127 @@ public override Dictionary<CacheType, ICacheOptions> GetCacheConfiguration()
/// Suitable for most users but not optimised for any specific
/// environment.
/// </summary>
/// <remarks>
/// <para>
/// Memory usage without a User Agent cache is expected
/// to be around 40Mb using <see cref="DataSetBuilder.File()"/>
/// and around 240Mb using <see cref="DataSetBuilder.Buffer()"/>.
/// </para>
/// <para>
/// Bear in mind that actual memory load is dependent on the
/// data file type (i.e. Lite, Premium, etc) and to some extent
/// upon the way in which the API is being used.
/// </para>
/// <para>
/// Note: Currently, the .NET API uses the same configuration
/// for multi-threaded and single-threaded templates.
/// This may change in response future development and testing.
/// </para>
/// </remarks>
public static readonly CacheTemplate Default =
new InternalCacheTemplate(defaultCacheSizes);
/// <summary>
/// Configuration optimised for a single-threaded environment
/// where memory usage is not a particular concern.
/// </summary>
/// <remarks>
/// <para>
/// Memory usage without a User Agent cache is expected
/// to be around 50Mb using <see cref="DataSetBuilder.File()"/>
/// and around 255Mb using <see cref="DataSetBuilder.Buffer()"/>.
/// </para>
/// <para>
/// Bear in mind that actual memory load is dependent on the
/// data file type (i.e. Lite, Premium, etc) and to some extent
/// upon the way in which the API is being used.
/// </para>
/// <para>
/// Note: Currently, the .NET API uses the same configuration
/// for multi-threaded and single-threaded templates.
/// This may change in response future development and testing.
/// </para>
/// </remarks>
public static readonly CacheTemplate SingleThread =
new InternalCacheTemplate(StCacheSizes);
/// <summary>
/// Configuration optimised for a single-threaded environment
/// where low memory usage is required.
/// </summary>
/// <remarks>
/// <para>
/// Memory usage without a User Agent cache is expected
/// to be around 25Mb using <see cref="DataSetBuilder.File()"/>
/// and around 230Mb using <see cref="DataSetBuilder.Buffer()"/>.
/// </para>
/// <para>
/// Bear in mind that actual memory load is dependent on the
/// data file type (i.e. Lite, Premium, etc) and to some extent
/// upon the way in which the API is being used.
/// </para>
/// <para>
/// Note: Currently, the .NET API uses the same configuration
/// for multi-threaded and single-threaded templates.
/// This may change in response future development and testing.
/// </para>
/// </remarks>
public static readonly CacheTemplate SingleThreadLowMemory =
new InternalCacheTemplate(StlmCacheSizes);
/// <summary>
/// Configuration optimised for a multi-threaded environemnt
/// Configuration optimised for a multi-threaded environment
/// where memory usage is not a particular concern.
/// </summary>
/// <remarks>
/// <para>
/// Memory usage without a User Agent cache is expected
/// to be around 50Mb using <see cref="DataSetBuilder.File()"/>
/// and around 255Mb using <see cref="DataSetBuilder.Buffer()"/>.
/// </para>
/// <para>
/// Bear in mind that actual memory load is dependent on the
/// data file type (i.e. Lite, Premium, etc) and to some extent
/// upon the way in which the API is being used.
/// </para>
/// <para>
/// Generally, it is not recommended to use more threads for
/// device detection than the number of logical cores on the
/// host machine as this can cause match times for individual
/// threads to suffer.
/// </para>
/// <para>
/// Note: Currently, the .NET API uses the same configuration
/// for multi-threaded and single-threaded templates.
/// This may change in future in response to testing.
/// </summary>
/// This may change in response future development and testing.
/// </para>
/// </remarks>
public static readonly CacheTemplate MultiThread =
new InternalCacheTemplate(MtCacheSizes);
/// <summary>
/// Configuration optimised for a multi-threaded environemnt
/// Configuration optimised for a multi-threaded environment
/// where low memory usage is required.
/// </summary>
/// <remarks>
/// <para>
/// Memory usage without a User Agent cache is expected
/// to be around 25Mb using <see cref="DataSetBuilder.File()"/>
/// and around 230Mb using <see cref="DataSetBuilder.Buffer()"/>.
/// </para>
/// <para>
/// Bear in mind that actual memory load is dependent on the
/// data file type (i.e. Lite, Premium, etc) and to some extent
/// upon the way in which the API is being used.
/// </para>
/// <para>
/// Generally, it is not recommended to use more threads for
/// device detection than the number of logical cores on the
/// host machine as this can cause match times for individual
/// threads to suffer.
/// </para>
/// <para>
/// Note: Currently, the .NET API uses the same configuration
/// for multi-threaded and single-threaded templates.
/// This may change in future in response to testing.
/// </summary>
/// This may change in response future development and testing.
/// </para>
/// </remarks>
public static readonly CacheTemplate MultiThreadLowMemory =
new InternalCacheTemplate(StlmCacheSizes);

Expand Down Expand Up @@ -677,59 +768,52 @@ public override V Load(int key)
#endregion

#region Cache size configurations

/* Default Cache sizes */
private const int STRINGS_CACHE_SIZE = 8000;
private const int NODES_CACHE_SIZE = 30000;
private const int VALUES_CACHE_SIZE = 3000;
private const int PROFILES_CACHE_SIZE = 600;
private const int SIGNATURES_CACHE_SIZE = 16000;


private static ICacheBuilder LruBuilder = new LruCacheBuilder();

private static Dictionary<CacheType, ICacheOptions> defaultCacheSizes = new Dictionary<CacheType, ICacheOptions>()
{
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 8000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 40000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 80000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 5000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 20000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 40000 } },
};

private static Dictionary<CacheType, ICacheOptions> MtCacheSizes = new Dictionary<CacheType, ICacheOptions>()
{
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 8000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 80000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 5000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 40000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 200000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 10000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 2000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 60000 } },
};

private static Dictionary<CacheType, ICacheOptions> StCacheSizes = new Dictionary<CacheType, ICacheOptions>()
{
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 8000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 80000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 5000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 40000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 200000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 10000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 2000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 60000 } },
};

private static Dictionary<CacheType, ICacheOptions> StlmCacheSizes = new Dictionary<CacheType, ICacheOptions>()
{
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 5000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 30000 } },
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 8000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 40000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 500 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 10000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 20000 } },
};

private static Dictionary<CacheType, ICacheOptions> MtlmCacheSizes = new Dictionary<CacheType, ICacheOptions>()
{
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 5000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 30000 } },
{ CacheType.StringsCache, new CacheOptions() { Builder = LruBuilder, Size = 8000 } },
{ CacheType.NodesCache, new CacheOptions() { Builder = LruBuilder, Size = 40000 } },
{ CacheType.ValuesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 500 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 10000 } },
{ CacheType.ProfilesCache, new CacheOptions() { Builder = LruBuilder, Size = 1000 } },
{ CacheType.SignaturesCache, new CacheOptions() { Builder = LruBuilder, Size = 20000 } },
};

#endregion
Expand Down
Loading

0 comments on commit b870dc7

Please sign in to comment.