Project

General

Profile

Actions

Feature #11375

closed

Decreased Object Allocation in Pathname.rb

Added by schneems (Richard Schneeman) over 8 years ago. Updated over 8 years ago.

Status:
Closed
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

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0