3 ms·
Fixed for running a proper imperative version instead of the functional-oriented 'imperative' version of the original author: http://jsperf.com/oop-vs-ramda/4
by idlewan 12y ago
Fixed for running a proper imperative version instead of the functional-oriented 'imperative' version of the original author:
http://jsperf.com/oop-vs-ramda/4 http://jsperf.com/oop-vs-ramda/4
TL;DR: Imperative is faster than functional. Functional is shorter (33% slower in chromium, 83% slower in firefox), but might be more readable depending on your preferences.
- pritambaral 12y agoPardon me if I read it wrong, but you just removed the promises, didn't you? Anyway, doing the same to the FP version yields almost equal speeds (Chromium): http://jsperf.com/oop-vs-fp http://jsperf.com/oop-vs-fp
- idlewan 12y agoI removed all the useless promises, yes. The one remaining is the one after fetchData, which looks like it could be async and make use of a promise. It only yields equal speeds in chromium (good to know), although if you try in firefox, imperative is still 4 times faster.