My first suggestion would be to pinpoint the areas of delay.
Use DateTime.Now to print the timestamps at various points in the download.
e.g.
Sub GetContent (nid As Int, aUser As String, aPsw As String) As ResumableSub
dim dur as long = datetime.now
Wait For (GetJSONByNID (nid, aUser, aPsw)) Complete (WSResult As String)
Private WSResponse As String = WSResult
'......
log($"GetContent - node ${nid} took ${(datetime.now-dur)/datetime.tickspersecond} seconds"$)
end sub
That should help pinpoint the performance issue to either processing code or download code.
Hi Andrew,
to pinpoint the areas of delay I'm using Postman set to "GET" (basic auth) and with url format "
https://domain.com//node/ <X>? _Format = json". The remote server is a Drupal (9.x) CMS.
The nodes that I download within the app are logically divided into 3 categories and therefore I am doing 3 separate .download () groups.
Based on the times in ms that Postman gives me, I got the total times for each category:
POSTMAN TEST
Test with Postman - url format:
https://dominio.com//node/<X>?_format=json
T (average) for 1 node = 550 ms
D (average) for 1 node = 2,6 kb
CATEGORY A (20 nodes - 52 kb - 11 seconds)
---------------------------
drupal nodes: 40,42,44,45,46,47,48,49,51,52,54,66,90,125,127,130,131,151,169,173
550 (ms) x 20 (nodes) = 11.000 ms (11 seconds) to download (get) 52 kb
CATEGORY B (8 nodes - 21 kb - 5 seconds)
-------------------------
drupal nodes: 32,33,34,35,37,38,41,104
550 (ms) x 8 (nodes) = 4.400 ms (almost 5 seconds) to download (get) 21 kb
CATEGORY C (14 nodes - 36 kb - 8 seconds)
---------------------------
drupal nodes: 18,19,22,24,93,106,108,123,126,128,132,149,155,171
550 (ms) x 14 (nodes) = 7.700 (almost 8 seconds) to download (get) 36 kb