---
title: "Wolf Nederpel (@wnederpel) | Hashnode"
description: "Wolf Nederpel (@wnederpel) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@wnederpel"
---

@wnederpel

# Wolf Nederpel

@wnederpel · Joined October 2024

## Comments

[I had made a mistake, wrote my code as a script as such: using BenchmarkTools numbers = rand(100) num = 0.001 println("Size of test array $(length(numbers))") println("Roughly $(num\*100)% of entries satisfy condition (entry < $num)") println() println("result with <($num)") @btime any(<(num), numbers) println("result with x -> x < $num") @btime any(x -> x < num, numbers) println("numbers .< $num") @btime any(numbers .< num) However this has to allocate space for the array and number for each call to any. In the any(x -> x < num) case it even has to allocate num for each iteration done by any. This lead to confusion on my part as any(x -> x < num) slowed down more than the other approaches when more iterations were required to find a match which I initially did not expect.](https://hashnode.com/posts/straightforward-functional-programming-examples-in-julia/66ea9f397fbba42647d1a479/comment/6704e6380c41bccb83c67e3e#reply-670670c3e04931f33be331ed)

Reply · Article · Oct 9, 2024 · [Straightforward Functional Programming Examples in Julia](https://hashnode.com/posts/straightforward-functional-programming-examples-in-julia/66ea9f397fbba42647d1a479)

[Regarding the first example it's interesting to note that while for small arrays and searching for a frequent occurence using x->xx<num seems directly related to the rarity of the searched for condition. Even for small arrays where the condition does not occur, this approah is significantly slower than the other approaches (and the vectorized approach is fastest).](https://hashnode.com/posts/straightforward-functional-programming-examples-in-julia/66ea9f397fbba42647d1a479/comment/6704e6380c41bccb83c67e3e)

Comment · Article · Oct 8, 2024 · [Straightforward Functional Programming Examples in Julia](https://hashnode.com/posts/straightforward-functional-programming-examples-in-julia/66ea9f397fbba42647d1a479)
