cxwx1
January 6, 2025, 9:19am
1
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
Hi folks, this is related to topic Speed up #include (I can’t link, since I’m new) [EDIT Axel: added link], but I didn’t know the necro rules and I have more to ask so I started a new topic.
Overview
I’m using Cling to build jank, a Clojure dialect for C++ with JIT compilation. I have jank->C++ codegen and Cling JIT compilation working well, but I’ve run into a troublesome performance issue on startup. My startup code for Cling looks like this:
auto const jank_location(jank::util::process_loc…
I use header yaml-cpp and spdlog, the two lib’s header cause long time loading whenever using Declare or ProcessLine ?
can I speed up the without compiling the script?
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)
cxwx1
January 9, 2025, 6:56pm
3
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;
}
cxwx1
January 11, 2025, 6:57am
5
It seems OK for me now, but I’m not sure.