Closed elacuesta closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
030c8a1
) to head (2ffbdcb
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
No strong opinion either way. Would it make sense to make this user-configurable?
Thanks for the comment @Gallaecio. I'm closing this in favor of #286, it's much more complex but it keeps the thread count low while providing good concurrency.
Closes #282
Sample spider:
The current implementation gives
'playwright/page_count/max_concurrent': 1
, with this patch I've obtained up to 6, with an average of 3. This is still low, I suspect it' because the calls are still blocking and what I'm doing with this patch is just split the waiting in two blocks (asyncio.run_coroutine_threadsafe(...)
&future.result()
) allowing for other requests to be processed in the middle.Alternative
I could defer all calls to threads, however I'm not sure if that's a good idea. It seems to provide better performance, though also not as high as I'd expect (up to 10 concurrent pages, these docs are not working for me to increase the amount of threads).
@Gallaecio @wRAR I'd appreciate if you could give your opinion in these two approaches, thanks in advance.