Created
June 25, 2013 00:00
-
-
Save RavuAlHemio/5854820 to your computer and use it in GitHub Desktop.
Smuxi smart-link performance test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs | |
index 0389d3b..0d7b542 100644 | |
--- a/src/Engine-Tests/MessageBuilderTests.cs | |
+++ b/src/Engine-Tests/MessageBuilderTests.cs | |
@@ -434,5 +434,24 @@ namespace Smuxi.Engine | |
builder.Append(new TextMessagePartModel(@". This is another sentence.")); | |
TestMessage(msg, builder.ToMessage()); | |
} | |
+ | |
+ [Test] | |
+ public void AppendTextUrlBenchmark() | |
+ { | |
+ int howOften = 5000; | |
+ var withUrl = @"is this up to date? --> http://www.stack.nl/~jilles/irc/atheme-help/"; | |
+ var withoutUrl = @"Generated Sat Dec 11 21:29:16 CET 2010 -- old"; | |
+ var builder = new MessageBuilder(); | |
+ builder.TimeStamp = DateTime.MinValue; | |
+ | |
+ DateTime start = DateTime.Now; | |
+ for (int i = 0; i < howOften; ++i) { | |
+ builder.AppendMessage(withUrl); | |
+ builder.AppendMessage(withoutUrl); | |
+ } | |
+ DateTime stop = DateTime.Now; | |
+ | |
+ Console.WriteLine("parsing a message with URLs takes ~{0} ms", (stop - start).TotalMilliseconds / (howOften*2)); | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://oli-obk.de/smuxi_benchmark.png