PT0-002 · Question #614
A penetration tester is writing a web scraper to process a list of more than 100.000 URLs: Which of the following script snippets should the tester use for the best performance?
The correct answer is D. Option D. For processing a large number of URLs, the best performance is achieved through asynchronous or parallel processing.
Question
A penetration tester is writing a web scraper to process a list of more than 100.000 URLs:
Which of the following script snippets should the tester use for the best performance?
Exhibits
Options
- AOption A
- BOption B
- COption C
- DOption D
How the community answered
(20 responses)- A15% (3)
- B5% (1)
- C25% (5)
- D55% (11)
Why each option
For processing a large number of URLs, the best performance is achieved through asynchronous or parallel processing.
Option A likely represents a sequential processing approach, which would be slow for 100,000 URLs as each request waits for the previous one to complete.
Option B likely represents a sequential processing approach, which would be slow for 100,000 URLs as each request waits for the previous one to complete.
Option C likely represents a sequential processing approach, which would be slow for 100,000 URLs as each request waits for the previous one to complete.
For processing a large list of URLs, the best performance is achieved through asynchronous or parallel processing. Option D likely represents a solution that uses concurrent requests, such as a thread pool, asyncio, or similar mechanisms, allowing multiple URLs to be fetched simultaneously rather than sequentially. This significantly reduces the total time required compared to processing each URL one after another.
Concept tested: Web scraping performance, concurrent programming
Source: https://docs.python.org/3/library/asyncio.html
Topics
Community Discussion
No community discussion yet for this question.

