IGListKit/Source/Common
Ryan Nystrom afd2d29eec Add diffing optimization when result is all deletes or inserts
Summary:
In an attempt to best other diffing libraries, I noticed that pure insert/delete diffing results would be almost 5x slower than changes between existing arrays. This is pretty much a benchmarking enhancement, but improves diffing performance by ~5x when the from-array or to-array is empty.

```
// OLD only inserts
avg: 0.007469, min: 0.006998, max: 0.016550, p50: 0.007254, p75: 0.007712, p90: 0.007899, p95: 0.008345, p99: 0.016550
// NEW
avg: 0.001392, min: 0.001256, max: 0.006772, p50: 0.001289, p75: 0.001348, p90: 0.001533, p95: 0.001614, p99: 0.006772
```

```
// OLD only deletes
avg: 0.005821, min: 0.005669, max: 0.006511, p50: 0.005766, p75: 0.005852, p90: 0.006030, p95: 0.006204, p99: 0.006511
// NEW
avg: 0.001184, min: 0.001096, max: 0.001673, p50: 0.001123, p75: 0.001212, p90: 0.001378, p95: 0.001467, p99: 0.001673
```

Note the average time improvements (seconds).

Benchmarking done on a 4s w/ this project:
https://pxl.cl/bLBB

Reviewed By: manicakes

Differential Revision: D6968683

fbshipit-source-id: 0d8e058f0aaa9ce756ca69326527d04504ac6429
2018-02-13 10:13:44 -08:00
..
Internal Assert duplicate objects and check object types on map lookup 2017-11-30 12:48:07 -08:00
IGListAssert.h Remove IGListSectionType 2017-04-19 08:26:30 -07:00
IGListBatchUpdateData.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListBatchUpdateData.mm Prevent duplicate item deletes and drop reload collisions 2017-04-19 17:17:41 -07:00
IGListCompatibility.h Added compatibility header 2016-12-24 10:44:25 -08:00
IGListDiff.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListDiff.mm Add diffing optimization when result is all deletes or inserts 2018-02-13 10:13:44 -08:00
IGListDiffable.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListDiffKit.h Added Subspec for Diffing 2016-12-27 12:44:27 -08:00
IGListExperiments.h Test fixing double insert crash 2017-12-20 06:31:42 -08:00
IGListIndexPathResult.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListIndexPathResult.m Add changeCount API to index set and path results 2017-07-12 12:54:28 -07:00
IGListIndexSetResult.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListIndexSetResult.m Add changeCount API to index set and path results 2017-07-12 12:54:28 -07:00
IGListMacros.h Add debug dump scripts 2017-04-21 16:46:06 -07:00
IGListMoveIndex.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListMoveIndex.m Move macOS and diffing files to Common dir 2016-12-19 12:29:24 -08:00
IGListMoveIndexPath.h Swift name annotations 2017-05-09 14:31:28 -07:00
IGListMoveIndexPath.m Move macOS and diffing files to Common dir 2016-12-19 12:29:24 -08:00
NSNumber+IGListDiffable.h Move macOS and diffing files to Common dir 2016-12-19 12:29:24 -08:00
NSNumber+IGListDiffable.m Move macOS and diffing files to Common dir 2016-12-19 12:29:24 -08:00
NSString+IGListDiffable.h Move macOS and diffing files to Common dir 2016-12-19 12:29:24 -08:00
NSString+IGListDiffable.m Move macOS and diffing files to Common dir 2016-12-19 12:29:24 -08:00