[comixed-dev] Re: New library code for fetching

  • From: João Miguel Côrte-Real França Pereira <jmcrfp@xxxxxxxxx>
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Tue, 26 Nov 2019 17:02:26 +0000

Cool, I usually have the sonarlint plugin enabled on my Intellij so that I
don't make big silly mistakes. :P

On Tue, Nov 26, 2019 at 4:57 PM Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:

For this one action, I ended up having to have it create a tag since we
can't push a release without one. And it's only goal is for doing pushes to
develop, so people can grab a prerelease easily to play with.

I just checked out SonarCloud, looks nice. I've enabled it for the project
and am checking it out now. It's running its analysis, so I'll follow up on
it after lunch. But just poking around it's giving me a LOT of insight into
things on the comixed-frontend project! Very nice. :D

On Tue, Nov 26, 2019 at 10:10 AM João Miguel Côrte-Real França Pereira <
jmcrfp@xxxxxxxxx> wrote:

Nice, I forgot the V. I also think we don't need tags, maybe only for
releases.
It's also missing the action for the PRs, right? (and did you considered
adding sonarcloud to them?)

On Tue, Nov 26, 2019 at 3:06 PM Darryl L. Pierce <mcpierce@xxxxxxxxx>
wrote:

Great minds! That's what I ended up doing (but with 'v*').

I think we've got a decent workflow step setup now to handle things on
develop. Right now it's pushing a development build and then using my new
action to do the tag (though I'm now thinking that we don't need tagging).

On Tue, Nov 26, 2019 at 8:22 AM João Miguel Côrte-Real França Pereira <
jmcrfp@xxxxxxxxx> wrote:

It should be possible with something like:

on:
  created:
    tag:
      - *-*



On Tue, Nov 26, 2019 at 1:17 PM Darryl L. Pierce <mcpierce@xxxxxxxxx>
wrote:

I'm hoping we'll have the automated builds up and running again now
that we're moving the repo away from Travis CI and to using Github 
Actions.
I wrote one last night to do the tagging when things are checked into
develop. Now we only need an action that reacts to a tag being created 
(not
pushed) and does a build and we'll be good to go.

On Mon, Nov 25, 2019 at 4:54 PM bareheiny <dmarc-noreply@xxxxxxxxxxxxx>
wrote:

Cheers – that pretty much confirms what I thought was happening.



I’ve just had a quick look at the log data, and there seem to be a
couple of things going on.



The time between get 100 requests ranges from 1.4 seconds to 6
minutes, averaging 46 seconds.  The time for a get 100 to complete ranges
from 0 seconds to 5 minutes, averaging 48 seconds.



This leads to two questions – what’s causing the variability in the
time for a get to complete, and the next to begin, and what’s causing the
variability in the time for a get to return a result.



At first blush, I would think that the time for a  get to complete
would depend on the size of the comics in the get request – I’m assuming
the each file needs to be loaded for the cover to be extracted – which
could take some time for the larger files.  The time between a get
completing and the next starting...maybe processing the metadata for
loading into the drop down lists etc.?



I do have a copy of my comics with the comic info files removed – I’m
interested in knowing how loading a library with no metadata changes the
load times – that’s my next job, but will take a number of days to load
everything in 😊





Meanwhile, I’ll wait for you change to make it to a release, and have
another look...but I’m expecting that I may see delays of up to 6 minutes
for 100 comics to be displayed (based on the above).





*From: *Darryl L. Pierce <mcpierce@xxxxxxxxx>
*Sent: *Tuesday, 26 November 2019 9:21 AM
*To: *comixed-dev@xxxxxxxxxxxxx
*Subject: *[comixed-dev] Re: New library code for fetching



Not a problem. :D



When you log into the app, it will (very soon) stop trying to
download the entire library in chunks of 100 comics/request).



Instead, when you go to the library page (/comics), the browser will
send a request to the backend and ask for comics to display on the 
current
page.That's determined by three things:

1. the current page of comics you're on,

2. how many comics you are showing on a page, and

3. the sort order for the comics.



The display widget (called DataView) knows how many total comics
there are, and how many you want to show per page, and divides that into
the number of pages. So if you're viewing comics 25 at a time then the
first page is comics 1-25, the second is 26-50, etc. So as you navigate
through the pages of comics, the browser sends a request for the comics 
to
show just for that page.



The long and short of it is, if you're only viewing 25 comics per
page, then the browser will only have those 25 in memory. When you go to
the next or previous page of comics the browser will go and get them from
the backend and then those are the ones it has in memory.



Is that a better description?



On Mon, Nov 25, 2019 at 2:34 PM bareheiny Alexander <
dmarc-noreply@xxxxxxxxxxxxx> wrote:

Mmmm....this is sounding familiar, I’ll need to revisit the open
tickets to refresh my memory.



Can you outline what happens when the library is being loaded (in
laymen’s terms)?



I have a rough idea, but want to double check before I say something
stupid.







On 26/11/2019, at 05:06, Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:



With the code that I checked in yesterday, it should be a lot faster
to load since it's no longer going to try and load everything once you 
log
in. It's going to now start pulling strategic chunks of data as needed,
only as much as need be shown on the current page. The old code is still
there as the collections views still depend on it. But for the main 
library
viewing it only loads what it needs.



Regarding caching things, we had/have a ticket for caching the cover
image so they can be more quickly retrieved. I'm not sure if pulling them
from a database is going to be any faster than extracting them out of the
comic file, but my thought was to have CX maintain a thumbnails/caching
directory where it would story covers hierarchically by hash value (break
up the hash into 4-char pieces and each represents a subdirectory). Since
file access is fastest, it can get the hash, look for the file and, if 
it's
not there, grab it from the archive, cache it and return it. But I'm open
to other ideas for how to make it faster.



On Mon, Nov 25, 2019 at 5:32 AM bareheiny Alexander <
dmarc-noreply@xxxxxxxxxxxxx> wrote:

Over the years, I’ve been explored YAC, Ubooquity and ComicRack
(something’s happening here...the website is showing a new landing page).

As far as I can tell, all of the applications extract and store comic
covers – making the thumbnail generation a lot quicker.  Is that 
something
you’ve considered for CR?



My (non-developer) thoughts are that cover display would be pulled
from pre-extracted images...statistics and filter fields (publisher,
characters etc.) would be pulled from the database via SQL (I’m a BI
developer, so I see SQL everywhere – if all you have is a hammer, all you
see are nails as they say) as the user navigates to the relevant pages –
rather than having to wait for the entire library to load and get
everything populated.



As it stands, with CX trying to load the entire library and all
metadata....it takes far too long to load a large library (as I’ve
mentioned on GitHub, my session times out before the library fully 
loads).
If there is no metadata, the library loads quick smart (to be fully
confirmed).



Not being an application developer, I’m likely missing vital
information / experience...I’m more than happy to be enlightened.  Also
happy to be told that this isn’t the appropriate list for my input :)





*From: *Darryl L. Pierce <mcpierce@xxxxxxxxx>
*Sent: *Monday, 25 November 2019 2:43 PM
*To: *comixed-dev@xxxxxxxxxxxxx
*Subject: *[comixed-dev] New library code for fetching



I spent time yesterday and today writing a new set of actions for the
library to move away from loading the whole library into the browser. 
What
it does now is, when you go to the library view, it fetches just the 
comics
for the current page. And as you move about, changing sorting, switching
pages, changing the number of comics to show, etc, it makes a REST call 
to
fetch the comics to display and refreshes the view.



It's going to be a process to refactor other pages, but what I'm
thinking is this:



1. Have the main page load specific statistics (rather than
extracting it from the comics as they're loaded) with a single REST API.

2. Have each of the collections page use a similar request (or
enhancements to the new request) to get comics in pages.

3. Change the current continuous update to do some other, simpler
actions to get statistics on the library rather than loading everything. 
Or
just dump that continuous update entirely.



And these are all things I think we can get done by the end of the
year when I want to put the 0.5 release out for RC.



I merged this one, but would like to start putting things up for PRs
to get feedback if you guys are comfortable with getting more hands-on 
now.
:D


--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie





--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--

Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie





--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie

Other related posts: