TableMetadataTools.jl icon indicating copy to clipboard operation
TableMetadataTools.jl copied to clipboard

Make Unitful a weak dependency to improve load time

Open eslgastal opened this issue 9 months ago • 0 comments

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

eslgastal avatar Apr 22 '25 10:04 eslgastal