-
Notifications
You must be signed in to change notification settings - Fork 144
Description
I'm in the process of upgrading to laravel 5.2, using version 2.2 of this package.
However since this upgrade, the application load time has increased by almost 2 seconds.
I've run a blackfire.io profiler, this is what it looks like: https://blackfire.io/profiles/1fa3c08e-c1df-4c3d-84e2-ea73be40361c/graph
On that profile there are 606 calls to file_get_contents which comes from the Json class. This is with caching enabled. Without caching this was close to 1300 calls!
I think this could still be reduced as the same module.json file is called multiple times. The following image only shows a very small amount of calls.

Adding some caching to the getAttributs method in the Json class.
public function getAttributes()
{
return app('cache')->remember($this->getPath(), 10, function () {
return json_decode($this->getContents(), 1);
});
}This reduces the amount of calls to 22!!
After this change:
https://blackfire.io/profiles/8e098e83-af3c-4638-b6f5-3ffca7136f44/graph
I think this is something that should be looked at asap.