New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instant Shutdown by only writing changes to gamelist.xml #78
Instant Shutdown by only writing changes to gamelist.xml #78
Conversation
I thought that the @jacobfk20 's merged PR #65 did that. |
I think it is a bit different: That PR made ES skip files for which the values of all metatags are still at default values. I think it does not help if most of your files actually have been scraped since they won't have default values anymore then. Maybe I am stupid and I miss something but I don't see (yet) why ES really has to write back all XML records on every shutdown :/ |
@meleu : I dont think so, that one was only focused at skipping all games without metadata that are not present in the gamelist.xml's to begin with, and skipping trough those (rather than trying to find it). If I look at these changes, @verybadsoldier suggests to keep a ledger of all items that have an explicit change in their metadata, and storing those. |
< :-D crossed post with verybadsoldier> In any case, the changes look clean to me, what tests do you suggest to try this out? |
Yes, you are right. The actual writing to disk won't be the problem. It was triggered once after generating data and it is still triggered once in any case. I also assume the pugixml will always just flush its memory into a new file (and it will not try to modify existing XML elements in the file). Too bad I have had no good ideas how to test this extensively. I tested stuff like this:
So maybe you people have some good ideas for another scenarios that could go wrong? |
Additional tests I can think of:
|
hey guys, now I see the PRs' goal are different. It would be great to get a faster shutdown. :-) |
5c08265
to
9128310
Compare
Okay thanks for the suggestions, I will test those things soon! Just did one more optimization: |
4cf64b0
to
0a99589
Compare
… speed things up)
a0e2594
to
44ea23a
Compare
Ok, I tried these but I had some problems:
I could not find out how to delete metadata :( Is there a way? I only managed to edit it.
Delete games did not influence the gamelist.xml. Are games meant to be deleted from gamelist.xml ever?
I always end up having no UI at all anymore when doing this:
But this also happens without my changes. It does not happen when not editing metadata.
That worked so far and the gamelist.xml got updated as expected. But some unexpected behavior (for me) showed up while testing this: When scraping, ES writes/updates the gamelist.xml after every scraped game. So when scraping 100 games then the gamelist.xml is written 100 times. The first time with 1 game, then with 2 games etc. etc. |
thanks for the PR and for the testing. regarding the last comment and the scraping issue - is this something new due to your changes or an old issue ? |
No, it is both unrelated to my changes. I didn't test the scraping issue with the original version (as I did with the first issue) but I could see in the code that updating gamelist.xml (by invoking
|
Thanks for the info. If you are happy with this, I'm happy to merge. Cheers. |
Yes, I think I am happy with it. Quite sure it should be fine. Thanks! |
Thanks for the contribution :-) |
Just out of curiosity: since no one complained, does it mean no further issues or problems popped up with this? Is the performance advantage as expected also on RPi (actually I was hoping for (near) instant shutdown)? |
Many people don't upgrade until they see a new "image" is out, but so far it looks good! I've not had a chance to do much testing myself though on my own installs, but will let you know. |
…-po5-nadenislamarre Recalbox buildroot po5 nadenislamarre
update: pt_BR
This is a proposal to speedup the shutdown of ES and actually make it shutdown instantly. Usually, ES writes back metadata of all files from all systems to the gamelist.xml. With this PR, ES will keep track of changes to the metadata at runtime and only write back changed entities upon shutdown.
When shutting down there will be a summary of changed gamelist.xmls:
I think it should be ok but maybe I should ask some people in the forums if they would test it a bit under real-life conditions. What do you think?