[ruby-core:63652] [ruby-trunk - Feature #9963] [Feedback] Symbol.count

From: shibata.hiroshi@...
Date: 2014-07-11 06:50:04 UTC
List: ruby-core #63652
Issue #9963 has been updated by Hiroshi SHIBATA.

Status changed from Open to Feedback

----------------------------------------
Feature #9963: Symbol.count
https://bugs.ruby-lang.org/issues/9963#change-47700

* Author: David Cornu
* Status: Feedback
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
I'd like to add a way to get the size of Ruby's symbol table. This is currently possible by using `Symbol.all_symbols`, however it builds a new array every time it's invoked which is pretty inefficient.

The main use case for this would be to assist in detecting accidental symbol creation.

I have a PR open (https://github.com/ruby/ruby/pull/639) that adds a `Symbol.count` method but this could also be added in the output of `GC.stat`.



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

In This Thread

Prev Next