Skip to content

feat(simplifier): cache opencc#977

Merged
ksqsf merged 1 commit into
rime:masterfrom
wzv5:cache_opencc
Feb 12, 2025
Merged

feat(simplifier): cache opencc#977
ksqsf merged 1 commit into
rime:masterfrom
wzv5:cache_opencc

Conversation

@wzv5
Copy link
Copy Markdown
Contributor

@wzv5 wzv5 commented Feb 10, 2025

Pull request

Feature

之前每创建一个 session,就会重复加载一遍 opencc,造成 session 初始化时卡顿,内存占用也会增加 10 MB 左右。如果有几十个 session,就会额外占用几百 MB 内存。
本 pr 为 opencc 增加了缓存机制,避免重复加载。

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

Copy link
Copy Markdown
Member

@lotem lotem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

靠譜

@amzxyz

This comment was marked as off-topic.

ksqsf
ksqsf approved these changes Feb 12, 2025
@ksqsf ksqsf merged commit f9411ae into rime:master Feb 12, 2025
@wzv5
Copy link
Copy Markdown
Contributor Author

wzv5 commented Feb 13, 2025

@ksqsf 是说弱引用不会被回收么,这就奇怪了,是不是 librime 里还有哪里持有对象?

@ksqsf
Copy link
Copy Markdown
Member

ksqsf commented Feb 13, 2025

@ksqsf 是说弱引用不会被回收么,这就奇怪了,是不是 librime 里还有哪里持有对象?

我看错了

@wzv5 wzv5 deleted the cache_opencc branch February 21, 2025 06:11
Vescrity added a commit to Vescrity/librime that referenced this pull request Oct 29, 2025
Vescrity added a commit to Vescrity/librime that referenced this pull request Oct 29, 2025
Vescrity added a commit to Vescrity/librime that referenced this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants