benji6/imlazy

filter benchmarks: divisibleBy{X} variables does not correspond to the real operations that do

xgbuils opened this issue · 5 comments

Hi @benji6

I was reading the benchmarks implementation and I found in benchmarks/filter.js:

const divisibleBy2 = x => x + 1
const divisibleBy3 = x => x / 2
const divisibleBy5 = x => 3 * x

It seems a copy past of benchmarks/map.js

Cheers!

Yep, you're right, that's what I've done. I've also noticed my performance section is all out of date since they updated the V8 engine in node. imlazy isn't as fast in the benchmarks anymore. I'll fix that typo and make some changes in the readme about performance

I've pushed some changes (e7521bb). Thanks for pointing out this out @xgbuils 👍

You're welcome!

Ouch! I'm seeing your changes and I think that I don't express myself well. filter is a function that usually receives a function of type a -> Boolean and you are passing a function like Number -> Number that could be more suitable for a map function. Then, I expected:

const divisibleBy2 = x => x % 2 === 0
const divisibleBy3 = x => x % 3 === 0
const divisibleBy5 = x => x % 5 === 0

I mean, I think that the intent of the names was right. The problem was the definition.

Cheers!

Oh man - yeah sorry I see the mistake now! So embarrassing! I'll put something more reasonable in there.

Cheers

OK I think it should be fixed now 273bf6a