Since CommonMark rendering is used frequently across Redmine, this regression affects the overall responsiveness of the application.
# frozen_string_literal: true
require "benchmark"
Setting.text_formatting = "common_mark"
Setting.cache_formatted_text = 0
ITERATIONS = 10
# Content of https://www.redmine.org/projects/redmine/wiki converted to CommonMark
SAMPLE_TEXT = <<TEXT
# Redmine
Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.
Redmine is open source and released under the terms of the [GNU General Public License v2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL).
## Features
Some of the main features of Redmine are:
- [[RedmineProjects|Multiple projects support]]
- Flexible [[RedmineRoles|role based access control]]
- Flexible [[RedmineIssues|issue tracking system]]
- [[RedmineGantt|Gantt chart]] and [[RedmineCalendar|calendar]]
- [[RedmineNews|News]], [[RedmineDocuments|documents]] & [[RedmineFiles|files]] management
- Feeds & email notifications
- Per project [[RedmineWikis|wiki]]
- Per project [[RedmineForums|forums]]
- [[RedmineTimeTracking|Time tracking]]
- [[RedmineCustomFields|Custom fields]] for issues, time-entries, projects and users
- [[RedmineRepository|SCM integration]] (SVN, CVS, Git, Mercurial and Bazaar)
- [[RedmineReceivingEmails|Issue creation via email]]
- Multiple [[RedmineLDAP|LDAP authentication]] support
- [[RedmineRegister|User self-registration]] support
- Multilanguage support
- [[RedmineInstall#Supported-database-back-ends|Multiple databases]] support
Read more about [[Features|Redmine features]].
## Documentation
You can read the **[[Guide|Redmine guide]]**.
- [[Guide|User's Guide]]
- [[Developer_Guide|Developer's Guide]]
- [DeepWiki Documentation](https://deepwiki.com/redmine/redmine (Auto-generated by DeepWiki))
Other resources:
- [[Changelog]]
- [[Security Advisories]]
- [[FAQ|Frequently Asked Questions]]
- [[HowTos]]
- [[Plugins]]
- [[Themes]]
- [[Logo|Logo and Icon]]
- [[ThirdPartyTools|Third Party Tools]]
## Online demo
A shared online *unofficial* demo site can be found at https://demo.redminecloud.net/. It has been set up to give registered users the ability to create their own projects. This means that once you register, you can create your own project on there and try out the project administration features. Please note that this demo site is an unofficial, third-party site and has no connection to Redmine.org.
## Support & getting help
For getting help or discussing Redmine, you can browse the [Redmine forums](http://www.redmine.org/projects/redmine/boards) hosted right here in Redmine.
We also have a **[[IRC|chatroom]]** - [join #redmine](https://web.libera.chat/?channel=#redmine) on the [libera.chat](https://libera.chat) IRC network.
There's also an unofficial workspace on **[Slack](https://join.slack.com/t/redmineorg/shared_invite/zt-ew74bkww-9~Cs~L2oSioRXDljumZ_zg)** where you can ask questions and participate in discussions with other Redmine users.
Before submitting a bug report, a patch or a feature request here, please read the [[Submissions|Submission guidelines]].
## Contributing and helping out
Redmine is built and maintained by community volunteers. If you enjoy using it and would like to give back to the community, the [[Contribute]] page has several ideas. Software development experience is not required. Check out the [[Teams]] Page if you are interested in a specific area to contribute regularly.
You can also make a donation and get listed on the [[Donors|Redmine Donors page]].
## Who uses Redmine?
[[WeAreUsingRedmine|This page lists]] some companies and projects using Redmine.
TEXT
def render_sample
Redmine::WikiFormatting.to_html(
"common_mark",
SAMPLE_TEXT,
object: Issue.new(id: 1),
attribute: :description
)
end
elapsed = Benchmark.realtime do
ITERATIONS.times { render_sample }
end
avg_ms = (elapsed / ITERATIONS) * 1000
puts format("Average: %.2fs ms", avg_ms)