Speed creating formula

Open
#164 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
julia
Domain
data, performance

Research direction

Start by reproducing the two @formula examples in the Julia REPL and compare their allocations and elapsed time. Profile formula creation for expressions containing functions such as log(x), then determine whether the reported overhead can be reduced without changing formula behavior. Done means the function-containing example is measurably faster and remains correct.

Written by the indexing model from the issue text.

Description

On my computer, it takes 0.3s to create a formula with functions in the REPL:

using StatsModels
@time @formula(y ~ x+y)
#  0.000022 seconds (16 allocations: 912 bytes)
@time @formula(y ~ log(x) + log(y))
#  0.355020 seconds (1.13 M allocations: 57.160 MiB, 6.92% gc time)

This sounds excessive. Is there a way to make this faster?

Dominant language
Julia
Stars
252
Forks
36
Avg merge
3h 14m
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaStats/StatsModels.jl

All issues in JuliaStats/StatsModels.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.