Skip to content

ponponUSA 氏の更新をさらに取り入れ#48

Merged
Rumia-Channel merged 8 commits intoRumia-Channel:TESTLfrom
ponponusa:develop
Oct 28, 2025
Merged

ponponUSA 氏の更新をさらに取り入れ#48
Rumia-Channel merged 8 commits intoRumia-Channel:TESTLfrom
ponponusa:develop

Conversation

@Rumia-Channel
Copy link
Copy Markdown
Owner

高速かがメイン

Web UI 周りの不具合は後にこっちで修正できるようにせねば...

@Rumia-Channel Rumia-Channel requested a review from Copilot October 28, 2025 00:15
@Rumia-Channel Rumia-Channel merged commit 672373e into Rumia-Channel:TESTL Oct 28, 2025
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates updates from ponponUSA, primarily focused on performance improvements through caching, YJIT support, and Bootsnap integration. The changes introduce template compilation caching, section data caching, and optimizations to reduce I/O overhead during novel conversion processes.

Key changes:

  • Added YJIT flag and Bootsnap for faster Ruby execution and load times
  • Implemented template compilation caching to avoid re-parsing ERB templates
  • Added section data caching and batch conversion to reduce redundant operations

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
narou.rb Enabled YJIT for Ruby interpreter and integrated Bootsnap for performance optimization
narou.gemspec Added bootsnap dependency (v1.18.6+) to support the new caching infrastructure
lib/template.rb Refactored template handling with compile/render separation and added compilation caching
lib/novelconverter.rb Optimized EPUB subject handling to use in-memory operations, added template/section caching, and implemented batch conversion
lib/converterbase.rb Moved device initialization earlier and added convert_multi method for batch processing, reduced progress bar update frequency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/template.rb
# target_binary_version から参照される @@src_version は
# テンプレート内で <%= Template.target_binary_version 1.1 %> みたいに呼ばれる想定
# なので、ここでは設定しない。テンプレの中から呼ばれた時点で
# @@src_version が更新され、invalid_templace_version? が機能する
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'invalid_templace_version' to 'invalid_template_version' in the comment.

Copilot uses AI. Check for mistakes.
Comment thread lib/novelconverter.rb

on(:"convert_main.loop") do |i|
progressbar.output(i) if progressbar
# 毎回ではな10件ごとに絞る
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

Corrected incomplete phrase '毎回ではな10件ごとに絞る' to '毎回ではなく10件ごとに絞る' in the comment.

Suggested change
# 毎回ではな10件ごとに絞る
# 毎回ではなく10件ごとに絞る

Copilot uses AI. Check for mistakes.
Comment thread lib/novelconverter.rb

@inspector.subtitle = section["subtitle"]
section["subtitle"] = @converter.convert(section["subtitle"], "subtitle")
# キャッシュを壊さないようディープ寄りにdup
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment '寄り' (towards) is vague. Consider clarifying whether this is a shallow or deep copy, e.g., '浅いコピーだがelementは別途コピー' (shallow copy but element is separately copied) to better describe the duplication strategy.

Suggested change
# キャッシュを壊さないようディープ寄りにdup
# キャッシュを壊さないよう浅いコピーだがelementは別途コピー

Copilot uses AI. Check for mistakes.
Comment thread lib/novelconverter.rb
Comment on lines +850 to +853
# キャッシュを壊さないようディープ寄りにdup
# (chapter/subtitle/elementなど後で書き換えるので)
section = original_section.dup
section["element"] = original_section["element"].dup
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

This is not a deep copy. Only the top-level hash and the 'element' hash are duplicated. If 'element' contains nested mutable objects (arrays or hashes), they will still be shared with the original. Consider using deep copy methods like Marshal.load(Marshal.dump(original_section)) or a recursive duplication if nested immutability is required.

Suggested change
# キャッシュを壊さないようディープ寄りにdup
# (chapter/subtitle/elementなど後で書き換えるので)
section = original_section.dup
section["element"] = original_section["element"].dup
# キャッシュを壊さないよう完全なディープコピーを作成
# (chapter/subtitle/elementなど後で書き換えるので)
section = Marshal.load(Marshal.dump(original_section))

Copilot uses AI. Check for mistakes.
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.

3 participants