Advertisement
Guest User

Untitled

a guest
Apr 17th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.67 KB | None | 0 0
  1. import std.conv;
  2. import std.stdio;
  3. import std.datetime;
  4. import orange.core._;
  5. import orange.serialization._;
  6. import orange.serialization.archives._;
  7.  
  8. struct A {
  9.     int x;
  10. }
  11.  
  12. struct Foo
  13. {
  14.     A[string] a;
  15. }
  16.  
  17. void main()
  18. {
  19.     Foo foo;
  20.     foreach (a; 'a' .. 'z')
  21.         foreach (b; 'a' .. 'z')
  22.             foreach (c; 'a' .. 'z')
  23.                     foo.a[to!string(a) ~ to!string(b) ~ to!string(c)] = A();
  24.    
  25.     auto archive = new XmlArchive!(char); // create an XML archive
  26.     auto serializer = new Serializer(archive); // create the serializer
  27.    
  28.     auto sw = StopWatch(AutoStart.yes);
  29.     serializer.serialize(foo);
  30.     writeln(sw.peek.seconds);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement