poor performance on lodash flow check
See original GitHub issueI found that #1696 (better handling null/undefined) introduced bad performance to flow checking
tested with flow version 0.63, 0.64 tested script
// @flow
import _ from 'lodash';
_.map([], () => 0);
comparison | file | time spent |
---|---|---|
before | before pr #1696 | ~2 seconds |
after | current master | ~45 seconds |
Could we do anything to improve this?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Performance degradation of flow check · Issue #5858 - GitHub
It seems that the flow-typed definitions for lodash v4.x.x (https://github.com/flowtype/flow-typed/blob/master/definitions/npm/lodash_v4.x.x/ ...
Read more >Better and more performant than lodash chain - Stack Overflow
Flow works better with lodash/fp, since the methods are iteratee-first and data-last. This saves the need to partial right every method that ...
Read more >Lodash Documentation
Checks if value is an empty object, collection, map, or set. Objects are considered empty if they have no own enumerable string keyed...
Read more >Lodash Performance Sucks! - TechFindings
The conclusion is that from a performance perspective Functional Programming sucks. Lodash sucks too, but a little bit less so than the standard ......
Read more >Lodash FP usage retrospective - Coding with J.S.
I recently performed a small analysis of our usage of the library to spot some weird usages that have slipped through code reviews...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Removing all the individual module declarations (introduced here) solved this for me. @maxmalov
@maxmalov You’re right, I’m sorry. You just added the fp exports and I removed all.
Still, removing all the individual exports speeds up flow. Here’s a test repo where flow only reads the lodash libdef and does nothing else when you run
yarn flow
and there’s almost a minute difference. https://github.com/Zmetser/lodash_flow_test