Comments (9)
Changing the //machine
XPath to mame/machine
reduces the elapsed time to a bit over three minutes. I've only done a single run on both so this isn't hugely scientific, however a more specific XPath query should theoretically be more performant.
If we ignore the separate button suggestion for the time-being, I'm happy to do a proper performance test and identify the bottleneck.
from mamesaver.
Have reduced the full rebuild time to around five seconds 600ms (for 20 roms, to be fair) by also running -listxml
on each verified game rather than retrieving the full output. Which I've just realised is what you initially suggested and I promptly forgot about. This is included in the PR.
Think I might leave this now 😄
Edit: Updated both calls to Mame to pass in chunked list of roms to speed things up even further. Definitely finished with this one now.
from mamesaver.
Fixed in #8
from mamesaver.
Hey thanks for the interest @nullpainter!
Yeah the build list functionality is a pain. Options I thought of...
-
Looking at http://docs.mamedev.org/commandline/commandline-all.html I could probably pull the list using
-listfull
which comes back within a second if piped, but there is no year included only the game name. -
One idea I had was to actually get the rom folders by using the
-showconfig
param, get the files list there, and then get the-listxml
info for only the roms in the folders. This would probably have a bug effect for most people since I doubt most people have 1000's of roms. -
One other issue is the fact that if I pipe the
-listxml
for all games it's like 430MB! I didn't really want such a huge cached file permanently saved. Of course there is the option to just pull out the info needed (after the list has been pulled - so still quite a while) and then cache only that info (rom name, game name and year really). If doing this it would probably be good to store the hash of the mame.exe and compare so we know if it was changed/updated. This would save time on subsequent tries but not on the first one.
Either opt 1 or 2 sound the best to me. 1 if showing the year is dropped (seems silly to do all this to just show year), or 2 if year is important.
If you don't have the time or inclination to do this work, I may be able to submit a pull request.
I'm very happy to receive contributions 😊 Please just try keep them small and focused one thing at a time - last one I got changed everything including formatting and had the binaries included!
from mamesaver.
Good point about the size of the full XML file; I had forgotten that! Given that piping directly to a file from mame.exe takes under a minute, I may start by rewriting the parsing using XMLReader
instead of XPath to see how much this alleviates the problem.
Even though it pains me, I promise to keep the project using .NET Framework 2.0 ;-)
from mamesaver.
Even though it pains me, I promise to keep the project using .NET Framework 2.0 ;-)
Hey I'm quite happy to update to a newer version of .net - update away 😄
from mamesaver.
Good news. By reading directly from the StandardOutput
stream instead of first reading the contents into a string, and using a combination of XmlReader
traversal with LINQ to XML to simplify the parsing, I've reduced the -listxml
parsing from 4.5 minutes and 3Gb of RAM (!) down to 26 seconds and 33Mb of RAM. This is about the amount of time that the -listxml
command itself takes.
Unfortunately the -verifyroms
step still takes just under three minutes - again because the MAME command takes that long. 😢
So, this is a good first step that I think should be done regardless of any future smarts.
I've upgraded to .NET 4.6 in order to use the LINQ to XML package and am tempted to shift all of this to a separate class. It would also be nice to be able maintain previous game selections after scanning, so there could potentially be quite a bit of related game preparation code. I've never been a huge fan of #region, however I'm happy to follow your preferred style.
I'll tidy this up and hope to create a PR later this weekend.
from mamesaver.
I've found a solution for the verify roms step. Instead of running -verifyroms
with no further arguments, you can enumerate through the contents of the roms directory and invoke it per rom. I've tested with a missing rom, and a rom with missing files, and all checks out.
I only have 15 roms as I'm running this screensaver at work with a curated set of vector games. Running -verifyroms
appears to take a constant time, regardless of the number of roms. I imagine you would need a significant amount of roms before checking them individually will result in worse performance.
Implementing this approach, the full rebuild time takes just under 30 seconds for me, with the verification step down to 10 seconds. I'll create a PR shortly which you can take if you like.
from mamesaver.
Definitely finished with this one now
🤣
from mamesaver.
Related Issues (20)
- Power options might not work when settings set to never turn off screen HOT 12
- Mac port HOT 10
- MAME configuration parsing fails when paths enclosed in speech marks HOT 1
- Generic error message if ROM path not found HOT 3
- Misleading error message if MAME configuration bad
- Crash on shutdown HOT 1
- About tab HOT 1
- Filter mechanical games, improve BIOS identification HOT 2
- Enhancement - game filtering HOT 14
- Linux port
- Sort out build merging repack and release and making installer work again
- Mamesaver.scr - This application could not be started. Do you want to view information about this issue? ... HOT 19
- Old official 64-bit MAME v0.177 doesn't work with MAMEsaver v2.0's game scan. HOT 41
- Need to tell user to restart their MAME Saver after enabling its logging. HOT 1
- MAME Saver v3.0.1's log file didn't roll over after 100 K in my 64bit W7 HPE SP1's %TEMP%\MameSaver\. HOT 1
- Screensaver not working properly anymore since mame 0.223 (possibly earlier) HOT 3
- Error when used with MAME 0.227 HOT 3
- Artwork not showing HOT 7
- Not finding games HOT 5
- Cannot read mame configuration with latest 262 mame release HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mamesaver.