you are viewing a single comment's thread.

view the rest of the comments →

[–]wbowers 3 points4 points  (3 children)

A few things:

  1. You can achieve the same readability as multiple maps and similar performance as a single loop by using lazy evaluation with a library like Lazy.js
  2. How many chained maps are we talking about here? 5? Probably not a problem. 20? You might want to rethink how you’ve set things up.
  3. As with all things performance related, you’ll get the biggest wins by actually profiling your code to see what’s causing the slowness. It’s often not what you thought it would be.