Make Unitful a weak dependency to improve load time

Open
#4 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
performance

Research direction

Start with the TableMetadataTools package-loading setup and the Julia Package Extensions documentation linked in the issue; use @time_imports with and without Unitful to establish the baseline. Done means Unitful is no longer required for ordinary TableMetadataTools loading while unit-related functionality is available when Unitful is loaded, with the reported load-time cost reduced.

Written by the indexing model from the issue text.

Description

It would be interesting to make Unitful not a required dependency, for example by using Package Extensions to define the unit-related functionality only when Unitful is loaded: https://docs.julialang.org/en/v1/manual/code-loading/#man-extensions

Currently, the Unitful dependency dominates the load time of TableMetadataTools:

julia> Pkg.status()
Status `/tmp/jl_Av2tSv/Project.toml`
  [9ce81f87] TableMetadataTools v0.1.0

julia> @time_imports using TableMetadataTools
      0.5 ms  DataAPI
      0.1 ms  DataValueInterfaces
      0.1 ms  IteratorInterfaceExtensions
      0.1 ms  TableTraits
      2.8 ms  OrderedCollections
      6.8 ms  Tables
    140.8 ms  Unitful
      0.3 ms  TableMetadataTools

https://docs.julialang.org/en/v1/manual/code-loading/#man-extensions

Dominant language
Julia
Stars
19
Forks
1
PR merge metrics
No merged PRs in 30d

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 JuliaData/TableMetadataTools.jl

All issues in JuliaData/TableMetadataTools.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.