diff --git a/CommonMark.Console/CommonMark.Console.csproj b/CommonMark.Console/CommonMark.Console.csproj
index 9d59c20..270cde8 100644
--- a/CommonMark.Console/CommonMark.Console.csproj
+++ b/CommonMark.Console/CommonMark.Console.csproj
@@ -50,9 +50,9 @@
-
- {0fd4b1dd-45a8-4f02-beb0-5881cd512573}
- CommonMark.Base
+
+ {40ab0d9c-9464-45b2-ac79-72a566fa1371}
+ CommonMark.NET45
diff --git a/CommonMark.NET.nuspec b/CommonMark.NET.nuspec
index 8008061..40a2d63 100644
--- a/CommonMark.NET.nuspec
+++ b/CommonMark.NET.nuspec
@@ -2,7 +2,7 @@
CommonMark.NET
- 0.1.1
+ 0.1.2
CommonMark.NET
Knagis
https://raw.githubusercontent.com/Knagis/CommonMark.NET/master/LICENSE.md
@@ -11,7 +11,7 @@
false
Library for converting Markdown documents to HTML according to the CommonMark specification.
- Performance improvements (~50% improvement for the sample data).
+ Performance improvements (~75% improvement for the sample data since 0.1.0).
Copyright © Kārlis Gaņģis 2014
CommonMark Markdown
@@ -21,6 +21,7 @@
+
\ No newline at end of file
diff --git a/CommonMark.sln b/CommonMark.sln
index d54390b..ef38eed 100644
--- a/CommonMark.sln
+++ b/CommonMark.sln
@@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonMark.NET35", "CommonM
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonMark.NET40", "CommonMark\CommonMark.NET40.csproj", "{0176CB03-177C-464A-A155-089595E77520}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonMark.NET45", "CommonMark\CommonMark.NET45.csproj", "{40AB0D9C-9464-45B2-AC79-72A566FA1371}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -48,6 +50,10 @@ Global
{0176CB03-177C-464A-A155-089595E77520}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0176CB03-177C-464A-A155-089595E77520}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0176CB03-177C-464A-A155-089595E77520}.Release|Any CPU.Build.0 = Release|Any CPU
+ {40AB0D9C-9464-45B2-AC79-72A566FA1371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {40AB0D9C-9464-45B2-AC79-72A566FA1371}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {40AB0D9C-9464-45B2-AC79-72A566FA1371}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {40AB0D9C-9464-45B2-AC79-72A566FA1371}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/CommonMark/CommonMark.Base.csproj b/CommonMark/CommonMark.Base.csproj
index 334df15..cda8994 100644
--- a/CommonMark/CommonMark.Base.csproj
+++ b/CommonMark/CommonMark.Base.csproj
@@ -32,7 +32,7 @@
pdbonly
true
bin\Release\
- TRACE;1
+ TRACE
prompt
4
bin\Release\CommonMark.XML
diff --git a/CommonMark/CommonMark.NET45.csproj b/CommonMark/CommonMark.NET45.csproj
new file mode 100644
index 0000000..912a3e0
--- /dev/null
+++ b/CommonMark/CommonMark.NET45.csproj
@@ -0,0 +1,13 @@
+
+
+
+ v4.5
+ v4.5
+ {40AB0D9C-9464-45B2-AC79-72A566FA1371}
+ OptimizeFor45
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CommonMark/CommonMark.Targets.csproj b/CommonMark/CommonMark.Targets.csproj
index d65ce4d..52edefa 100644
--- a/CommonMark/CommonMark.Targets.csproj
+++ b/CommonMark/CommonMark.Targets.csproj
@@ -7,6 +7,7 @@
$(TargetFrameworkProfileEx)
$(OutputPath)\CommonMark.xml
+ $(DefineConstants);$(BuildMode.Replace('.', '_'));$(DefineConstantsEx)
diff --git a/CommonMark/Parser/ScannerCharacterMatcher.cs b/CommonMark/Parser/ScannerCharacterMatcher.cs
index 2f97e3b..e0bee97 100644
--- a/CommonMark/Parser/ScannerCharacterMatcher.cs
+++ b/CommonMark/Parser/ScannerCharacterMatcher.cs
@@ -12,6 +12,9 @@ internal static class ScannerCharacterMatcher
///
/// Moves along the given string as long as the current character is a whitespace.
///
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchWhitespaces(string data, ref char currentCharacter, ref int currentPosition, int lastPosition)
{
var matched = false;
@@ -26,6 +29,9 @@ internal static bool MatchWhitespaces(string data, ref char currentCharacter, re
///
/// Moves along the given string as long as the current character is a ASCII letter.
///
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAsciiLetter(string data, ref char currentCharacter, ref int currentPosition, int lastPosition)
{
var matched = false;
@@ -42,6 +48,9 @@ internal static bool MatchAsciiLetter(string data, ref char currentCharacter, re
///
/// Moves along the given string as long as the current character is a ASCII letter or digit.
///
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAsciiLetterOrDigit(string data, ref char currentCharacter, ref int currentPosition, int lastPosition)
{
var matched = false;
@@ -59,6 +68,9 @@ internal static bool MatchAsciiLetterOrDigit(string data, ref char currentCharac
///
/// Moves along the given string as long as the current character is a ASCII letter or digit or one of the given additional characters.
///
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAsciiLetterOrDigit(string data, ref char currentCharacter, ref int currentPosition, int lastPosition, char valid1, char valid2, char valid3, char valid4)
{
var matched = false;
@@ -80,6 +92,9 @@ internal static bool MatchAsciiLetterOrDigit(string data, ref char currentCharac
///
/// Moves along the given string as long as the current character is a ASCII letter or one of the given additional characters.
///
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAsciiLetter(string data, ref char currentCharacter, ref int currentPosition, int lastPosition, char valid1, char valid2)
{
var matched = false;
@@ -96,6 +111,9 @@ internal static bool MatchAsciiLetter(string data, ref char currentCharacter, re
return matched;
}
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAnythingExcept(string data, ref char currentCharacter, ref int currentPosition, int lastPosition, char invalid1)
{
var matched = false;
@@ -107,6 +125,9 @@ internal static bool MatchAnythingExcept(string data, ref char currentCharacter,
return matched;
}
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAnythingExcept(string data, ref char currentCharacter, ref int currentPosition, int lastPosition, char invalid1, char invalid2)
{
var matched = false;
@@ -119,6 +140,9 @@ internal static bool MatchAnythingExcept(string data, ref char currentCharacter,
return matched;
}
+#if OptimizeFor45
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+#endif
internal static bool MatchAnythingExceptWhitespaces(string data, ref char currentCharacter, ref int currentPosition, int lastPosition,
char invalid1, char invalid2, char invalid3, char invalid4, char invalid5, char invalid6)
{