![]() |
#1 |
Connoisseur
![]() Posts: 69
Karma: 10
Join Date: Aug 2016
Device: Kindle Paperwhite 3
|
Custom icon performance
I'm having lag issues with custom icon rules.
I've added a dozen rules for custom icons. 5 icons for 1-5 star ratings. Then 7 icons for different shelf values. My library is around 18k books. After adding the icon rules, there's a huge performance hit. Scrolling through the list of books is very very slow and thus laggy. I've tried using from 512x512 icons to 32x32 icons and it is still laggy. Regardless of icon pixels though, all the icons set total to 382kb, which isn't a lot. I've tried deleting the rules and the lag is gone. I've tried the icon rules on a smaller library of ~1000 books and the lag is still there, albeit not as laggy but still lags. So, just wondering if anyone has same problem and if there any tips to improve performance? Note: I don't think my computer (amd octocore and 16gb of ram with ssd) is that slow for adding 12 icons to the rules set, or is it? Attached a pic of icon rules and it seems pretty simple and not a lot, which I don't understand why it will lag so much. Last edited by moredrowsy; 07-09-2017 at 02:27 AM. |
![]() |
![]() |
![]() |
#2 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
If you can use general program mode templates for the icon rules that should make it faster because GPM templates apparently end up as compiled Python, see ==>> Using general program mode If you can post a couple of the icon rules one of the templating wizards should be able to make some suggestions. Added : It would be nice if one could disable icon/color rules one by one, or en marche masse ![]() BR Last edited by BetterRed; 07-09-2017 at 03:48 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 69
Karma: 10
Join Date: Aug 2016
Device: Kindle Paperwhite 3
|
The columns are not composite; one column is the normal "rating" and the other is a custom "#shelf" with direct values. I don't know how to use advanced rule since I don't know how to do programming language. Just a regular smoe joe.
I've changed all the icons to 128x128 pngs but it didn't make a difference. Thanks for the help. Attached is the rules wizard for the icon rules for the ones that are shown. Last edited by moredrowsy; 07-09-2017 at 05:28 AM. |
![]() |
![]() |
![]() |
#4 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I am pretty sure your rules could be optimised, but I'm no great shakes at template code. chaley is your best bet, he will hopefully see the thread and make some suggestions - if he doesn't send him a PM and ask him to take a look at the thread. Added - see this FWIW I have a library of 10K+ books with 10 icon rules, it's not noticably faster or slower than another library of 110K+ books with no icons, or another with 5K books and 21 icons. Could be the way I use my libraries - I don't do a lot of scrolling up and down looking for things. BR Last edited by BetterRed; 07-09-2017 at 07:50 AM. |
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I don't know why the performance is so bad for you. Are you running 64-bit calibre? If not, then try that.
You can improve the performance of the two basic tests by using an advanced rule. Here is an example for Rating, replacing all 5 current rules. The text in that box is: Code:
program: first_matching_cmp( field('rating'), 0.1, '', 1.1, 'emoticon.png', 2.1, 'sceptic.png', 3.1, 'winking.png', 4.1, 'happy.png', 'in-love.png') You would do something similar for the second one (Shelves) but using the "switch" function to set up the comparisons. Assuming that "Shelf" contains a single value (not like tags) then something like this would work. Code:
program: switch( "read", "success.png", "to-read", "play-button.png" |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Assuming that #shelf is a text-type (perhaps with a fixed set of values) then this advanced rule should work.
Here is the text shown in the dialog Code:
program: switch( field('#enum2'), '^read$', 'success.png', '^to-read$', 'play-button.png', '^backlog$', 'line.png', '^dnf$', 'error.png', '^dont-touch$', 'forbidden-light-grey.png', '^currently-reading$', 'medical-1.png', '^favorite$', 'eye-1.png', '') I used #enum2 because I don't have a column named #shelf. |
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() Posts: 69
Karma: 10
Join Date: Aug 2016
Device: Kindle Paperwhite 3
|
Thanks BetterRed and Chaley!
Chaley's script helped. The lag is gone. Wow. Thanks a lot! Edit: I never noticed a slight lag with the coloring scheme too. So I edited your script for the coloring as advance rules. The lag is completely gone with the advance rules for column coloring and column icons. This is awesome. Again, thanks a bunch! Last edited by moredrowsy; 07-09-2017 at 03:02 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Advanced Custom Icon with two requirements | One4Tanner | Library Management | 3 | 03-11-2015 02:14 AM |
Custom Collection Icon? | ACardAttack | Kindle Developer's Corner | 1 | 03-05-2015 08:05 AM |
Custom Column Icon Help | alanHd | Library Management | 2 | 02-04-2013 03:30 AM |
Problem with Tag Browser Custom Icon for Languages | MartyTX | Library Management | 1 | 02-03-2013 03:44 AM |
Custom Icon Issues | allovertheglobe | iRex | 0 | 10-26-2008 03:40 PM |