TBrowser very slow due to huge .root_hist

Hi all,
my TBrowser is very slow: it takes ~1min to appear and be fully usable.
I did a little debugging with

and discovered that the bottleneck was in the call new TGCommandPlugin I looked at the code of its constructor and I saw that it loads the entire history file into a dropdown list box.
My settings in .rootrc are:

Rint.HistSize: 1000000 Rint.HistSave: 900000
and now my history is ~43000 lines long: clearly it’s very resource expensive to load every single line in a dropdown list…
Since I don’t want to reduce the size of the history, given also the fact that root has no overhead due to its size except for this TBrowser problem, I had a look at the .root_hist file and discovered that there was a lot of duplicate lines, .q-like and .x statements and tv__tree->Draw instructions.
A simple

reduced the history size of nearly 80%, allowing the TBrowser to completely load in few seconds.

I don’t know if this the right place, but my suggestion is to add more options in the .rootrc file to better manage the history file, for example:

#allow duplicate lines in history
Rint.HistDup: true|false

#allow recording of .x statements (maybe only the ones coming from root "macro.C" can be excluded)
Rint.HistExecute: true|false

#allow recording of .q statements
Rint.HistQ: true|false

#allow recording of Draw instructions from the TreeViewer
Ring.HistTVTreeDraw: true|false

Best regards,

I encountered exactly the same problem a few weeks ago. Thank you for posting to explain why the issue appears.

Rint.HistSize: 5000000
Rint.HistSave: 4900000
$ wc .root_hist 
   71387  152501 3113648 .root_hist
root [0] gROOT->Time()
Real time 0:00:34.313347, CP time 0.100
root [1] new TBrowser()
(TBrowser *) 0x7f84ee6a5690
Real time 0:02:36.486007, CP time 156.270

Removing .root_hist fixes it.

@bellenot could you check what’s happening here?

The browser is reading the .root_hist and fills the history combo box, so this might be a slow process when the history is huge…

FYI, this is now protected in the master branch.