annotate MonoPlay/Program.cs @ 150:3258399cba83 v2

JSONWriter improvements
author cin
date Sat, 12 Dec 2015 22:12:44 +0300
parents 706fccb85524
children ec91a6dfa5b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
1 using System;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
2 using Implab.Diagnostics;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
3 using Implab.Parallels;
dc4942d09e74 improved tracing
cin
parents:
diff changeset
4 using Implab;
103
cin
parents: 94
diff changeset
5 using System.Collections.Generic;
cin
parents: 94
diff changeset
6 using System.Collections.Concurrent;
136
e9e7940c7d98 shared locks + tests
cin
parents: 125
diff changeset
7 using System.Threading;
150
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
8 using Implab.JSON;
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
9 using System.IO;
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
10
dc4942d09e74 improved tracing
cin
parents:
diff changeset
11 namespace MonoPlay {
dc4942d09e74 improved tracing
cin
parents:
diff changeset
12 class MainClass {
145
706fccb85524 RC: cancellation support for promises + tests
cin
parents: 138
diff changeset
13
706fccb85524 RC: cancellation support for promises + tests
cin
parents: 138
diff changeset
14
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
15 public static void Main(string[] args) {
94
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
16 if (args == null)
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
17 throw new ArgumentNullException("args");
a43745f81f10 minor fixes
cin
parents: 93
diff changeset
18
103
cin
parents: 94
diff changeset
19 var t1 = Environment.TickCount;
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
20
150
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
21 for(int i =0; i < 1000000; i++)
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
22 using (var tw = new StringWriter()) {
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
23 var jw = new JSONWriter(tw);
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
24
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
25 jw.WriteValue("\r\nhere\tvalue\u0002\u0003");
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
26
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
27 //Console.WriteLine(tw);
145
706fccb85524 RC: cancellation support for promises + tests
cin
parents: 138
diff changeset
28 }
121
62d2f1e98c4e working version of AsyncQueue and batch operations
cin
parents: 120
diff changeset
29
150
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
30
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
31
103
cin
parents: 94
diff changeset
32 var t2 = Environment.TickCount;
125
f803565868a4 improved performance of promises
cin
parents: 124
diff changeset
33 Console.WriteLine("done: {0} ms, {1:.00} Mb, {2} GC", t2 - t1, GC.GetTotalMemory(false) / (1024*1024), GC.CollectionCount(0) );
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
34
dc4942d09e74 improved tracing
cin
parents:
diff changeset
35 }
136
e9e7940c7d98 shared locks + tests
cin
parents: 125
diff changeset
36
150
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
37 static void DoTest() {
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
38
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
39
3258399cba83 JSONWriter improvements
cin
parents: 145
diff changeset
40
145
706fccb85524 RC: cancellation support for promises + tests
cin
parents: 138
diff changeset
41 }
136
e9e7940c7d98 shared locks + tests
cin
parents: 125
diff changeset
42
93
dc4942d09e74 improved tracing
cin
parents:
diff changeset
43 }
dc4942d09e74 improved tracing
cin
parents:
diff changeset
44 }