Understand why Transducers can Improve Performance

Paul Frend
InstructorPaul Frend

Share this video with your friends

Send Tweet

Chaining operations like map and filter on an array can have performance issues as we have to iterate through the whole array for every operation.

In this lesson we explore this problem by doing some basic array transformations and measuring their performance.

We’ve got two utility function to help us with this:

  • arrayOfRandoms is a higher order function which helps us create a range of random numbers
  • timeIt will help us measure how long functions take to execute

It's important to understand this problem and why it occurs before we move on to how transducers handle it differently.

press0
press0
~ 3 years ago

link to code

Paul Frend
Paul Frendinstructor
~ 3 years ago

@press0 we're in the process of adding the sample code.

Adam
Adam
~ 3 years ago

@Paul, what is the tool you are using for inline evaluation?

Antonio Sejas
Antonio Sejas
~ 3 years ago

@paul what code editor do you use ?? Thank you ! ;)

Adam
Adam
~ 3 years ago

Sublime text 3

Adam Bertrand

Paul Frend
Paul Frendinstructor
~ 3 years ago

@Adam, sorry for the late reply. The inline evaluation is using Quokka

@Antonio I'm using Webstorm here with all the extra toolbars hidden