Title: let struct's internal cache use FIFO policy
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9, Python 3.8
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: inada.naoki, malin, rhettinger
Priority: normal Keywords: patch

Created on 2019-03-30 02:43 by malin, last changed 2019-03-30 06:58 by rhettinger. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12624 closed malin, 2019-03-30 02:46
Messages (3)
msg339168 - (view) Author: Ma Lin (malin) * Date: 2019-03-30 02:43
Currently, when the cache is full, the entire cache is cleared.
This patch let it use FIFO policy.

Inada Naoki, Raymond Hettinger, could you review this patch? Thanks.
No hurry, just do it when you have time.
msg339169 - (view) Author: Ma Lin (malin) * Date: 2019-03-30 03:11
FYI, re module's cache is using FIFO policy:
msg339181 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-03-30 06:58
I don't know that FIFO makessense in the context of how the struct module is typically used.  Also rebuilding structs in cheap so there is very little need for further optimization.  As far as I can tell, no user has ever reported a performance issue with struct (if they had, we could analyze their use case to determine an optimal cache strategy).

So, my preference is to leave the code as-is.
Date User Action Args
2019-03-30 06:58:22rhettingersetstatus: open -> closed
resolution: rejected
messages: + msg339181

stage: patch review -> resolved
2019-03-30 03:11:56malinsetmessages: + msg339169
2019-03-30 02:46:11malinsetkeywords: + patch
stage: patch review
pull_requests: + pull_request12558
2019-03-30 02:43:45malincreate