Skip to content

inference regression on afoldl #39175

@jmichel7

Description

@jmichel7

I tried my big algebra package on 1.6.0-beta1. Many parts are slightly faster, but one important part is many times slower.
I found several problems but the shortest MWE is

struct Perm
  d::Vector{Int}
end
function Perm(x::Integer...)
  if isempty(x) return Perm(Int[]) end
  d=Int.(1:max(x...))
  for i in 1:length(x)-1
    d[x[i]]=x[i+1]
  end
  d[x[end]]=x[1]
  Perm(d)
end
struct SymmetricGroup
  gens::Vector{Perm}
end
SymmetricGroup(n::Int)=SymmetricGroup([Perm(i,i+1) for i in 1:n-1])

using BenchmarkTools

# on julia 1.5.3
@btime SymmetricGroup(20)
  1.080 μs (39 allocations: 3.72 KiB)

# on julia 1.6.0-beta1
@btime SymmetricGroup(20)
  7.658 μs (115 allocations: 6.39 KiB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceMust go fasterregressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions