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
[Serializable] | |
[DataContract] | |
public class Test { | |
[DataMember(Order = 1)] | |
public int ID { get; set; } | |
[DataMember(Order = 2)] | |
public string Text { get; set; } | |
[DataMember(Order = 3)] | |
public Complex Inner { get; set; } | |
} |
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
static void Test(string name, Action action) { | |
var count = 10000; | |
var stopWatch = new Stopwatch(); | |
stopWatch.Start(); | |
for (var i = 0; i < count; i++) | |
action(); | |
stopWatch.Stop(); | |
Console.WriteLine("Iteration: {0}", count); | |
Console.WriteLine("Completed {0} in Avg {1} Milliseconds", name, stopWatch.ElapsedMilliseconds); | |
Console.WriteLine(); |
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
Completed Phoenix Json in Avg 55 Milliseconds | |
----------------------------------- | |
Completed MessageShark in Avg 56 Milliseconds | |
----------------------------------- | |
Completed ProtoBuf in Avg 65 Milliseconds | |
----------------------------------- | |
Completed ObjectSerialization in Avg 110 Milliseconds | |
----------------------------------- | |
Completed Service Stack Json in Avg 192 Milliseconds | |
----------------------------------- |
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
Completed MessageShark in Avg 117 Milliseconds | |
----------------------------------- | |
Completed Phoenix Json in Avg 144 Milliseconds | |
----------------------------------- | |
Completed ProtoBuf in Avg 166 Milliseconds | |
----------------------------------- | |
Completed ObjectSerialization in Avg 210 Milliseconds | |
----------------------------------- | |
Completed fastJSON in Avg 383 Milliseconds | |
----------------------------------- |
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
Completed Phoenix Json in Avg 436 Milliseconds | |
Completed MessageShark in Avg 482 Milliseconds | |
Completed ProtoBuf in Avg 509 Milliseconds | |
Completed Phoenix Xml in Avg 1272 Milliseconds | |
Completed Service Stack Json in Avg 1792 Milliseconds | |
Completed Newton JSON.NET in Avg 2542 Milliseconds | |
Completed fastJSON in Avg 3296 Milliseconds | |
Completed MessagePack in Avg 5601 Milliseconds | |
Press any key to continue . . . |
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
static char[][] join(string text, int size = 4) { | |
return new char[][] { ("0" + text).ToJoinArray(size), ("1" + text).ToJoinArray(size), ("2" + text).ToJoinArray(size), | |
("3" + text).ToJoinArray(size), | |
("4" + text).ToJoinArray(size), | |
("5" + text).ToJoinArray(size), | |
("6" + text).ToJoinArray(size), ("7" + text).ToJoinArray(size), | |
("8" + text).ToJoinArray(size), ("9" + text).ToJoinArray(size) }; | |
} | |
static char[][] join2(string text, int size = 4) { |
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
{"ID":100,"Text":"Olamide","Inner":{"ID":400,"Name":"ComplexObject","List":[{"Text":"DataText","DataTexts":["String1","String2"],"Buffer":[19,33,45,66,23,123,55,33,55,14,67,74],"Items":["Item1","Item2"],"YesNo":true,"CreateDate":"2013-11-21T00:40:14.7568698Z"}],"Dict":{"First":{"Text":"DictData","DataTexts":null,"Buffer":null,"Items":null,"YesNo":false,"CreateDate":"0001-01-01T00:00:00"}},"MyE":2}} |
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
Completed Phoenix Json in Avg 455 Milliseconds | |
Completed MessageShark in Avg 492 Milliseconds | |
Completed ProtoBuf in Avg 502 Milliseconds | |
Completed Phoenix Xml in Avg 1335 Milliseconds | |
Completed Service Stack Json in Avg 1835 Milliseconds | |
Completed Newton JSON.NET in Avg 2612 Milliseconds | |
Press any key to continue . . . |
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
public enum MyEnumEx { | |
A = 1, | |
B = 2 | |
} | |
[DataContract] | |
public class Test { | |
[DataMember(Order = 1)] | |
public int ID { get; set; } | |
[DataMember(Order = 2)] |
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
public static string dtoa(double value) { | |
long trunc = (long)value; | |
double mantissa = (trunc < 0) ? value - trunc : trunc - value; | |
var left = (long)(1000000000000000 * (mantissa > 0 ? mantissa : -mantissa)); | |
char* buf = stackalloc char[64]; | |
char* bf = buf; |
NewerOlder