Skip to content

Separate inner loop of error diffusion #49

@adrhill

Description

@adrhill

As mentioned here by @johnnychen94:

I noticed this only recently; for the innermost for loop, a performance practice is to separate the loops into two parts: 1) border and 2) inner area. The benefits are 1) we can remove unnecessary bounds check for the inner area, and thus 2) we can enable @simd for such simple operations.

See https://github.com/JuliaImages/Images.jl/blob/9796acc8bf1d56d9574c555656fdba362f84a988/src/algorithms.jl#L505-L537 and JuliaImages/ImageBase.jl#22 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions