Coder Social home page Coder Social logo

Comments (4)

kimikage avatar kimikage commented on July 2, 2024

Just FYI, this problem is reproduced by using precompile(test_precomp, (Int,)) directly without PrecompileTools.

Also, for i in 1:N is necessary to ensure that the allocation occurs with each call, but is not necessary to reproduce the problem itself.

from julia.

kimikage avatar kimikage commented on July 2, 2024

We now have PkgCacheInspector.jl. However, I could not find the cause.

Edit:
SnoopCompile.@snoopi_deep also helps to understand what is happening.

from julia.

kimikage avatar kimikage commented on July 2, 2024

Despite the use of function pointers, this problem does not occur in the following simple case.

function test_precomp()
    ptr = @cfunction(cos, Float64, (Float64,))
    ccall(ptr, Float64, (Float64,), 0.0)
end

Edit:
So, the generated function do_call() might be relevant.
https://github.com/yuyichao/FunctionWrappers.jl/blob/ad1cea6fd36a7e72c2755efacd4f28b52fbb1f6a/src/FunctionWrappers.jl#L125-L142

Edit2:
There is a change (PR yuyichao/FunctionWrappers.jl#31) in FunctionWrappers#master, but at least this problem still occurs.

from julia.

amilsted avatar amilsted commented on July 2, 2024

In case it's a clue: I see allocations like this from FunctionWrappers used in precompiled code in a large codebase (the allocations go away if I don't precompile), but only on Apple Silicon (unlike the minimal case above). For some reason, the problem goes away on x86. Perhaps related to yuyichao/FunctionWrappers.jl#30?

from julia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.