From: normalperson@... Date: 2018-06-04T03:54:52+00:00 Subject: [ruby-core:87375] [Ruby trunk Feature#14820] [PATCH] ipaddr.rb: use frozen_string_literal Issue #14820 has been reported by normalperson (Eric Wong). ---------------------------------------- Feature #14820: [PATCH] ipaddr.rb: use frozen_string_literal https://bugs.ruby-lang.org/issues/14820 * Author: normalperson (Eric Wong) * Status: Open * Priority: Normal * Assignee: knu (Akinori MUSHA) * Target version: ---------------------------------------- ``` ipaddr.rb: use frozen_string_literal This reduces GC count by around 10% and provides a tiny speedup. "make exam" passes, and I've read every single line of ipaddr.rb so it APPEARS safe. An extra set of eyes would be appreciated. ==> i.rb <== 500_000.times do IPAddr.new(-"3ffe:505:2::1") IPAddr.new(-"192.168.2.0/24") end p GC.count $ /usr/bin/time ./ruby i.rb 4058 11.16user 0.33system 0:11.50elapsed 99%CPU (0avgtext+0avgdata 10160maxresident)k 0inputs+0outputs (0major+1390minor)pagefaults 0swaps $ /usr/bin/time ./ruby -I lib i.rb 3651 10.97user 0.32system 0:11.30elapsed 99%CPU (0avgtext+0avgdata 10196maxresident)k 0inputs+0outputs (0major+1377minor)pagefaults 0swaps ``` ---Files-------------------------------- 0001-ipaddr.rb-use-frozen_string_literal.patch (1.17 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: