Are promises more efficient than observables?

I've been learning about promises and observables recently. I found a lot of good information about the feature differences, but I was wondering if there were any performance / efficiency implications between promises and observables?

Note: I also looked through this post: Promise vs Observable but I didn't see any mention about efficiency.

2 answers

  • answered 2018-10-11 19:31 joshin_my_tots

    There aren't any performance differences, they're just different paradigms for returning data as Promises return once but Observables return data like a stream.

  • answered 2018-10-11 22:31 richdurazo

    Have you seen this post? It explains the differences pretty well.

    You should look at it from a standpoint of --> "what's the best for my situation" rather than --> "which is more efficient".

    Because they are both equally efficient depending on how you implement them.

    Determine what is best depending on your use case. The end of this article in the "Which Approach Should You Use?" sums it up pretty well.

    (example: if you are working with angular 2+ I would argue that for "efficiency" in that case would be observables, if not just to make your life easier);