(self)
| 276 | # JSON MICRO-BENCHMARKS |
| 277 | class JsonEncodingTest(MicroTest): |
| 278 | def setUp(self): |
| 279 | super().setUp() |
| 280 | # Location of test data. |
| 281 | self.document = json_util.loads(self.file_data) |
| 282 | # Note: use the BSON size as the data size so we can compare BSON vs JSON performance. |
| 283 | self.data_size = len(encode(self.document)) * NUM_DOCS |
| 284 | |
| 285 | def do_task(self): |
| 286 | for _ in range(NUM_DOCS): |