gramps-graphql / gramps--legacy

The core data source combination engine of GrAMPS.
https://gramps.js.org
MIT License
197 stars 13 forks source link

Refactor mapResolvers to use Object.keys #23

Closed jlengstorf closed 6 years ago

jlengstorf commented 6 years ago

Per the V8 team, using for...in has performance issues:

https://twitter.com/bmeurer/status/927500214436589568

We should swap it out in https://github.com/gramps-graphql/gramps/blob/master/src/lib/mapResolvers.js#L3-L14

corycook commented 6 years ago

It looks like it's using Object.keys already with for...of

jlengstorf commented 6 years ago

Oh, yep. Ha.

We may still want to refactor this to use a map instead (to avoid nested loops and syntax that clearly confused me 😆).

ecwyne commented 6 years ago

My preference originally was to use R.map, it always makes me with there was Object.map

Here's a PR https://github.com/gramps-graphql/gramps/pull/24 using forEach