Commit c91b372
committed
[df] Avoid unnecessary duplication of JIT lines
When accumulating code to JIT for Define, Filter and Vary nodes, the
current logic embeds the name of e.g. the new column to define as part
of the function body that will go into the accumulated code to JIT. This
in turn means that every time we call a Define, there will be a
corresponding code to JIT, as well as a corresponding function body that
will go into the newly created cache for the JIT node registrators.
This can be optimised by avoiding to store the names as part of the
function body, thus allowing a much more aggressive caching. In a simple
example such as:
```
ROOT::RDataFrame root(1);
std::vector<ROOT::RDF::RResultPtr<double>> dfs;
const auto n = 10000;
for (auto i = 0u; i < n; i++) {
const auto column = "x" + std::to_string(i);
auto define = root.Define(column, "42.f");
auto filter = define.Filter(column + " > 0.f");
auto sum = filter.Sum(column);
dfs.emplace_back(sum);
}
dfs[n - 1].GetValue();
```
This commit changes the previous situation that would have had 10K JIT
function bodies, i.e. one per Define with a different column name, down
to one function body to JIT for the lambda returning 42.f.1 parent 022b743 commit c91b372
File tree
4 files changed
+28
-20
lines changed- tree/dataframe
- inc/ROOT/RDF
- src
4 files changed
+28
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
| 524 | + | |
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
555 | 554 | | |
556 | 555 | | |
557 | 556 | | |
| |||
568 | 567 | | |
569 | 568 | | |
570 | 569 | | |
571 | | - | |
572 | | - | |
573 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
574 | 573 | | |
575 | 574 | | |
576 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
| |||
682 | 681 | | |
683 | 682 | | |
684 | 683 | | |
685 | | - | |
686 | 684 | | |
687 | 685 | | |
688 | 686 | | |
| |||
716 | 714 | | |
717 | 715 | | |
718 | 716 | | |
719 | | - | |
720 | 717 | | |
721 | 718 | | |
722 | 719 | | |
| |||
768 | 765 | | |
769 | 766 | | |
770 | 767 | | |
771 | | - | |
772 | 768 | | |
773 | 769 | | |
774 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | | - | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| |||
0 commit comments