Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9783 RDataFrame-related tickets
  3. ROOT-9377

[cling] interpreting a macro is slowed down by nullptr checks

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • master
    • 6.16/00
    • None
    • None
    • any

    Description

      Sometimes, interpreting a macro takes much more time than compiling+executing.
      I used to blame the optimization level of the executed code, and that might also play a role, but there are cases in which most of the (very relevant) overhead comes from cling instrumenting the code with cling_runtime_internal_throwIfInvalidPointer checks.

      The reproducer attached (main.cpp) takes 3.6s to be compiled (-g -O0) and 1.4s to run on my laptop.
      When run through root -l -b -q, it takes 18s to complete execution.

      Profiling shows that the interpreted version spends a great part of its time in cling_runtime_internal_throwIfInvalidPointer checks – useful at prompt, but probably not so much when running a macro like this.

      To run main.cpp one needs to first create its input file with create_file.cpp.
      Credits to Stefan Wunsch for the reproducer.

      Attachments

        1. asd.svg
          1.28 MB
          Enrico Guiraud
        2. create_file.cpp
          0.7 kB
          Enrico Guiraud
        3. main.cpp
          0.8 kB
          Enrico Guiraud

        Issue Links

          Activity

            People

              axel Axel Naumann
              eguiraud Enrico Guiraud
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Actual End: