Official Statement
In case some of you missed it: There was an official reply from one of the WRI devs recently in our chat
Hi. This is Jose, from Wolfram. We are aware of an unacceptable slowdown in some Dataset expressions, due to a bad dynamic interaction with the summary boxes of some objects. Both the TimeSeries objects of the coronavirus datasets and the InterpolatingFunction objects in the example given before typeset via summary boxes. We are working on a solution and will release it as soon as it is available.
At this point, Szabolcs answered
Thanks for the update. The example I posted does not have any summary boxes though, and it still makes the FE quite literally unusable. Import["https://covid.ourworldindata.org/data/ecdc/total_cases.csv", "Dataset", HeaderLines -> 1]
and the reply was
Many thanks for this example, @Szabolcs. We are looking into it too, and hope to have a fix very soon. We are improving Dataset in multiple ways, and WL 12.1 has focused on increased interactivity, Grid-like styling capabilities, storage of data in place, copy-paste, and other FrontEnd-related things. Summary boxes and similar typesetting constructs are important to identify and understand expressions, but they should not make the system much slower, of course.
Let's hope for the best.
Original Answer
Not an official answer nor a solution. Just some insight. I reported this issue about 4 months ago for the pre-release because I experienced considerable slowdowns when working with things that are "nicely rendered" in the front end. This includes dates, time-series, interpolating functions, etc. The issue is particularly noticeable when you have a data-set (in itself a formatted table with dynamic stuff) that contains things like TimeSeries
.
My go-to example is
res = ResourceData["Epidemic Data for Novel Coronavirus COVID-19"]
This displays 20 rows and 7 columns and breaks my Linux and macOS front end. At home I have a Intel i7 Extreme with 8 cores (32GB RAM) and my macOS is running on the latest iMac Pro with 32GB RAM and the largest CPU available.
In particular, I saw the following issues:
- hovering the header entries so that the links turn blue takes about 1 second
- scrolling the notebook is awful when you hover your mouse over one the time-series entries
- clicking the small arrow at the lower left to display the next 20 entries takes several seconds
- any editing in the notebook has a lag and particularly selecting something with the mouse becomes impossible
- resizing the window takes considerable more time
During some of these actions, I see the small "Progress Dialog" popping up.
Having said all that, we get an idea what exactly is the bottle-neck: front end rendering. So here is an example of 10x20 time-series placed in a dataset. This highlights the issue and I needed to delete the output cell just to copy the code here:
v = {2, 1, 6, 5, 7, 4};
t = {1, 2, 5, 10, 12, 15};
ts = TimeSeries[v, {t}];
Dataset[ConstantArray[
Association @@ Table["Key" <> ToString[i] -> ts, {i, 10}]
, 20]
]
Maybe some folks can try to reproduce the issue with the examples I've given.
Details
I will report this issue once more. I came up with the following demonstration, where we first create a dataset without showing it
head = CharacterRange["A", "E"];
ip[] := ListInterpolation /@ RandomReal[{-1, 1}, {Length[head], 10}];
ds = Dataset@Table[Inner[Rule, head, ip[], Association], {40}];
This takes about 0.01 seconds on my machine. Next, we look at the OutputForm
of ds
. Noteworthy, it is instantaneous although it shows the entire dataset. Furthermore, the front end is as fast as it should be
OutputForm[ds]
Next, we let the front end render the dataset in all its beauty
ds
This takes over 10 seconds, pops up a "Progress Dialog" and the front end is mostly unresponsive afterward.
Note: For me, it makes a difference if my notebook is fullscreen or not. If I have a notebook of normal size, where the dataset is cropped, it is much slower than in fullscreen, where the entire dataset is visible. Weird.