重构数据结构,并使用 sqlite 进行查询#8
Closed
zxhd863943427 wants to merge 31 commits into
Closed
Conversation
|
Z佬666!静待D大旅游归来! |
Member
|
和 #6 的关系是? |
Author
|
复用了部分数据结构,但基本相当于重写,因为我感觉一些组合查询要求使用原来的方法很难实现。 |
88250
reviewed
Jul 24, 2024
Author
…add functionality for scheduling based on priority.
Author
Member
|
麻烦抽空解决一下冲突。 |
|
@88250 终于开始了!d大,大概还有几个版本才会进入3.2.0呀 |
Member
|
@Jiangshuon 争取今年年内吧。 |
Author
api变化有点大,git自动合并扑街了,我需要抽时间看看。 |
Author
|
@88250 测试dejavu的时候尝试了下跟sqlite的兼容性,发现情况如下: 在使用sqlite.db储存时,在写入的情况下,开启wal模式后,只要不读shm、wal就没多大问题。journal比较麻烦一点,写入太快了,在持续写入情况下,建立了快照后文件就更新了。在读的情况下,都没啥问题。所以sqlite作为储存方式对于dejavu是可行的,只不过最好在写入的时候获取filelock的锁。 |
Member
|
dejavu 不考虑改数据库,用文件系统更好一些。 |
Author
|
@88250 不是 dejavu 自己使用数据库,而是 riff 或者其他思源的组件可以考虑使用数据库进行数据储存,这不会造成问题。 |
Member
|
具体是什么组件,这个要单独分析可行性。 |
Author
|
看了一下,感觉riff和dataview都是可以用sqlite储存的,riff我觉得可以尝试一下,dataview就以后再说吧。 |
|
最近有什么进展消息吗? |
Closed
Member
|
太久没有更新先关闭了,闪卡重构继续延期吧,后面你如果有空想重开麻烦跟我说一声,谢谢! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



该提交主要完成下面的工作:
数据结构具体看代码,在 2万 cardSource 、10万 card 的性能如下所示:
其中
是测试生成待插入卡片的耗时。总体而言,我觉得足以满足闪卡系统的使用需求。
请 @88250 看一下这样做是否可以接受。
另外, 为了快速开发,使用了
modernc.org/sqlite(无cgo,提高打包速度)和xorm.io/xorm(辅助CRUD),如果可行,可以替换回 kernel 使用的github.com/mattn/go-sqlite3并逐步去除 xorm的使用。