Thursday, July 10, 2014

DTO - UI Models

I'm a big fan of UI view models. The only argument I get against is "it's too slow". No-one says they are too lazy to write the code that makes it better, easier to test, creates a separation of concerns, and makes SOLID code ... no no no .... they say it runs too slow.
OK - let's say that we won the argument with the above.  What's the best way to copy things?  I try 3 ways: 
  1.  lodash (faster and better than underscore) -- my preferred syntax.
  2.  The JS for loop. 
  3. Native Angular forEach.

See the results here: http://jsperf.com/dudeman
They are all fast!

No comments:

Post a Comment