Repository navigation
Replies: 2 comments 1 reply
|
@GeePa67 nice experiment, and your numbers hold up. I ran all three against your test database and got the same ranking. All three clear the right caches, so this is only about speed and robustness. Your worry about huge databases is justified. Methods 1 and 2 pass every code into a filter, and SQLite limits how many values one query can take. With a synthetic 40,000-cache database, method 1 failed with Method 3 is slower because Method 2 also changes the active filter just to loop, and if something fails before Here's what I'd use. It's your method 3 idea with two changes:
Timings on your 1152 caches (1019 corrected), run without the GUI, so your absolute numbers will differ:
Two tips for testing:
|
|
I didn't know about opensak.transaction, I will use this in the future whenever I need to perform the same action on many caches. Thanks for the tip. On opensak.caches, I think I was confused by the help. In the help, I thought it was indicating that opensak.caches with no argument gives all the caches in the current filter but if I have any filter keys then it gives all all caches in the databases matching the filter keys specified and not just all caches in the current filter than also match the filter key. I tested your code and found out I misunderstood the help and the code does indeed only act on caches in the current filter exactly as I want. Thanks so much for all your help. I can tell I have a lot still to learn 🙂. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have been working on a macro (attached) to clear the corrected coordinates for all caches in the current filter. Not something I do often, but something I had a macro for in GSAK so it was a good learning exercise. I came up with three different ways to approach it (happy to hear if there other better ways). To test timing, I comment/uncomment the different sections of the code to see how long it takes. It is kind of a pain because I have to restore the database between each test, but that is life. I have a test database of over 1000 caches for this (also attached). For my test database I found that method 1 and method 2 gave me the same time to 1/10 of a second but method 3 takes about 50% longer. Any thoughts on the approaches? One thing I could see is that methods 1 and 2 could maybe be an issue on an enormous database because they require making a variable containing all the codes in the current filter. Just looking for some constructive input as I am not a professional programmer and am just learning Lua and opensak macros. Overall, for my test database, the timings are reasonable for all three methods. Thanks.
ResetCorrectedCoords.zip
ReverseWig.zip
All reactions