From d46c91ea0eb4bb75c4363d6d97a7997dfde18621 Mon Sep 17 00:00:00 2001 From: YummyCocoa Date: Wed, 15 May 2024 17:17:02 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BD=BF=E7=94=A8=E6=9A=B4=E5=8A=9BGC?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3=E5=B0=8F=E7=8B=BC=E6=AF=AB?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用暴力GC方法,尝试解决使用小狼毫一段时间后,可能存在的卡顿问题 --- double_pinyin.schema.yaml | 1 + double_pinyin_abc.schema.yaml | 1 + double_pinyin_flypy.schema.yaml | 1 + double_pinyin_mspy.schema.yaml | 1 + double_pinyin_sogou.schema.yaml | 1 + double_pinyin_ziguang.schema.yaml | 1 + lua/force_gc.lua | 9 +++++++++ rime_mint.schema.yaml | 1 + rime_mint_flypy.schema.yaml | 1 + terra_pinyin.custom.yaml | 1 + wubi86_jidian.schema.yaml | 1 + wubi98_mint.schema.yaml | 1 + 12 files changed, 20 insertions(+) create mode 100644 lua/force_gc.lua diff --git a/double_pinyin.schema.yaml b/double_pinyin.schema.yaml index 9e00433..79d9844 100644 --- a/double_pinyin.schema.yaml +++ b/double_pinyin.schema.yaml @@ -75,6 +75,7 @@ engine: - table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低) - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@wubi98_mint + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/double_pinyin_abc.schema.yaml b/double_pinyin_abc.schema.yaml index e8f5d9e..4adf8f7 100644 --- a/double_pinyin_abc.schema.yaml +++ b/double_pinyin_abc.schema.yaml @@ -75,6 +75,7 @@ engine: - table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低) - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@wubi98_mint + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/double_pinyin_flypy.schema.yaml b/double_pinyin_flypy.schema.yaml index 1f25c92..2ab79a1 100644 --- a/double_pinyin_flypy.schema.yaml +++ b/double_pinyin_flypy.schema.yaml @@ -86,6 +86,7 @@ engine: - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@wubi98_mint - reverse_lookup_translator@stroke + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/double_pinyin_mspy.schema.yaml b/double_pinyin_mspy.schema.yaml index 0383121..408d578 100644 --- a/double_pinyin_mspy.schema.yaml +++ b/double_pinyin_mspy.schema.yaml @@ -75,6 +75,7 @@ engine: - table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低) - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@wubi98_mint + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/double_pinyin_sogou.schema.yaml b/double_pinyin_sogou.schema.yaml index 7dc3762..90454cd 100644 --- a/double_pinyin_sogou.schema.yaml +++ b/double_pinyin_sogou.schema.yaml @@ -75,6 +75,7 @@ engine: - table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低) - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@wubi98_mint + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/double_pinyin_ziguang.schema.yaml b/double_pinyin_ziguang.schema.yaml index 199f2c2..78a929a 100644 --- a/double_pinyin_ziguang.schema.yaml +++ b/double_pinyin_ziguang.schema.yaml @@ -75,6 +75,7 @@ engine: - table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低) - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@wubi98_mint + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/lua/force_gc.lua b/lua/force_gc.lua new file mode 100644 index 0000000..93fe3a1 --- /dev/null +++ b/lua/force_gc.lua @@ -0,0 +1,9 @@ +-- 暴力 GC +-- 详情 https://github.com/hchunhui/librime-lua/issues/307 +-- 这样也不会导致卡顿,那就每次都调用一下吧,内存稳稳的 +local function force_gc() + -- collectgarbage() + collectgarbage("step") +end + +return force_gc \ No newline at end of file diff --git a/rime_mint.schema.yaml b/rime_mint.schema.yaml index b57e008..ca14d53 100755 --- a/rime_mint.schema.yaml +++ b/rime_mint.schema.yaml @@ -80,6 +80,7 @@ engine: - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@stroke # - reverse_lookup_translator # 反查模块,多标签情况下去除 + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/rime_mint_flypy.schema.yaml b/rime_mint_flypy.schema.yaml index e0c0429..2553135 100755 --- a/rime_mint_flypy.schema.yaml +++ b/rime_mint_flypy.schema.yaml @@ -80,6 +80,7 @@ engine: - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@stroke # - reverse_lookup_translator # 反查模块,多标签情况下去除 + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*corrector_filter # 错音错字提示 - lua_filter@*autocap_filter # 英文自动大写 diff --git a/terra_pinyin.custom.yaml b/terra_pinyin.custom.yaml index c1e6874..5490e1a 100755 --- a/terra_pinyin.custom.yaml +++ b/terra_pinyin.custom.yaml @@ -73,6 +73,7 @@ patch: - reverse_lookup_translator@radical_reverse_lookup - reverse_lookup_translator@stroke - script_translator + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*autocap_filter # 英文自动大写 - simplifier@emoji_suggestion # Emoji OpenCC diff --git a/wubi86_jidian.schema.yaml b/wubi86_jidian.schema.yaml index c389c60..00df084 100755 --- a/wubi86_jidian.schema.yaml +++ b/wubi86_jidian.schema.yaml @@ -69,6 +69,7 @@ engine: - table_translator@melt_eng # 英文输入(作为子翻译器,优先级需要比原生的低) - reverse_lookup_translator@rime_mint # 反查薄荷拼音 - table_translator + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*autocap_filter # 英文自动大写 - simplifier@emoji_suggestion # Emoji diff --git a/wubi98_mint.schema.yaml b/wubi98_mint.schema.yaml index 4b0aefc..1f52425 100755 --- a/wubi98_mint.schema.yaml +++ b/wubi98_mint.schema.yaml @@ -72,6 +72,7 @@ engine: - reverse_lookup_translator@rime_mint # 反查薄荷拼音 # - echo_translator # ※ 没有候选词,返回字符 # - reverse_lookup_translator # 反查模块,多标签情况下去除 + - lua_translator@*force_gc # 暴力GC,尝试解决小狼毫长期使用的卡顿 filters: - lua_filter@*autocap_filter # 英文自动大写 - simplifier@emoji_suggestion # Emoji