Patches: Browse | Submit New | Admin

[#22557] Optimization: reduce garbage and redundant operations in index_to_links

Date:
2008-10-26 01:14
Priority:
3
Submitted By:
Hongli Lai (hongli)
Assigned To:
Eric Hodel (drbrain)
Category:
RDoc::Generator / rdoc command
State:
Closed
Summary:
Optimization: reduce garbage and redundant operations in index_to_links

Detailed description
When generating RDoc output, index_to_links is inefficient:
- It sorts its given collection on every call.
- It calls non-in-place methods to sort, map and compact its given collection.

index_to_links is called every often: about 3 times for each file, class and method.

With this patch, the collections are sorted only once. It also reduces the amount of garbage objects by using in-place
array manipulation methods as much as possible. This yields an overall performance improvement of about 14%.

This patch has been tested against the RDoc sources itself as well as against the Ruby 1.8 standard library, with both
the default template and the Hanna template.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-12-08 23:26
Sender: Eric Hodel

Applied.

Attached Files:

Name Description Download
rdoc-index-to-links-opimizations.diff Download

Changes:

Field Old Value Date By
status_idOpen2008-12-08 23:26drbrain
resolution_idNone2008-12-08 23:26drbrain
artifact_group_idNone2008-12-08 23:26drbrain
assigned_tonone2008-12-08 23:26drbrain
close_date2008-12-08 23:262008-12-08 23:26drbrain
File Added4112: rdoc-index-to-links-opimizations.diff2008-10-26 15:09hongli