Increasing throughput in a python script

后端 未结 4 626
傲寒
傲寒 2021-01-22 02:23

I\'m processing a list of thousands of domain names from a DNSBL through dig, creating a CSV of URLs and IPs. This is a very time-consuming process that can take several hours.

4条回答
  •  失恋的感觉
    2021-01-22 02:33

    I'd consider using a pure-Python library to do the DNS queries, rather than delegating to dig, because invoking another process can be relatively time-consuming. (Of course, looking up anything on the internet is also relatively time-consuming, so what gilesc said about multithreading still applies) A Google search for python dns will give you some options to get started with.

提交回复
热议问题