-Documentation

This commit is contained in:
James Newton-King
2012-08-12 23:04:36 +12:00
parent 693d1d5d3e
commit 44c2773263
12 changed files with 345 additions and 83 deletions
+24 -3
View File
@@ -65,8 +65,8 @@ namespace Newtonsoft.Json.Tests
[TestFixture]
public class PerformanceTests : TestFixtureBase
{
private const int Iterations = 100;
//private const int Iterations = 5000;
//private const int Iterations = 100;
private const int Iterations = 5000;
#region Data
@@ -768,6 +768,27 @@ namespace Newtonsoft.Json.Tests
BenchmarkSerializeMethod(SerializeMethod.JsonNet, s);
}
[Test]
public void ParseJObject()
{
Stopwatch timer = new Stopwatch();
timer.Start();
for (int i = 0; i < 100000; i++)
{
JObject o = JObject.Parse(@"{
""CPU"": ""Intel"",
""Drives"": [
""DVD read/writer"",
""500 gigabyte hard drive""
]
}");
}
timer.Stop();
string linq = timer.Elapsed.TotalSeconds.ToString();
Console.WriteLine(linq);
}
[Test]
public void JObjectToString()
{
@@ -778,7 +799,7 @@ namespace Newtonsoft.Json.Tests
for (int i = 0; i < Iterations; i++)
{
test["dummy"] = new JValue(i);
Encoding.UTF8.GetBytes(test.ToString(Formatting.None));
test.ToString(Formatting.None);
}
return null;
}, "JObject.ToString");