Things to optimize [x] extract errors [x] don't enable all features by default [ ] "undefined" "object" "function" prototype undefined bind, getOwnPropertyies, isArray etc + buildin FNs ? [x] kill hooks [x] _ postfix all members [x] clean up finalize [x] remove die [x] own invariant [ ] update docs [ ] plugin tests [ ] check if we can create more local vars [x] verify performance [ ] kill ownKeys? [x] kill enumerations [ ] check todos [ ] kill marchChangesSweep recursive if possible and no perf impact [ ] optimize each closures away? pass in additional args? [x] document performance tip: if externally added data is frozen, it doesn't recurse (also update related issue) #465 [ ] put some invariants behind __DEV__ [x] check for plugin specific utils [ ] bind util [ ] eliminate switches Import size report for immer: ┌───────────────────────┬───────────┬────────────┬───────────┐ │ (index) │ just this │ cumulative │ increment │ ├───────────────────────┼───────────┼────────────┼───────────┤ │ import * from 'immer' │ 6761 │ 0 │ 0 │ │ produce │ 4048 │ 4048 │ 0 │ │ enableES5 │ 4908 │ 4916 │ 868 │ │ enableMapSet │ 5007 │ 5769 │ 853 │ │ enablePatches │ 4836 │ 6544 │ 775 │ └───────────────────────┴───────────┴────────────┴───────────┘ (this report was generated by npmjs.com/package/import-size) --- Extracted errors Import size report for immer: ┌───────────────────────┬───────────┬────────────┬───────────┐ │ (index) │ just this │ cumulative │ increment │ ├───────────────────────┼───────────┼────────────┼───────────┤ │ import * from 'immer' │ 6271 │ 0 │ 0 │ │ produce │ 3727 │ 3727 │ 0 │ │ enableES5 │ 4516 │ 4524 │ 797 │ │ enableMapSet │ 4589 │ 5348 │ 824 │ │ enablePatches │ 4444 │ 6054 │ 706 │ └───────────────────────┴───────────┴────────────┴───────────┘ (this report was generated by npmjs.com/package/import-size) Mangled props: Import size report for immer: ┌───────────────────────┬───────────┬────────────┬───────────┐ │ (index) │ just this │ cumulative │ increment │ ├───────────────────────┼───────────┼────────────┼───────────┤ │ import * from 'immer' │ 6132 │ 0 │ 0 │ │ produce │ 3613 │ 3613 │ 0 │ │ enableES5 │ 4420 │ 4428 │ 815 │ │ enableMapSet │ 4439 │ 5227 │ 799 │ │ enablePatches │ 4319 │ 5929 │ 702 │ └───────────────────────┴───────────┴────────────┴───────────┘ (this report was generated by npmjs.com/package/import-size) After hooks:[ Import size report for immer: ┌───────────────────────┬───────────┬────────────┬───────────┐ │ (index) │ just this │ cumulative │ increment │ ├───────────────────────┼───────────┼────────────┼───────────┤ │ import * from 'immer' │ 5983 │ 0 │ 0 │ │ produce │ 3454 │ 3454 │ 0 │ │ enableES5 │ 4270 │ 4278 │ 824 │ │ enableMapSet │ 4285 │ 5079 │ 801 │ │ enablePatches │ 4154 │ 5770 │ 691 │ └───────────────────────┴───────────┴────────────┴───────────┘ (this report was generated by npmjs.com/package/import-size) ] After finalize cleanup: [ Import size report for immer: ┌───────────────────────┬───────────┬────────────┬───────────┐ │ (index) │ just this │ cumulative │ increment │ ├───────────────────────┼───────────┼────────────┼───────────┤ │ import * from 'immer' │ 5911 │ 0 │ 0 │ │ produce │ 3397 │ 3397 │ 0 │ │ enableES5 │ 4199 │ 4208 │ 811 │ │ enableMapSet │ 4217 │ 5001 │ 793 │ │ enablePatches │ 4091 │ 5693 │ 692 │ └───────────────────────┴───────────┴────────────┴───────────┘ (this report was generated by npmjs.com/package/import-size) ] Killed enumerations: Import size report for immer: ┌───────────────────────┬───────────┬────────────┬───────────┐ │ (index) │ just this │ cumulative │ increment │ ├───────────────────────┼───────────┼────────────┼───────────┤ │ import * from 'immer' │ 5750 │ 0 │ 0 │ │ produce │ 3252 │ 3252 │ 0 │ │ enableES5 │ 4046 │ 4055 │ 803 │ │ enableMapSet │ 4071 │ 4847 │ 792 │ │ enablePatches │ 3936 │ 5528 │ 681 │ └───────────────────────┴───────────┴────────────┴───────────┘ (this report was generated by npmjs.com/package/import-size) Minimize plugin api's: 3196 add draft optimization 3199 invariant 3094