Closed (fixed)
Project:
Simple XML sitemap
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2021 at 16:48 UTC
Updated:
16 Apr 2021 at 21:14 UTC
Jump to comment: Most recent
Comments
Comment #3
alexpottComment #4
alexpottI've merge the latest changes in. This would be helpful for any future work on this module - in order to prove there haven't been performance regressions.
Comment #5
alexpottComment #6
gbyteWhat's the reasoning behind showing some metrics by default? How would you feel about us adding a UI setting under advanced 'show performance metrics' that would enable all of the above? If unchecked, no performance metrics would be shown. In configuration there would be just 'show_performance_metrics' instead of monitoring.count_queries.
Comment #7
alexpottHere's the reasoning why I did it like this: the memory calculations are essentially free (when compared with the other work) - so there's no point not displaying them. The query counting affects the memory calculations so needs to be turnable on and off. Also I don't think this needs to be something in the UI. However I do think it might be worth thinking about from a different perspective. We could add a performance test script to the project so it's really easy for people to run a performance test and display the results in an issue. This script could turn on and off the query logging and do the memory calculations and thereby we wouldn't need to make any runtime change.
Comment #8
alexpottHere's the output of the command before and after the recent performance changes:
Before
After
So we can see the reduction in the number of queries and the increase run times and whilst the first run uses a little bit more memory subsequent runs do not. Note that the number of queries 8.x-3.9 does per node means that you will have 10x the number of queries as nodes. As we can see, the new performance fixes in the dev branch completely change this.
Comment #9
gbyteThis is interesting. Would it make sense to make it available as Drush command instead of running it with `dursh scr`?
It would be nice to have some sort of cleanup script in case people run it with the generate flag on production. Maybe a warning?
Another thought: Any idea if we can leverage this as part of the testing suite? Tests spin up a new Drupal environment so it wouldn't pollute production. On the other hand, the results would be less representative of the specific Drupal environment. Plus the output of this test would be of relevance and not its passing/failing. Thoughts?
Also, we'll need a readme section as well as a copy of it in the documentation page.
Comment #10
alexpottIf you run it on production - you run it without the generate option - then you can get results back for your site. Imo cleanup and warnings on the generate are unnecessary.
I choose to not make it a drush command because I don't think this is something people should just "use" if they are running the module. It's to help contributors and maintainers ensure there aren't performance regressions on make changes. Given the nature of what this module does and how it works small changes can have large and unintended impacts.
Wrt to running the script in a test - I thought about that - I think it is a good idea - because it means with can ensure we don't break it and set maybe an expected number of queries and memory usage. But on the other hand using Drush then makes this quite tricky because we'd need to somehow get that code and make it use the test site... seems a lot of work.
Comment #12
gbyteAdded minor changes and documentation. Thanks!