summaryrefslogtreecommitdiff
path: root/src/test/scala/spray/json/PrettyPrinterSpec.scala
Commit message (Collapse)AuthorAgeFilesLines
* Add support for ScalaJS and Scala NativeJakob Odersky2019-06-101-71/+0
| | | | Binary compatibility with previous versions is maintained.
* CVE-2018-18854 Use TreeMap instead of HashMap for JsObject key/value pairs, ↵Johannes Rudolph2018-11-071-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #277 The problem is that with String's hashCode implementation it is too simple to create synthetic collisions. This allows an attacker to create an object with keys that all collide which leads to a performance drop for the HashMap just for creating the map in the first place. See https://github.com/scala/bug/issues/11203 for more information about the underlying HashMap issue. For the time being, it seems safer to use a TreeMap which uses String ordering. Benchmarks suggest that using a TreeMap is only ~6% slower for reasonably sized JSON objects up to 100 keys. Benchmark for non-colliding keys: Benchmark (_size) (parser) Mode Cnt Score Error Units ExtractFieldsBenchmark.readSpray 1 HashMap thrpt 5 1195832.262 ± 64366.605 ops/s ExtractFieldsBenchmark.readSpray 1 TreeMap thrpt 5 1342009.641 ± 17307.555 ops/s ExtractFieldsBenchmark.readSpray 10 HashMap thrpt 5 237173.327 ± 70341.742 ops/s ExtractFieldsBenchmark.readSpray 10 TreeMap thrpt 5 233510.618 ± 69638.750 ops/s ExtractFieldsBenchmark.readSpray 100 HashMap thrpt 5 23202.016 ± 1514.763 ops/s ExtractFieldsBenchmark.readSpray 100 TreeMap thrpt 5 21899.072 ± 823.225 ops/s ExtractFieldsBenchmark.readSpray 1000 HashMap thrpt 5 2073.754 ± 66.093 ops/s ExtractFieldsBenchmark.readSpray 1000 TreeMap thrpt 5 1793.329 ± 43.603 ops/s ExtractFieldsBenchmark.readSpray 10000 HashMap thrpt 5 208.160 ± 7.466 ops/s ExtractFieldsBenchmark.readSpray 10000 TreeMap thrpt 5 160.349 ± 5.809 ops/s
* Switch JsArray(List) to JsArray(Vector), make parser produce ↵Mathias2014-09-191-37/+37
| | | | JsObject(HashMap) rather than JsObject(ListMap)
* match spec tightly about which characters to encode, fixes #83, #46Johannes Rudolph2014-03-121-1/+1
|
* Remove obsolete /cc/ package directoriesMathias2012-10-121-0/+66