Question

I am using gprof to profile my code and it says that 96.4% of the time is spent in _fini. I have no subroutine named this and the underscore makes me think it is something which I am not officially writing. What is _fini and how do I go about optimizing this section of the code or the way the compiler uses _fini?

If it matters I am writing in Fortan90 and using gfortran to compile. Thanks.

Was it helpful?

Solution

According to this doc, _fini is a function that used to be included in libraries, and it would be called whenever the library was unloaded.

It can also be a symptom of lots of objects being created and destroyed (under the covers where you can't see it). gprof often points to functions when the reason for the slowness is elsewhere. That's just one of its many problems.

If you're trying to eliminate waste cycles from your program, here's what a lot of people do, and it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top