Project

General

Profile

Actions

Defect #43737

open

Rendering wiki is significantly slow on Ruby 4.0.1

Added by Katsuya HIDAKA about 6 hours ago. Updated about 3 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

On Ruby 4.0.1, rendering wiki via Redmine::WikiFormatting.to_html is significantly slower than on Ruby 3.4.

The benchmarks below suggest:

  • wiki rendering is consistently slower on Ruby 4.0.1
  • the impact is larger for CommonMark
  • the slowdown is more pronounced when the input includes a table and a code block
  • performance regresses further after the #43643 related commits

CommonMark

bench_commonmark.rb

After #43643

Ruby 4.0.1:

full_ms=1351.52 avg_full=67.58

Ruby 3.4.7:

full_ms=139.79 avg_full=6.99

Before #43643

Ruby 4.0.1

full_ms=802.53 avg_full=40.13

Ruby 3.4.7

full_ms=176.22 avg_full=8.81

Textile

bench_textile.rb

After #43643

Ruby 4.0.1:

full_ms=218.49 avg_full=10.92

Ruby 3.4.7:

full_ms=100.94 avg_full=5.05

Before #43643

Ruby 4.0.1

full_ms=13.97 avg_full=0.7

Ruby 3.4.7

full_ms=32.01 avg_full=1.6

Environment

  • Ruby 4.0.1 vs Ruby 3.4.7 (same Gemfile.lock)
  • commonmarker 2.6.3
  • loofah 2.25.0
  • rouge 4.7.0

Files

bench_commonmark.rb (808 Bytes) bench_commonmark.rb Katsuya HIDAKA, 2026-01-30 04:44
bench_textile.rb (664 Bytes) bench_textile.rb Katsuya HIDAKA, 2026-01-30 04:44
Actions #1

Updated by Marius BĂLTEANU about 3 hours ago

We should wait for the fix mentioned by Pavel in #43650#note-1021824 to be released or to test against the ruby dev from the master branch. I tried to do a quick test, but the build fails on my environment.

Actions

Also available in: Atom PDF