hartenthaler / hh_extended_family

webtrees - showing the extended family of an individual (like cousins and uncles, aunts, ...)
GNU General Public License v3.0
23 stars 9 forks source link

web performance #106

Closed TheDutchJewel closed 3 years ago

TheDutchJewel commented 3 years ago

With version 2.0.16.54, the web performance issue #100 has been resolved, but when comparing webtrees with and without your module, I still notice a difference:

when changing individuals through the Family navigator, it takes about 3 seconds for the Fact and events tab to fully load when the module is turned off, when the module is turned on it takes about 5 seconds.

Up to version 25 I don't notice any difference (I can't test version 26-47 because an error message), but I do notice it with version 48 and 54.

It would be nice if this difference can be eliminated as well.

hartenthaler commented 3 years ago

I'm sorry but this is not possible. From version 25 to 54 a lot of functionality was added. It needs time to calculate all the new extended family parts. It needs time to calculate all the possible combinations of the filter options. It needs time to calculate all the labels. Please switch off all the extended family parts and keep only cousins for example. Switch off the option "filter" and switch off the option "use labels". Then you should not see any significant difference if the module is activated or not (there is still some impact because the code is now much more complex, there are more translated languages available, ...).

The content of all tabs like the "extended family tab" is loaded by webtrees in advance, so that there is no delay if you click from one tab to another tab. There are possibilities to not load content in advance, and then load them as soon as you open this tab. But the knowledge of how to do this and to decide which content should be loaded in advance and which should be loaded later is far beyond my knowledge.

You have to choose: more functionality or shorter response time (or using a server with more power).

hartenthaler commented 3 years ago

... one remark about testing older versions of this module: this is not foreseen by the actual design of the module. From time to time the database structure has to be modified to implement new functions. If you go back it would be necessary to roll back the database structure as well. This is not implemented. It could work, but it is not recommended to go back to older versions. It may have unwanted side effects that require manual database cleaning afterward.

TheDutchJewel commented 3 years ago

After turning off the last added 7 groups, the time is shortened to about 4 seconds. Turning off the filter options also saves another second. By the way, it doesn't matter if I turn the labels on or off, so I leave those on. Now I have the same speed as without the module.

An additional advantage of disabling a number of groups is that it becomes more organized.

hartenthaler commented 3 years ago

I just had an idea how to improve the performance when using the filter option: instead of finding the members of the family parts for each combination of filter options again and again it should be faster to find them once without using a filter, then clone this set of family members for each combination of filter options and then perform the filtering on this cloned copy. This should be faster. I will try it.