Project

General

Profile

Actions

Feature #11375

closed

Decreased Object Allocation in Pathname.rb

Added by schneems (Richard Schneeman) about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:70043]

Description

Pathname.rb has many string literals that are not mutated while being called. We can reduce object allocation and increase program speed by freezing these string literals.

I've attached a patch that adds .freeze to all non-mutated string literals in ext/pathname/lib/pathname.rb.

Tests on test/pathname/test_pathname.rb pass


Files

ruby-changes.patch (658 Bytes) ruby-changes.patch schneems (Richard Schneeman), 10/02/2015 03:56 PM
Actions

Also available in: Atom PDF