[ruby-core:63223] [ruby-trunk - Feature #9953] [Open] set_trace_func values which could be frozen or symbols

From: tom.enebo@...
Date: 2014-06-18 15:34:51 UTC
List: ruby-core #63223
Issue #9953 has been reported by Thomas Enebo.

----------------------------------------
Feature #9953: set_trace_func values which could be frozen or symbols
https://bugs.ruby-lang.org/issues/9953

* Author: Thomas Enebo
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
I have been changing JRuby's tracing support internally and notice we churn through lots of extra Ruby objects per set_trace_func call.  It strikes me that a couple of these values do not need to be allocated more than once.  I propose:

1. event_type becomes a symbol (or could be single frozen string per distinct event type)
2. filename becomes a single frozen string per file (frozen per spec and possible single instance as impl-specific detail)

I find the value of these two values being mutable strings to be minimal and tracing speed will have less GC-pressure.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next