Commit 1f7374c
Add method to apply patch to serialized data without extracting the mask
Summary:
Today we extract read/write mask from patch, so that we partially materialize the data.
This is not always fast (one reason is that the implementation of extracting mask is slow and there is a room to optimize).
Let's create another version to apply mask directly.
```
$ buck run mode/opt fbcode//thrift/lib/cpp2/protocol:patch_and_mask_bench
Executing actions. Remaining 0/23 1:13.8s exec time total
Command: run. Finished 10 local, 1 remote
Time elapsed: 35.6s
BUILD SUCCEEDED - starting your binary
============================================================================
[...]plyPatchToSerializedDataBenchmark.cpp relative time/iter iters/s
============================================================================
few_small_fields 169.56us 5.90K
few_small_fields_partial_deser 10158.% 1.67us 599.05K
large_fields 345.91us 2.89K
large_fields_partial_deser 114.01% 303.41us 3.30K
all_small_fields 2.28ms 438.14
all_small_fields_partial_deser 18.884% 12.09ms 82.74
clear_large_fields 114.54us 8.73K
clear_large_fields_partial_deser 114.60% 99.95us 10.01K
few_map_elems_with_put 2.49ms 401.22
few_map_elems_with_put_partial_deser 37.184% 6.70ms 149.19
all_map_elems_with_put 8.16ms 122.53
all_map_elems_with_put_partial_deser 49.702% 16.42ms 60.90
few_map_elems_with_patch_after 2.60ms 385.04
few_map_elems_with_patch_after_partial_deser 38.937% 6.67ms 149.92
all_map_elems_with_patch_after 15.48ms 64.60
all_map_elems_with_patch_after_partial_deser 36.874% 41.98ms 23.82
```
Reviewed By: pranavtbhat
Differential Revision: D86915691
fbshipit-source-id: d6234e1cf8993c64b0a28aa23808bffd765a15041 parent f661625 commit 1f7374c
3 files changed
Lines changed: 46 additions & 24 deletions
File tree
- third-party/thrift/src/thrift/lib
- cpp2/protocol
- thrift/detail
Lines changed: 24 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 230 | | |
239 | | - | |
| 231 | + | |
| 232 | + | |
240 | 233 | | |
241 | 234 | | |
242 | | - | |
| 235 | + | |
243 | 236 | | |
244 | 237 | | |
245 | 238 | | |
246 | 239 | | |
247 | | - | |
| 240 | + | |
| 241 | + | |
248 | 242 | | |
249 | 243 | | |
250 | | - | |
| 244 | + | |
251 | 245 | | |
252 | 246 | | |
253 | 247 | | |
254 | 248 | | |
255 | | - | |
| 249 | + | |
| 250 | + | |
256 | 251 | | |
257 | 252 | | |
258 | | - | |
| 253 | + | |
259 | 254 | | |
260 | 255 | | |
261 | 256 | | |
262 | 257 | | |
263 | | - | |
| 258 | + | |
| 259 | + | |
264 | 260 | | |
265 | 261 | | |
266 | | - | |
| 262 | + | |
267 | 263 | | |
268 | 264 | | |
269 | 265 | | |
270 | 266 | | |
271 | | - | |
| 267 | + | |
| 268 | + | |
272 | 269 | | |
273 | 270 | | |
274 | | - | |
| 271 | + | |
275 | 272 | | |
276 | 273 | | |
277 | 274 | | |
278 | 275 | | |
279 | | - | |
| 276 | + | |
| 277 | + | |
280 | 278 | | |
281 | 279 | | |
282 | | - | |
| 280 | + | |
283 | 281 | | |
284 | 282 | | |
285 | 283 | | |
286 | 284 | | |
287 | | - | |
| 285 | + | |
| 286 | + | |
288 | 287 | | |
289 | 288 | | |
290 | | - | |
| 289 | + | |
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
295 | | - | |
| 294 | + | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1998 | 1998 | | |
1999 | 1999 | | |
2000 | 2000 | | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
2001 | 2011 | | |
2002 | 2012 | | |
2003 | 2013 | | |
2004 | 2014 | | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
2005 | 2021 | | |
2006 | 2022 | | |
2007 | 2023 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
512 | 518 | | |
513 | 519 | | |
514 | 520 | | |
| |||
0 commit comments