Totally random thought:
Can lru_cache be simplified to use an ordered dict instead of dict +
linked list?
On 15 September 2016 at 20:30, Serhiy Storchaka wrote:
> On 15.09.16 19:13, Antoine Pitrou wrote:
>>
>> Since this micro-benchmark creates the keys in order just before
>> filling the dict w
On Tue, Sep 20, 2016 at 7:02 PM, INADA Naoki wrote:
> On Tue, Sep 20, 2016 at 6:56 PM, Dima Tisnek wrote:
>> Totally random thought:
>>
>> Can lru_cache be simplified to use an ordered dict instead of dict +
>> linked list?
>>
>
> I think so.
> See also: http://bugs.python.org/issue28199#msg27693
On Tue, Sep 20, 2016 at 5:11 AM, INADA Naoki wrote:
> But both of OrderedDict and lru_cache improvements can't be in 3.6
> since 3.6 is beta now.
> I'll try it after 3.6rc1.
When you do, make sure you keep in mind the performance constraints of
*all* the OrderedDict methods. The constraints are
On Thu, Sep 15, 2016 at 1:27 PM, Paul Moore wrote:
> On 15 September 2016 at 10:43, Raymond Hettinger
> wrote:
>> Something like this will reveal the true and massive improvement in
>> iteration speed:
>>
>> $ ./python.exe -m timeit -s "d=dict.fromkeys(map(str,range(10**6)))"
>> "list(d)"