Warn about potentially slow method
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
ICache::clean is potentially slow on Redis as removing all keys by prefix requires us to use KEYS which is a slow operation as it needs to walk all keys of the redis instance.
We cannot easily avoid this, but we should somehow make people aware of this and avoid merging cases where this is avoidable.
We could either
- Log any clean calls as debug
- Annontate the method in some way (e.g.
@slow) and write a custom psalm plugin to catch those cases with static analysis
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at ICache::clean and trace its Redis implementation and callers to identify where the potentially slow operation is triggered. Compare the proposed debug logging with the @slow and Psalm-plugin approach, then confirm which direction maintainers want. Done means the chosen warning or analysis mechanism is implemented and its affected call sites are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, redis
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100