Commit Graph

1254 Commits

Author SHA1 Message Date
Erick Tryzelaar
3f66b05798 simplify serializing tuples/structs/enums 2014-06-23 21:14:23 -04:00
Erick Tryzelaar
9058341234 simplify deserializing seqs and maps 2014-06-23 20:44:24 -04:00
Erick Tryzelaar
be34aefe78 Simpify bench_struct 2014-06-23 11:44:11 -04:00
Erick Tryzelaar
73b9a8cf74 Don't use trait objects in json 2014-06-23 08:29:50 -04:00
Erick Tryzelaar
7926ac2778 Minor cleanup 2014-06-22 21:55:07 -04:00
Erick Tryzelaar
23abb48e9b Simplify the Serializable typarams
This closes #14302
2014-06-22 21:54:58 -04:00
Erick Tryzelaar
22ff47f93b Simplify the Deserializable typarams 2014-06-22 16:51:50 -04:00
Erick Tryzelaar
ec8dd2f5a0 Optimize serialization
Serialization is now competitive with go's serialization, with
~60MB/s in the bench_logs test.
2014-06-22 10:33:45 -04:00
Erick Tryzelaar
ee162975f9 wip 2014-06-20 19:32:30 -04:00
Erick Tryzelaar
f46d5a9973 Add some serialization benchmarks
test bench_enum::bench_decoder_dog                 ... bench:       110 ns/iter (+/- 3)
test bench_enum::bench_decoder_frog                ... bench:       330 ns/iter (+/- 13)
test bench_enum::bench_deserializer_dog            ... bench:       116 ns/iter (+/- 1)
test bench_enum::bench_deserializer_frog           ... bench:       310 ns/iter (+/- 31)
test bench_map::bench_decoder_000                  ... bench:       528 ns/iter (+/- 43)
test bench_map::bench_decoder_003                  ... bench:      2330 ns/iter (+/- 168)
test bench_map::bench_decoder_100                  ... bench:     69124 ns/iter (+/- 6764)
test bench_map::bench_deserializer_000             ... bench:       790 ns/iter (+/- 73)
test bench_map::bench_deserializer_003             ... bench:      2552 ns/iter (+/- 443)
test bench_map::bench_deserializer_100             ... bench:     61059 ns/iter (+/- 3776)
test bench_struct::bench_decoder_0_0               ... bench:       608 ns/iter (+/- 54)
test bench_struct::bench_decoder_1_0               ... bench:      1584 ns/iter (+/- 84)
test bench_struct::bench_decoder_1_5               ... bench:      4294 ns/iter (+/- 799)
test bench_struct::bench_deserializer_0_0          ... bench:       670 ns/iter (+/- 61)
test bench_struct::bench_deserializer_1_0          ... bench:      2035 ns/iter (+/- 153)
test bench_struct::bench_deserializer_1_5          ... bench:      4825 ns/iter (+/- 699)
test bench_vec::bench_decoder_int_000              ... bench:        20 ns/iter (+/- 1)
test bench_vec::bench_decoder_int_003              ... bench:       149 ns/iter (+/- 8)
test bench_vec::bench_decoder_int_100              ... bench:       989 ns/iter (+/- 14)
test bench_vec::bench_decoder_u8_000               ... bench:        16 ns/iter (+/- 0)
test bench_vec::bench_decoder_u8_003               ... bench:       155 ns/iter (+/- 9)
test bench_vec::bench_decoder_u8_100               ... bench:      1424 ns/iter (+/- 13)
test bench_vec::bench_deserializer_int_000         ... bench:        16 ns/iter (+/- 0)
test bench_vec::bench_deserializer_int_003         ... bench:       152 ns/iter (+/- 11)
test bench_vec::bench_deserializer_int_100         ... bench:      1015 ns/iter (+/- 64)
test bench_vec::bench_deserializer_u8_000          ... bench:        16 ns/iter (+/- 1)
test bench_vec::bench_deserializer_u8_003          ... bench:       155 ns/iter (+/- 9)
test bench_vec::bench_deserializer_u8_100          ... bench:      1163 ns/iter (+/- 74)
test json::bench::bench_decoder_001                ... bench:      3951 ns/iter (+/- 523)
test json::bench::bench_decoder_001_streaming      ... bench:      2032 ns/iter (+/- 850)
test json::bench::bench_decoder_500                ... bench:   1936618 ns/iter (+/- 215448)
test json::bench::bench_decoder_500_streaming      ... bench:    831512 ns/iter (+/- 17862)
test json::bench::bench_deserializer_001           ... bench:      3767 ns/iter (+/- 127)
test json::bench::bench_deserializer_001_streaming ... bench:      2070 ns/iter (+/- 67)
test json::bench::bench_deserializer_500           ... bench:   1794293 ns/iter (+/- 63726)
test json::bench::bench_deserializer_500_streaming ... bench:    919105 ns/iter (+/- 56000)
test json::bench::bench_encoder_001                ... bench:      5137 ns/iter (+/- 146)
test json::bench::bench_encoder_001_pretty         ... bench:      7448 ns/iter (+/- 79)
test json::bench::bench_encoder_500                ... bench:   2310173 ns/iter (+/- 33944)
test json::bench::bench_encoder_500_pretty         ... bench:   3396347 ns/iter (+/- 163104)
test json::bench::bench_serializer_001             ... bench:      4009 ns/iter (+/- 412)
test json::bench::bench_serializer_001_pretty      ... bench:      6499 ns/iter (+/- 58)
test json::bench::bench_serializer_500             ... bench:   1721992 ns/iter (+/- 21521)
test json::bench::bench_serializer_500_pretty      ... bench:   2880591 ns/iter (+/- 146516)
2014-06-14 10:48:01 -07:00
Erick Tryzelaar
8e657078ef Update to rust HEAD 2014-06-14 09:15:37 -07:00
Erick Tryzelaar
7a536f22ef Initial version of json serialization working 2014-06-12 23:14:52 -07:00
Erick Tryzelaar
3cf15fb7f3 Update to rust HEAD 2014-06-12 06:31:47 -07:00
Erick Tryzelaar
32d90e4627 Fix ser tests 2014-06-09 21:52:10 -07:00
Erick Tryzelaar
d8fb2abd03 Change the json enum serialization to {"variant":["fields", ...]}
test bench_enum::bench_decoder_dog                   ... bench:       112 ns/iter (+/- 15)
test bench_enum::bench_decoder_frog                  ... bench:       336 ns/iter (+/- 6)
test bench_enum::bench_deserializer_dog              ... bench:       120 ns/iter (+/- 4)
test bench_enum::bench_deserializer_frog             ... bench:       317 ns/iter (+/- 15)
test bench_map::bench_decoder_000                    ... bench:       528 ns/iter (+/- 13)
test bench_map::bench_decoder_003                    ... bench:      2459 ns/iter (+/- 74)
test bench_map::bench_decoder_100                    ... bench:     70756 ns/iter (+/- 1979)
test bench_map::bench_deserializer_000               ... bench:       753 ns/iter (+/- 30)
test bench_map::bench_deserializer_003               ... bench:      2574 ns/iter (+/- 111)
test bench_map::bench_deserializer_100               ... bench:     62374 ns/iter (+/- 1714)
test bench_struct::bench_decoder_0_0                 ... bench:       609 ns/iter (+/- 14)
test bench_struct::bench_decoder_1_0                 ... bench:      1620 ns/iter (+/- 44)
test bench_struct::bench_decoder_1_5                 ... bench:      4393 ns/iter (+/- 88)
test bench_struct::bench_deserializer_0_0            ... bench:       699 ns/iter (+/- 10)
test bench_struct::bench_deserializer_1_0            ... bench:      2160 ns/iter (+/- 53)
test bench_struct::bench_deserializer_1_5            ... bench:      4987 ns/iter (+/- 87)
test bench_vec::bench_decoder_int_000                ... bench:        20 ns/iter (+/- 1)
test bench_vec::bench_decoder_int_003                ... bench:       148 ns/iter (+/- 3)
test bench_vec::bench_decoder_int_100                ... bench:      1009 ns/iter (+/- 44)
test bench_vec::bench_decoder_u8_000                 ... bench:        16 ns/iter (+/- 0)
test bench_vec::bench_decoder_u8_003                 ... bench:       152 ns/iter (+/- 12)
test bench_vec::bench_decoder_u8_100                 ... bench:      1457 ns/iter (+/- 95)
test bench_vec::bench_deserializer_int_000           ... bench:        16 ns/iter (+/- 0)
test bench_vec::bench_deserializer_int_003           ... bench:       153 ns/iter (+/- 9)
test bench_vec::bench_deserializer_int_100           ... bench:      1015 ns/iter (+/- 38)
test bench_vec::bench_deserializer_u8_000            ... bench:        16 ns/iter (+/- 1)
test bench_vec::bench_deserializer_u8_003            ... bench:       160 ns/iter (+/- 130)
test bench_vec::bench_deserializer_u8_100            ... bench:      1225 ns/iter (+/- 112)
test json::tests::bench_decoder_large                ... bench:   1979093 ns/iter (+/- 67769)
test json::tests::bench_decoder_small                ... bench:      4644 ns/iter (+/- 208)
test json::tests::bench_decoder_streaming_large      ... bench:    848383 ns/iter (+/- 96301)
test json::tests::bench_decoder_streaming_small      ... bench:      1834 ns/iter (+/- 120)
test json::tests::bench_deserializer_large           ... bench:   1882598 ns/iter (+/- 137262)
test json::tests::bench_deserializer_small           ... bench:      3945 ns/iter (+/- 161)
test json::tests::bench_deserializer_streaming_large ... bench:    990086 ns/iter (+/- 157794)
test json::tests::bench_deserializer_streaming_small ... bench:      2135 ns/iter (+/- 211)
2014-06-09 07:51:53 -07:00
Erick Tryzelaar
ee3dee8893 Initial version of serialization. 2014-06-08 15:17:18 -07:00
Erick Tryzelaar
485a484ab6 Update to rust HEAD 2014-06-08 15:09:16 -07:00
Erick Tryzelaar
02221908a5 Add license and minor cleanup 2014-06-08 14:52:40 -07:00
Erick Tryzelaar
f10160017d Allow some of the old tests to run. 2014-06-03 20:10:58 -07:00
Erick Tryzelaar
821740f448 add a whole bunch of benchmarks for parsing and deserializing json 2014-06-03 07:10:44 -07:00
Erick Tryzelaar
a78bbf2947 Update to Rust HEAD 2014-06-03 06:43:01 -07:00
Erick Tryzelaar
dac51fe4d2 Update to rust HEAD (2f221c) 2014-05-31 12:28:30 -07:00
Erick Tryzelaar
c58958b1c8 start cleaning up error handling 2014-05-30 23:28:46 -07:00
Erick Tryzelaar
ea5936aa78 Use the right show impl for Json 2014-05-30 23:18:01 -07:00
Erick Tryzelaar
2380321c60 Expose more tests 2014-05-30 23:15:22 -07:00
Erick Tryzelaar
bfd83cef55 Even more tests 2014-05-30 23:06:40 -07:00
Erick Tryzelaar
e6a00d0ef9 Expose more tests 2014-05-30 23:04:41 -07:00
Erick Tryzelaar
5bbe89197e Uncomment more code. 2014-05-30 22:56:08 -07:00
Erick Tryzelaar
8526b9c480 Uncomment more code 2014-05-30 22:43:01 -07:00
Erick Tryzelaar
c6e503f8b3 Start cleaning up warnings and dead code 2014-05-30 22:30:02 -07:00
Erick Tryzelaar
a7b224702c Clean up the enum parsing code. 2014-05-30 22:19:22 -07:00
Erick Tryzelaar
5c0f324f6d implement parsing enums 2014-05-30 22:15:17 -07:00
Erick Tryzelaar
2b5fc86042 Add a helper that gathers tokens 2014-05-30 19:15:05 -07:00
Erick Tryzelaar
0db501e693 Rewrite de::ignore into a struct that impls Deserializable 2014-05-30 19:13:50 -07:00
Erick Tryzelaar
cdf8e0820c Initial support for json deserializing enums 2014-05-29 08:02:06 -07:00
Erick Tryzelaar
27a914cdcf Add support for json deserializing enums and options, clean up tests 2014-05-29 07:05:19 -07:00
Erick Tryzelaar
85fd2797a6 Update to rust HEAD 2014-05-29 06:44:38 -07:00
Erick Tryzelaar
86560857a7 add a JsonDeserializer, clean up tests 2014-05-28 10:46:29 -07:00
Erick Tryzelaar
88631b57cb Actually fully test deserializing structs 2014-05-28 08:10:52 -07:00
Erick Tryzelaar
77a10caf34 Implement deserializing json options 2014-05-28 08:09:19 -07:00
Erick Tryzelaar
674983e5b7 Clean up checking for trailing characters 2014-05-28 07:18:24 -07:00
Erick Tryzelaar
3b76001db5 Handle trailing characters 2014-05-28 07:14:42 -07:00
Erick Tryzelaar
c70e9f0eae structs should deserialize from a map 2014-05-27 21:46:31 -07:00
Erick Tryzelaar
bf58f7999f Get deserializing json objects into structs working 2014-05-27 07:36:57 -07:00
Erick Tryzelaar
38a468ad23 Simplify pattern expecting a token 2014-05-27 07:21:37 -07:00
Erick Tryzelaar
ebab6637d6 add json::from_iter, and start checking errors 2014-05-26 17:02:51 -07:00
Erick Tryzelaar
e58096dcc2 Get all the json types to parse 2014-05-26 14:27:08 -07:00
Erick Tryzelaar
0d56ae5986 Add TreeMap impl of Deserializable 2014-05-26 12:53:37 -07:00
Erick Tryzelaar
0bda36d6d3 get json list deserialization working 2014-05-26 11:08:15 -07:00
Erick Tryzelaar
17e93d3d5d Re-enable json and port to rust HEAD 2014-05-26 10:40:47 -07:00