The line profiling output of google-pprof
claims that most of the running time of my numerical C++ program is being spent in a function called __nss_database_lookup
(see below). Apparently that function is for handling things like the passwd
file on UNIX systems. My C++ program should only be doing numerical calculations, allocating memory, and passing a few custom C++ data types around.
What's going on? Is the appearance of that function a mirage, a mere artefact of how google-pprof
works? Or is it actually being called and wasting two thirds of my program's running time? If it is being called, what could be calling it? Has something mistakenly called it in one of my C++ classes? How would I track that down?
I'm using Ubuntu 20.04, g++-7
and g++-9
.
Total: 1046 samples
665 63.6% 63.6% 665 63.6% __nss_database_lookup ??:0
107 10.2% 73.8% 193 18.5% <function1> file.h:1035
92 8.8% 82.6% 92 8.8% <function2> file.h:...
87 8.3% 90.9% 87 8.3% <function3> file.h:995
17 1.6% 92.5% 734 70.2% <function4> file.h:1128
...
(Function and file names obscured for confidentiality reasons)