switch to using @ebay/nodash/get#12
Conversation
|
Hey @scttdavs, thanks for the PR. We've had some discussions around removing lodash here, but the primary reason to do so is actually to avoid lodash's internal cache. On apps with heavy usage, the cache ends up being very large and requires frequent garbage collection, thereby significantly increasing CPU usage. I wonder if |
|
if paths are variable (different depending on user), then it probably would. I could maybe add an option to disable cache or even remove it entirely.. But even large apps should not have that many different paths right? How large was the cache growing to? Was there a comparison done for performance costs to generate the paths every time? |
|
Some time ago there was investigation done by comparing CPU/GC time for the current lodash version vs. an in-house version without caching, and it found GC improvements. Though the fix wasn't prioritized at the time. I do have the code ready from that fix, so I think I'll put up that PR as well, and then we can use mirroring to test both that PR and this one. That should help validate whether it's the cache that is the issue, or maybe something else. |
uses less js than lodash.get: https://github.com/eBay/nodash
as it is, most teams use
lodashanyway, andlodash.getcode would not be deduped with it.Tests passed locally. I'll past the benchmarks below:
Before:
After: