Open lukyrys opened 9 years ago
Can you send any other profiler info? Like comparison that two versions, most function calls, most time consuption functions...
NDBT is not suitable for huge databases, sorry.
The problem is generating the database structure and then serialize / unserialize from cache .. Big serialize string consumes a lot of time to unserialize. I solved it with custom static structure without cache because 95% my tables has same structure ..
We use StaticConventions too. Because no FK, because we use structure which can be defined constantly easily.
I was thinking, now structure provides lots of informations which are not needed for NDBT. NDBT needs only table names, lists of primary keys, referencing relations and sequences. I make small test on my database with updated Structure (store relevant informations instead of full informations there https://github.com/nette/database/blob/master/src/Database/Structure.php#L179).
Current version Load structure from cache: +- 60ms File size: 312kb
Store only relevant informations Load structure from cache: +- 8ms File size: 21kb
So, we can refactor Structure to provide only relevant informations for nette, but it will be in my opinion big BC break. Or we can implement some kind of smart cache, when cache will be separated into 2 parts. One parts with basic data needed for nette and second especially for getColumns() method.
So, we can refactor Structure to provide only relevant informations for nette
:+1:
I did not know that it saves something what is not needed.
Nette don't need informations about columns, so sth. like this will work, but it is BC break... https://github.com/Unlink/database/commit/699bf693976bf05ab25d7ae0b6d43d27babbd548
After upgrade nette from 2.0.7 to 2.3.5 in my app i detected masive grow execution time and memory consuption at \Nette\Database\Structure after unserialize cached data. I have huge database with 6k tables and cached data in serialize structure string have 23MB. (by profiler - +180MB memory, extra 1000ms execution time) Before updating nette this not problem. Why?