# Potential error in the performance tips page

**URL:** <https://discourse.julialang.org/t/potential-error-in-the-performance-tips-page/113286>\
**Category:** Performance\
**Tags:** documentation\
**Created:** [April 20, 2024, 11:37pm UTC](https://discourse.julialang.org/t/potential-error-in-the-performance-tips-page/113286 "2024-04-20T23:37:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee-ranaweer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lee-ranaweer/32/208671_2.png) [@lee-ranaweer](https://discourse.julialang.org/u/lee-ranaweer)\
**Post date:** [April 20, 2024, 11:37pm UTC](https://discourse.julialang.org/t/potential-error-in-the-performance-tips-page/113286/1 "2024-04-20T23:37:54Z")

</div>

Hello, I am new to Julia. I was working through the examples on the performance tips page when I ran into this code in the [types with values-as-parameters section](https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-value-type). The example code is included below as well.

```julia
function array3(fillval, ::Val{N}) where N
    fill(fillval, ntuple(d->3, Val(N)))
end

function filter3(A::AbstractArray{T,N}) where {T,N}
    kernel = array3(1, Val(N))
    filter(A, kernel)
end

```

There seems to be an error when the example calls filter() with an AbstractArray as an argument where a function is expected.

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [April 21, 2024, 9:50am UTC](https://discourse.julialang.org/t/potential-error-in-the-performance-tips-page/113286/2 "2024-04-21T09:50:20Z")

</div>

As you say, the example code would throw an error. Good catch!

The `filter` is probably a placeholder name (like `foo`) that is assumed to be a convolution filter, not `Base.filter`.

That can be assumed from the context and the term `kernel`, but without such prior knowledge, it is certainly unkind.  
Also, it is not recommended to define a function named `filter`, as DSP.jl uses the function name `filt` instead of `filter`.

So I think this is worth being filed as an issue.

---

<div class="post-metadata">

**Author:** ![kimikage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimikage/32/14534_2.png) [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Post date:** [April 21, 2024, 10:41pm UTC](https://discourse.julialang.org/t/potential-error-in-the-performance-tips-page/113286/3 "2024-04-21T22:41:10Z")

</div>

xref: [Confusing error in the performance tips page · Issue #54170 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/54170)
