# Varinfo() slow if variable large

**URL:** <https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585>\
**Category:** Performance\
**Created:** [March 5, 2020, 3:17pm UTC](https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585 "2020-03-05T15:17:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [March 5, 2020, 3:17pm UTC](https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585/1 "2020-03-05T15:17:40Z")

</div>

I’ve often had not-so-large `DataFrames` loaded, and performance with `varinfo()` was good. When a `DataFrame` exceeds a certain size, e.g. beyond 100 MB, `varinfo()` is very slow. (I didn’t check the exact size, but the one loaded now is about 165 MB.)

I’m wondering (without getting too technical). How is `varinfo()` handling it? All a person’s interested in is the mere size of the variable. Should it really take much more time to merely enumerate the variable list?

If I’m an ignorant fool in this matter, please explain.

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [March 5, 2020, 3:30pm UTC](https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585/2 "2020-03-05T15:30:11Z")

</div>

Are you sure it is not a precompilation issue? `varinfo` most probably uses something very similar to `summarysize` which is a non-trivial function (as it traverses the object). You can check the code [here](https://github.com/JuliaLang/julia/blob/master/base/summarysize.jl).

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [March 6, 2020, 12:59pm UTC](https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585/3 "2020-03-06T12:59:38Z")

</div>

As far as I know, it’s not a precompilation issue.

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [March 6, 2020, 1:30pm UTC](https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585/4 "2020-03-06T13:30:03Z")

</div>

Then its calculating the variable size that is slow. DataFrame can be a complex structure so probably if you have a lot of nested variable sized values i.e. vectors of strings can be a pain. I’m speculating here …

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [March 6, 2020, 2:02pm UTC](https://discourse.julialang.org/t/varinfo-slow-if-variable-large/35585/5 "2020-03-06T14:02:36Z")

</div>

Interesting. It does have many String arrays/columns.
