Issue 36482: let struct's internal cache use FIFO policy
Created on 2019-03-30 02:43 by malin, last changed 2022-04-11 14:59 by admin. 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: https://github.com/python/cpython/blob/v3.8.0a3/Lib/re.py#L288-L293 |
|||
| msg339181 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:13 | admin | set | github: 80663 |
| 2019-03-30 06:58:22 | rhettinger | set | status: open -> closed resolution: rejected messages: + msg339181 stage: patch review -> resolved |
| 2019-03-30 03:11:56 | malin | set | messages: + msg339169 |
| 2019-03-30 02:46:11 | malin | set | keywords:
+ patch stage: patch review pull_requests: + pull_request12558 |
| 2019-03-30 02:43:45 | malin | create | |
