# Is \`using Package: function\` supposed to save precompile time, or just prevent namespace collisions?

**URL:** <https://discourse.julialang.org/t/is-using-package-function-supposed-to-save-precompile-time-or-just-prevent-namespace-collisions/64898>\
**Category:** New to Julia\
**Tags:** namespaces\
**Created:** [July 19, 2021, 3:12am UTC](https://discourse.julialang.org/t/is-using-package-function-supposed-to-save-precompile-time-or-just-prevent-namespace-collisions/64898 "2021-07-19T03:12:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxkapur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxkapur/32/21208_2.png) [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Post date:** [July 19, 2021, 3:12am UTC](https://discourse.julialang.org/t/is-using-package-function-supposed-to-save-precompile-time-or-just-prevent-namespace-collisions/64898/1 "2021-07-19T03:12:56Z")

</div>

I often import a package even though I am only planning on using one or two functions from it:

```julia
julia> @time using Distributions
  1.420353 seconds (1.77 M allocations: 113.360 MiB, 0.27% compilation time)

```

I am thinking about replacing these lines with ones that just import the functions I am using.

However, doing so doesn’t save me any time at the REPL:

```julia
julia> @time using Distributions: Gumbel
  1.390181 seconds (1.77 M allocations: 113.344 MiB, 0.29% compilation time)

julia> @time using Distributions
  0.001797 seconds (251 allocations: 16.266 KiB)

```

On the other hand, perhaps when I am precompiling a package that is `using Distributions`, the time savings will become apparent. Is this the case?

If not, then what is the purpose of calling `using Distributions: Gumbel`? Is it just to safeguard against namespace collisions?

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [July 19, 2021, 4:50am UTC](https://discourse.julialang.org/t/is-using-package-function-supposed-to-save-precompile-time-or-just-prevent-namespace-collisions/64898/2 "2021-07-19T04:50:09Z")

</div>

It would just guard against namespace collisions.

If you want to save time, try PackageCompiler.jl to build the package into your native system image.
