GithubHelp home page GithubHelp logo

Comments (4)

pdeffebach avatar pdeffebach commented on May 27, 2024

Thank you for your bug report!

It is true that @astable will be slower outside of a function. The reason is that DataFramesMeta.jl creates anonymous functions which and calling them requires specialization on input and output type. For the @astable behavior, the output type is complicated, as the names and values are stored in type information of a NamedTuple.

That said, I can't replicate your issue on version 1.9. I get roughly comparable timings.

julia> @time @chain df begin
               @rtransform @astable begin
                       b = :a * 10
                       c = mean(b)
                       :d = b - c
               end
       end;
  0.052417 seconds (64.17 k allocations: 3.484 MiB, 97.60% compilation time)

julia> @time @chain df begin
               @rtransform(:b = :a * 10)
               @rtransform(:c = mean(:b))
               @rtransform(:d = :b - :c)
               @select(:a, :d)
       end;
  0.045937 seconds (45.52 k allocations: 3.869 MiB, 96.93% compilation time)

Can you double check your measurements and give me your version info?

from dataframesmeta.jl.

mbataillou avatar mbataillou commented on May 27, 2024

So I double checked the results and found something potentially interesting!

In the REPL I get a similar timing just as you, but the above timings came from running inside a Pluto notebook.
To triple check I ran the above in a Pluto notebook, and there you get the 40x slow down again.

Seems like the issue is using @astable outside a function in a Pluto notebook.

Here is my version info

Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 12 × Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 6 on 12 virtual cores
Environment:
  JULIA_DEPOT_PATH = /Users/xxx/.julia:/Applications/Julia-1.9.app/Contents/Resources/julia/local/share/julia:/Applications/Julia-1.9.app/Contents/Resources/julia/share/julia
  JULIA_LOAD_PATH = @:@v#.#:@stdlib
  JULIA_REVISE_WORKER_ONLY = 1

from dataframesmeta.jl.

pdeffebach avatar pdeffebach commented on May 27, 2024

That's pretty frustrating. Can you post an issue with Pluto.jl? (Or their internal tracker or whatever they use) and I can cross-link with this issue?

from dataframesmeta.jl.

pdeffebach avatar pdeffebach commented on May 27, 2024

Bumping this @mbataillou did you ever file an issue with Pluto.jl?

from dataframesmeta.jl.

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.