New submission from Serhiy Storchaka <[email protected]>:
There are issues in implementing support of request rate in robotparser.
req_rate = collections.namedtuple('req_rate',
'requests seconds')
entry.req_rate = req_rate
entry.req_rate.requests = int(numbers[0])
entry.req_rate.seconds = int(numbers[1])
First, a new namedtuple type is created for every entry. This is slow even with
recent namedtuple optimizations, and is much slower in 3.6. This wastes a
memory, since new type is created for every entry. This is definitely wrong,
since req_rate is set to a namedtuple type instead of namedtuple instance. And
there is a question why a namedtuple is used here at all. Other classes in this
module are not namedtuples.
----------
components: Library (Lib)
messages: 303508
nosy: XapaJIaMnu, berker.peksag, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Issues with request rate in robotparser
type: behavior
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31661>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com