![]() |
#691 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,194
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
@chaley: First, thanks for your time and effort.
I tested your changes, and so far they are working well. I ran your test as well as some other tests related to Last Modified Plugin and all is working as expected. Signals are are only released for fields for whose the value is altered. How do you think this will impact calibre's performance? |
![]() |
![]() |
![]() |
#692 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,393
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
It could go either way. Setting a field to its current value will be significantly faster because it isn't dirtied (queued for metadata backup), the last_modified isn't set, and in several cases a database update is avoided.
If a field is really being changed: many-to-many fields like tags won't see a hit because they already did the optimisation. Other fields now have a bit more processing to check if the value is being changed. In some cases a field was being updated twice (e.g., custom series indices), which is no longer happening. ![]() I will make a pull request and see what Kovid thinks. |
![]() |
![]() |
![]() |
#693 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,684
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Will this change have any effect on that mode of use, if anything it appears it might improve performance. I don't use the AC or LM plugins. BR |
|
![]() |
![]() |
![]() |
#694 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,393
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#695 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,194
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I think not. You can verify that by pressing F2 followed by enter without changing the value, and then checking the last_modified value. That changes made by chaley will ensure this will not happen.
|
![]() |
![]() |
![]() |
#696 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,684
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@chaley - tks
can I draw you attention to the last post in this thread ==>> https://www.mobileread.com/forums/sh...d.php?t=341670 cheers BR |
![]() |
![]() |
![]() |
#697 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,393
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
These results doesn't negate what you said, that the editors don't do the check. I think the difference is that many-many columns already have the check in the db layer. |
|
![]() |
![]() |
![]() |
#698 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,684
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
If I do as you suggest the Last Modified date changes to Now and the disk rattles as a fresh metadata.opf is written to the book folder on every cell I tab through whilst in Edit mode. The slight performance hit doesn't bother me. I find editing in the list much easier, hence faster than editing in dialogue boxes. Added: I think we're all agreed these changes shouldn't have any deleterious effect on editing metadata on the book List, if anything the opposite. If KG accepts @chaley's changes I'll make of point of letting y'all know. BR Last edited by BetterRed; 09-13-2021 at 06:43 PM. |
|
![]() |
![]() |
![]() |
#699 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,393
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The changes are now in master source.
|
![]() |
![]() |
![]() |
#700 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,194
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
@chaley: Thanks again. You help has been, as always, invaluable.
|
![]() |
![]() |
![]() |
#701 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,194
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
This will need modifications to both Last Modified and Action Chains, and will only be released after the release of the next version of calibre. Last edited by capink; 09-14-2021 at 08:28 AM. |
|
![]() |
![]() |
![]() |
#702 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,194
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
@chaley: How can I incorporate the advice below with set_field() |
|
![]() |
![]() |
![]() |
#703 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,393
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I don't think you can. cache.set_metadata() does it by wrapping the set_field()s in a "with db" connection. You don't have that option.
The best approach would be to gather together all the changes to a field and apply them with one set_field. Something like a caching single_field_edit action that is paired with a commit action. This might introduce timing problems though. |
![]() |
![]() |
![]() |
#704 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,194
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
The commit question was about optimizing performance when calling set_field() for multiple fields (date fields by Last Modified), but it is not a big deal. Thanks.
|
![]() |
![]() |
![]() |
#705 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,863
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Btw, since I can run from source I am willing to do some testing.
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 PM |
Action Chains Resources | capink | Plugins | 77 | 06-16-2025 12:45 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |