Skip to content

regression in performance of counting loops #5469

@mlubin

Description

@mlubin

I was playing around with an example for the class I'm preparing and noticed a 30% performance regression in the following code from 0.2 to master:

function normAndMin(x)
    n = 0.0
    m = Inf
    for i in 1:length(x)
        n += x[i]*x[i]
        if x[i] < m
            m = x[i]
        end
    end
    return sqrt(n),m
end

x = rand(100_000_000)
normAndMin(x) # throw away
n,m = @time normAndMin(x)

Julia 0.2:
elapsed time: 0.101895311 seconds (6912 bytes allocated)

Julia master:
elapsed time: 0.135729463 seconds (6812 bytes allocated)

Metadata

Metadata

Assignees

Labels

performanceMust go fasterregressionRegression in behavior compared to a previous version

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions