I know there had been many queries regarding the topic and I went through almost all of it.
The point where my query is slightly different from the rest is that my magento website runs pretty well in the production.
But my localhost is painfully slow. A point I would like to mention is that the magento project is created by me, and I have started working on it recently. I am not sure if its a magento thing or there had been some fault on my part during setting up of the project in my system.
So, in the project everytime I open a new page, the first request takes a lot of time as shown below:
Since the production website runs well, that removes the possibility of any optimisation in the server side. Also, the localhost I saw running in other system in the organisation was loading pretty fast (some of the systems being a mac).
The data in my localhost is being fetched from the test database not having as many tuples as that of the production database. My system that I am using currently is Ubuntu 16.04, 8GB RAM and i5 8th gen. I am using PHP version 5.6.
Considering following scenarios mentioned, it will be really helpful if someone can point me to the reason why its happening. I am trying my level best so that the question is not a broad one, so if any details is required from my end which I missed to give, please ask for that.