[#68845] [Ruby trunk - Feature #11056] [PATCH] lib/net/*: use io/wait methods instead of IO.select — normalperson@...
Issue #11056 has been updated by Eric Wong.
3 messages
2015/04/11
[#68945] [Ruby trunk - Feature #11083] [Open] Gemify net-telnet — shibata.hiroshi@...
Issue #11083 has been reported by Hiroshi SHIBATA.
4 messages
2015/04/21
[#68951] Re: [Ruby trunk - Feature #11083] [Open] Gemify net-telnet
— Eric Wong <normalperson@...>
2015/04/21
shibata.hiroshi@gmail.com wrote:
[#69012] [Ruby trunk - Feature #11105] [Open] ES6-like hash literals — shugo@...
Issue #11105 has been reported by Shugo Maeda.
5 messages
2015/04/29
[ruby-core:68878] [Ruby trunk - Feature #11066] [Open] symbol.to_s performance - caching and returning a frozen string
From:
rdsubhas@...
Date:
2015-04-13 20:33:25 UTC
List:
ruby-core #68878
Issue #11066 has been reported by Subhas Dandapani. ---------------------------------------- Feature #11066: symbol.to_s performance - caching and returning a frozen string https://bugs.ruby-lang.org/issues/11066 * Author: Subhas Dandapani * Status: Open * Priority: Normal * Assignee: ruby-core ---------------------------------------- Hi, this is my first report so please bear with me if its bad. Symbol.to_s creates a new string upon every call. This seems to be a huge waste of time. In typical Rails applications, "to_json" is called hundreds of times for ActiveRecord models on each request. Many symbols are being converted to string and GCd again and again. Is it possible to cache and return a Frozen string (string.freeze) when symbol.to_s is called? Now that symbols are also garbage collected, the string can also be garbage collected. I tried getting some performance benchmarks, but with Ruby 2.1, I'm not able to modify Symbol class. I believe Symbols are now frozen internally so any modifications are not possible. So I was not able to do any monkey patching or benchmarking. But I can confirm that new strings are getting created every time, please see attached file. I believe caching this would improve performance. It would also increase memory usage, but since symbols are also garbage collected, the memory can be freed up over time, and anyways we can cache only when "symbol.to_s" is invoked first time. ---Files-------------------------------- symbol_to_s_mem_usage.rb (283 Bytes) -- https://bugs.ruby-lang.org/