It there any way for lazyloading or progressing for root prompt now?

Hi all:
I’m trying to use ROOT prompt in neovim with iron.nvim

But I include some heavy header in my project and rootlogon.C

I’d love to run these line with lazy mode. like
lazy.nvim
[zinit]

for example,
opening root prompt, running include 3 second later

How should I do.

timing test

gInterpreter->ProcessLine("#include <yaml-cpp/yaml.h>");
gInterpreter->ProcessLine("#include <sol/sol.hpp>");
#include <TInterpreter.h>
#include <TStopwatch.h>
#include <iostream>
using namespace std;

namespace {
void f1() {
  TStopwatch awatch;
  awatch.Start();
  gInterpreter->ProcessLine("#include <spdlog/spdlog.h>");
  awatch.Stop();
  cout << "spdlog:" << awatch.RealTime() << " " << awatch.CpuTime() << endl;  // NOLINT
}
void f2() {
  TStopwatch awatch;
  awatch.Start();
  gInterpreter->ProcessLine("#include <yaml-cpp/yaml.h>");
  awatch.Stop();
  cout << "yaml-cpp:" << awatch.RealTime() << " " << awatch.CpuTime() << endl;  // NOLINT
}
void f3() {
  TStopwatch awatch;
  awatch.Start();
  gInterpreter->ProcessLine("#include <sol/sol.hpp>");
  awatch.Stop();
  cout << "sol:" << awatch.RealTime() << " " << awatch.CpuTime() << endl;  // NOLINT
}
}  // namespace

void p2_header() {  // NOLINT
  f1();
  f2();
  f3();
}
spdlog:0.750646 0.75
yaml-cpp:0.176003 0.18
sol:0.717335 0.71  <- 0.71 second too slow

some relate

Not sure I really understand your question and what you’re trying to achieve, but if you want to wait three seconds, you can simply add gSystem->Sleep(3000)

I think the question is equal to

If I’ve a long rootlogon.C file

{
    gSystem->Load("liba1.so");
    gSystem->Load("liba2.so");
    gSystem->Load("liba3.so");
....
   gInterpreter->ProcessLine("#include <h1.h>");
   gInterpreter->ProcessLine("#include <h2.h>");
.....
}

could I use

void loadLibrary(const char* libName) {
    sleep(1);  // or wait a litter longer?
    gSystem->Load(libName);
    std::cout << "Loaded: " << libName << std::endl;
}

int main() {
   
    std::thread t1(loadLibrary, "liba1.so");
    std::thread t2(loadLibrary, "liba2.so");
    std::thread t3(loadLibrary, "liba3.so");

    
    t1.join();
    t2.join();
    t3.join();

    std::cout << "All libraries loaded!" << std::endl;

    return 0;
}

Did you try?

It seems OK for me now, but I’m not sure.