Skip to content

Performance regression in ccall on master and 1.12-beta #58449

@thofma

Description

@thofma

We noticed a large increase in runtime and allocations in https://github.com/Nemocas/Nemo.jl, due to the following regression in a simple ccall:

On 1.11.5:

julia> using BenchmarkTools, Nemo # 0.50.0

julia> x = ZZ(1);

julia> f(z) = ccall((:fmpz_mul, Nemo.libflint), Nothing, (Ref{ZZRingElem}, Ref{ZZRingElem}, Ref{ZZRingElem}), z, z, z);

julia> @btime f($x)
  5.997 ns (0 allocations: 0 bytes)

On master and 1.12-beta:

julia> @btime f($x)
  412.824 ns (3 allocations: 48 bytes)

Bisect points to 8bf2802 (@vtjnash)

Metadata

Metadata

Assignees

Labels

ffiforeign function interfaces, ccall, etc.performanceMust go fasterregression 1.12Regression in the 1.12 release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions