-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 基于优先级淘汰的本地缓存设计与实现 #19
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ekit 的 Queue 可能有比较多问题,不一定能直接用,但是应该尽可能适配过去,省得维护两个优先级队列要崩溃。
要现在 ekit 里面暴露了 Internal 里面的优先级队列,然后你这里直接使用。如果每一个地方都维护一个优先级队列,要崩溃。 |
先等我解决了另外一个合并请求来,那边也有优先级队列的问题。不过那边的解决方案有点不太一样。后面找你讨论。 |
好的 |
合并最新代码,你可以先看看红黑树那边的基本思路。核心还是这个优先级队列不好维护。 |
我大概看了一下,我的理解是,目前还是认为用户不会修改数据的优先级,也就是就算数据的优先级改了也不会重新进行堆化,然后每次删除进行标记删除,等到淘汰的时候迭代删除空节点。这样理解有无问题? |
是的,就是这个原则, 你可以在注释里面标注一下,这里暂时不支持调整优先级。 |
大哥你的各种 CI 都崩溃了! |
Codecov Report
@@ Coverage Diff @@
## main #19 +/- ##
==========================================
- Coverage 98.37% 92.38% -6.00%
==========================================
Files 4 5 +1
Lines 615 840 +225
==========================================
+ Hits 605 776 +171
- Misses 7 58 +51
- Partials 3 6 +3
... and 2 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
优先级队列实现,以及基于优先级淘汰的本地缓存设计与实现