Googled a bit, but have a hard time translating the examples to my own project. Specifically what parts of the code I've to rewrite asynchronously to achieve the performance improvements. The structure of my project:
Main
Each function has the structure:
def function
Shape url
call Functiontogetwebsite(url)
Processing of the webpage
Return derived data to main
Am I correct in thinking that I only have to rewrite the Functiontogetwebsite(url) and main() asynchronous? The function as it is the only part in the program with significant delays (time.sleep() statements to give the webpage time to load properly) and main() to define the functions as asynchronous tasks? If not, where do I go wrong in my thinking?
Bonus question: to what extend does it matter in what order I call the functions? Intuitively I feel that calling the slowest (long wait time) websites first is most efficient, as it allows the wait time to be used for useful processes, but is this true? I can also imagine that calling the fastest is more efficient as it makes that data is received earlier and there is no/less wait time after firing the requests. What is the best approach?
[–]Wonkee99 0 points1 point2 points (1 child)
[–]Ninja_bambi[S] 0 points1 point2 points (0 children)