Open guoyunhe opened 8 months ago
I did a performance test with vitest:
So I think you should take a look at https://youmightnotneed.com/lodash/#chunk which is way more efficient than current example in this repo.
const chunk = (arr, chunkSize = 1, cache = []) => { const tmp = [...arr] if (chunkSize <= 0) return cache while (tmp.length) cache.push(tmp.splice(0, chunkSize)) return cache }
I did a performance test with vitest:
So I think you should take a look at https://youmightnotneed.com/lodash/#chunk which is way more efficient than current example in this repo.