# Combining two using statements is 2.5X slower than separate statements

**URL:** <https://discourse.julialang.org/t/combining-two-using-statements-is-2-5x-slower-than-separate-statements/11629>\
**Category:** Internals & Design\
**Created:** [June 12, 2018, 9:38pm UTC](https://discourse.julialang.org/t/combining-two-using-statements-is-2-5x-slower-than-separate-statements/11629 "2018-06-12T21:38:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drew\_Robson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drew_robson/32/44529_2.png) [@Drew\_Robson](https://discourse.julialang.org/u/Drew_Robson)\
**Post date:** [June 12, 2018, 9:38pm UTC](https://discourse.julialang.org/t/combining-two-using-statements-is-2-5x-slower-than-separate-statements/11629/1 "2018-06-12T21:38:21Z")

</div>

If I load two packages (CuArrays and PyPlot) with a single using statement, it takes roughly 2.5X longer than the total time of the two using statements separately.

![image](https://global.discourse-cdn.com/julialang/original/3X/c/8/c83a3270568c3f1264b227766808ac8733114f65.png)

Not sure if this is a known issue, or if the cause is understood, but this seemed strange to me.

This is on 0.7.0-alpha.57 and it’s consistent across many runs. I think I’ve seen similar behavior on 0.6.x as well but I didn’t keep an example so I’m not sure about that.

---

<div class="post-metadata">

**Author:** ![jeff.bezanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff.bezanson/32/48_2.png) [@jeff.bezanson](https://discourse.julialang.org/u/jeff.bezanson)\
**Post date:** [June 12, 2018, 9:47pm UTC](https://discourse.julialang.org/t/combining-two-using-statements-is-2-5x-slower-than-separate-statements/11629/2 "2018-06-12T21:47:37Z")

</div>

Wow, that is surprising. Thanks for catching it and reporting; I’ll look into it.

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [June 12, 2018, 11:30pm UTC](https://discourse.julialang.org/t/combining-two-using-statements-is-2-5x-slower-than-separate-statements/11629/3 "2018-06-12T23:30:42Z")

</div>

For reference:  
[https://github.com/JuliaLang/julia/pull/27549](https://github.com/JuliaLang/julia/pull/27549)

---

<div class="post-metadata">

**Author:** ![Drew\_Robson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drew_robson/32/44529_2.png) [@Drew\_Robson](https://discourse.julialang.org/u/Drew_Robson)\
**Post date:** [June 13, 2018, 2:30am UTC](https://discourse.julialang.org/t/combining-two-using-statements-is-2-5x-slower-than-separate-statements/11629/4 "2018-06-13T02:30:16Z")

</div>

Wonderful, thanks for fixing this so quickly! With that PR, the combined using statement is just as fast as two separate ones.

Out of curiosity, is this applicable to 0.6? Just wondering if this might clear up any issues there.

Edit: I guess the “Backport pending 0.6” label answers my question.
