public void InvokeXmlReader(TestInvoke context) { long length = 0; char[] buffer = new char[4 * 1024 * 1024]; context.BenchmarkReader("text-length", "revision", reader => { int depth = reader.Depth; while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == "text") { int read = 0; do { read = reader.ReadChars(buffer, 0, buffer.Length); length = length + read; }while (read > 0); } if (depth == reader.Depth) { return; } } }); context.Complete(length); }
public void InvokeXmlLinq(TestInvoke context) { long count = 0; context.BenchmarkLinq("just-seek", "revision", node => { Interlocked.Add(ref count, 1); }); context.Complete(count); }
public void InvokeXmlReader(TestInvoke context) { long count = 0; context.BenchmarkReader("just-seek", "revision", reader => { Interlocked.Add(ref count, 1); }); context.Complete(count); }
public void InvokeXenonStatic(TestInvoke context) { long count = 0; context.BenchmarkStatic("just-seek", "revision", document => { Interlocked.Add(ref count, 1); }); context.Complete(count); }
public void InvokeXenonDynamic(TestInvoke context) { long length = 0; context.BenchmarkDynamic("text-length", "revision", document => { Interlocked.Add(ref length, document.GetDynamic().text.ToText().GetLength()); }); context.Complete(length); }
public void InvokeXmlLinq(TestInvoke context) { throw new System.NotImplementedException(); }