# What is faster?

**URL:** <https://root-forum.cern.ch/t/what-is-faster/40199>\
**Category:** Newbie\
**Created:** [July 2, 2020, 11:47am UTC](https://root-forum.cern.ch/t/what-is-faster/40199 "2020-07-02T11:47:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Post date:** [July 2, 2020, 11:47am UTC](https://root-forum.cern.ch/t/what-is-faster/40199/1 "2020-07-02T11:47:26Z")

</div>

Dear,

I was wondering what is faster when using trees:

1. Filling a histogram in a loop
2. Use the Draw option while requiring some specific events

Thanks!!

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [July 2, 2020, 12:00pm UTC](https://root-forum.cern.ch/t/what-is-faster/40199/2 "2020-07-02T12:00:41Z")

</div>

Hello,

Without looking at specific code snippets, I think that’s generally hard to say. But you do get from `Draw` (and even more so from [RDataFrame](https://root.cern.ch/doc/master/classROOT_1_1RDataFrame.html)) a nicer abstraction layer than from hand-written loops. That should ideally help you being faster in developing and refining your analysis code. With `RDataFrame`, you can also benefit from [implicit multi-threading](https://root.cern.ch/doc/master/namespaceROOT.html#a06f2b8b216b615e5abbc872c9feff40f) to automatically make use of all of your CPU cores.

Cheers,  
Jakob

---

<div class="post-metadata">

**Author:** ![Newbie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Post date:** [July 2, 2020, 12:48pm UTC](https://root-forum.cern.ch/t/what-is-faster/40199/3 "2020-07-02T12:48:10Z")

</div>

Hi Jakob! thanks a lot! Especially fo the RDataFrame info, it looks promising! I will definitely give it a try!
