[#51834] [ruby-trunk - Bug #7780][Open] Marshal & YAML should deserialize only basic types by default. — "marcandre (Marc-Andre Lafortune)" <ruby-core@...>
[#51864] [ruby-trunk - Bug #7784][Open] [mingw] r39055 creates test failures and functionality loss — "jonforums (Jon Forums)" <redmine@...>
[#51870] [Backport93 - Backport #7786][Assigned] fix for abstract namespace — "shugo (Shugo Maeda)" <redmine@...>
[#51897] [ruby-trunk - Feature #7791][Open] Let symbols be garbage collected — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>
(2013/02/06 22:50), shyouhei (Shyouhei Urabe) wrote:
A slightly different idea, closer to the existing garbage collection:
I think Koichi's approach is a better one. I don't think there are any
(2013/02/07 20:25), Rodrigo Rosenfeld Rosas wrote:
On Wed, Feb 6, 2013 at 2:37 PM, rosenfeld (Rodrigo Rosenfeld Rosas)
[#51898] [ruby-trunk - Feature #7792][Open] Make symbols and strings the same thing — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>
On 8 February 2013 03:01, jeremyevans0 (Jeremy Evans) <
Em 07-02-2013 19:15, Matthew Kerwin escreveu:
Hi,
Em 07-02-2013 21:58, Yukihiro Matsumoto escreveu:
You don't need to hijack any code for it, you'd just use it as
Em 06-02-2013 12:36, Yorick Peterse escreveu:
I don't think I'm following you, can you explain what's supposedly
Em 06-02-2013 13:25, Yorick Peterse escreveu:
> What I'm trying to say is that the main reason why symbols exist in
Em 06-02-2013 16:22, Yorick Peterse escreveu:
> And "growing until you hit your memory limit" is actually only valid
On 7 February 2013 20:46, rosenfeld (Rodrigo Rosenfeld Rosas) wrote:
Em 07-02-2013 10:04, Matthew Kerwin escreveu:
On 7 February 2013 23:09, Rodrigo Rosenfeld Rosas wrote:
On Feb 7, 2013, at 10:43, David MacMahon <davidm@astro.berkeley.edu> wrote:
Issue #7792 has been updated by dsferreira (Daniel Ferreira).
[#51965] [ruby-trunk - Feature #7795][Open] Symbol.defined? and/or to_existing_symbol — "Student (Nathan Zook)" <blogger@...>
[#51977] [ruby-trunk - Feature #7797][Open] Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>
[#52042] [ruby-trunk - Bug #7805][Open] ruby 2.0rc2 core on solaris — "groenveld@... (John Groenveld)" <groenveld@...>
[#52048] [ruby-trunk - Bug #7806][Open] inconsistency between Method#inspect and Method#name — "Hanmac (Hans Mackowiak)" <hanmac@...>
[#52073] [ruby-trunk - Bug #7815][Open] Backport: Warning about TracePoint events to 2.0.0 — "zzak (Zachary Scott)" <zachary@...>
[#52075] [ruby-trunk - Feature #7816][Open] Don't invalidate method caches when defining a new method on a class without subclasses — "charliesome (Charlie Somerville)" <charlie@...>
[#52077] [ruby-trunk - Bug #7817][Open] (Unable to compile Ruby 2.0.0-rc2 on OSX (clang version 2.1) — "injekt (Lee Jarvis)" <ljjarvis@...>
[#52087] [ruby-trunk - Bug #7820][Assigned] Let's decide Ruby 2.0 supported platform list — "mame (Yusuke Endoh)" <mame@...>
Dne 10.2.2013 13:01, mame (Yusuke Endoh) napsal(a):
[#52130] [ruby-trunk - Bug #7829][Open] Rounding error in Ruby Time — "loirotte (Philippe Dosch)" <loirotte@...>
2013/2/22 David MacMahon <davidm@astro.berkeley.edu>:
2013/4/4 David MacMahon <davidm@astro.berkeley.edu>:
2013/4/5 David MacMahon <davidm@astro.berkeley.edu>:
[#52131] [ruby-trunk - Bug #7830][Open] Ruby packages should not build with -Werror when distributed — "kremenek (Ted Kremenek)" <kremenek@...>
[#52165] [ruby-trunk - Feature #7839][Open] Symbol.freeze_symbols — "tenderlovemaking (Aaron Patterson)" <aaron@...>
[#52206] [ruby-trunk - Bug #7842][Assigned] An alias of a "prepend"ed method skips the original method when calling super — "mame (Yusuke Endoh)" <mame@...>
[#52215] [ruby-trunk - Bug #7845][Open] Strip doesn't handle unicode space characters in ruby 1.9.2 & 1.9.3 (does in 1.9.1) — "timothyg56 (Timothy Garnett)" <timothyg@...>
[#52254] p385 breaks bakward compatibility — V咜 Ondruch <v.ondruch@...>
Hi,
On 02/14 06:06, V?t Ondruch wrote:
[#52267] [ruby-trunk - Feature #7854][Open] New method Symbol[string] — "Student (Nathan Zook)" <blogger@...>
[#52371] Broken email notification from Redmine? — =?ISO-8859-2?Q?V=EDt_Ondruch?= <v.ondruch@...>
Hi,
[#52492] Redmine & utf in title bug — Marc-Andre Lafortune <ruby-core-mailing-list@...>
I notice a lot of
[#52495] [ruby-trunk - Bug #7879][Open] File.readable? fails when ruby runs as root — "balbi (Feliple Balbi)" <balbif@...>
[#52508] Should I document refinements in a PickAxe update? — Dave Thomas <dave@...>
Gentle core folk:
On Feb 18, 2013, at 19:58, Dave Thomas <dave@pragprog.com> wrote:
> I think a document in a PickAxe update with appropriate warnings would
2013/2/19 Dave Thomas <dave@pragprog.com>:
[#52581] Fwd: Fixnum: freeze status on ruby 2.0.0 rc2 — Ryan Davis <ryand-ruby@...>
[#52596] [CommonRuby - Feature #7895][Open] Exception#backtrace_locations to go with Thread#backtrace_locations and Kernel#caller_locations — "headius (Charles Nutter)" <headius@...>
(2013/02/21 6:02), headius (Charles Nutter) wrote:
On Thu, Feb 21, 2013 at 8:36 AM, SASADA Koichi <ko1@atdot.net> wrote:
[#52701] [ruby-trunk - Feature #7914][Open] Case for local class methods — "trans (Thomas Sawyer)" <transfire@...>
[#52704] Feature Request w/ Patch: CSV::Row, adds ".each_pair" as an alias for ".each" — Ryan Dowell <ssstarduster@...>
A very simple patch. Adds ".each_pair" as an alias to ".each" in
[#52722] [ruby-trunk - Bug #7917][Open] Can't write to a Logger in a signal handler — "mperham (Mike Perham)" <mperham@...>
"mperham (Mike Perham)" <mperham@gmail.com> wrote:
[#52723] Improving order of NEWS — Marc-Andre Lafortune <ruby-core-mailing-list@...>
I feel the NEWS are in the wrong order: C API, builtin classes, std-lib,
[#52727] [ruby-trunk - Feature #7918][Open] Create Signal.in_trap?() — "kosaki (Motohiro KOSAKI)" <kosaki.motohiro@...>
(2013/02/23 11:31), kosaki (Motohiro KOSAKI) wrote:
[#52737] What's the *right* way to build Ruby from source on a Linux system that doesn't yet have Ruby? — Paul Sherwood <paul.sherwood@...>
We'd like to add Ruby support in a clean Linux environment which has
On Sat, Feb 23, 2013 at 9:38 AM, Paul Sherwood
On 23/02/2013 13:16, Luis Lavena wrote:
> On 23/02/2013 13:16, Luis Lavena wrote:
[#52876] [ruby-trunk - Bug #7957][Open] rb_str_modify() does not prevent shared string from rb_str_set_len() — "normalperson (Eric Wong)" <normalperson@...>
[#52877] Any documentation about debugging in Ruby 2.0.0 — Rodrigo Rosenfeld Rosas <rr.rosas@...>
Hi, I couldn't find how to debug Ruby 2.0.0 programs, but only a few
On Monday, February 25, 2013, Rodrigo Rosenfeld Rosas wrote:
Em 25-02-2013 10:47, Jeremy Kemper escreveu:
(2013/02/26 0:22), Rodrigo Rosenfeld Rosas wrote:
(2013/02/26 2:34), SASADA Koichi wrote:
Em 26-02-2013 15:14, SASADA Koichi escreveu:
(2013/02/27 4:19), Rodrigo Rosenfeld Rosas wrote:
Em 26-02-2013 17:23, SASADA Koichi escreveu:
I rewrite a debugger for Ruby 2.0.
Thank you very much, Koichi, but I couldn't get it to work yet:
[#52997] [ruby-trunk - Feature #7978][Open] boolean to_i — "alexeymuranov (Alexey Muranov)" <redmine@...>
[#53017] [ruby-trunk - Bug #7982][Open] rb_raise segfaults on %lli format with (0xffffffff + 1) — "erik.s.chang (Erik Chang)" <erik.s.chang@...>
[#53035] [ruby-trunk - Feature #7986][Open] Custom case statement comparison method — "trans (Thomas Sawyer)" <transfire@...>
[ruby-core:51936] Re: [ruby-trunk - Feature #7792] Make symbols and strings the same thing
Em 06-02-2013 13:25, Yorick Peterse escreveu:
> I don't think I'm following you, can you explain what's supposedly
> ironic about it? Using Hashie only "slows" things down based on whether
> you use Symbols, Strings or object attributes. Unless you use it *all*
> over the place the performance impact is small.
What I'm trying to say is that the main reason why symbols exist in Ruby
in the first place is performance from what I've been told.
But then people don't want to worry if hashes are indexed by strings or
symbols so they end up using some kind of HashWithIndifferentAccess or
similar techniques. But since the normal Hash class doesn't behave this
way you have to loop through all hashes in an object returned by
JSON.parse to make them behave as HashWithIndifferentAccess, which is
has a huge performance hit when compared to the small gains symbols
could add.
> I personally don't fully agree with what Hashie does because I believe
> people should be competent enough to realize that when they take in
> external data it's going to be String instances (for keys that is).
It is not a matter of being competent or not. You can't know in advance
if a hash returned by some external code is indexed by string or
symbols. You have to test by yourself or check the documentation. Or you
could just use a HashWithIndifferentAccess class and stop worrying about
it. This has a big impact on coding speed and software maintenance,
which is the big problem in my opinion.
> Having said that, I think fundamentally changing the way Ruby works when
> it comes to handling Strings and Symbols because developers can't be
> bothered fixing the root cause of the problem is flawed.
People reading some Ruby book will notice that it is not particularly
designed with performance in mind but it is designed mostly towards
programmer's happiness. If that is the case, then worrying about
bothered programmers makes sense to a language like Ruby in my opinion.
> If you're worried about a ddos
DDoS is a separate beast that can't be easily prevented no matter what
language/framework you use. I'm just talking about DoS exploiting
through memory exhaustion due to symbols not being collected. Anyway,
this is a separate issue from this one and would be better discussed in
that separate thread.
> stop converting everything to Symbols.
I'm not converting anything to symbols. Did you read the feature
description use case? I'm just creating regular hashes using the new
sexy hash syntax which happens to create symbols instead of strings.
Then when I serialize my object to JSON for storing on Redis for caching
purpose I'll get a hash indexed by strings instead of symbols. That
means that when I'm accessing my hash I have to be worried if the hash
has been just generated or if it was loaded from Redis to decide if I
should use strings or symbols to get the hash values. There are many
more similar situations where this difference between symbols and
strings will cause confusion. And I don't see much benefits in keeping
them separate things either.
> If you're worried about not remember what key type to use, use a
> custom object or
> document it so that people can easily know.
This isn't possible when you're serializing/deserializing using some
library like JSON or any other. You don't control how hashes are created
by such libraries.
> While Ruby is all about making the lifes easier I really don't want it
> to become a language that spoon feeds programmers because they're too
> lazy to type 1 extra character *or* convert the output manually. Or
> better: use a custom object as mention above.
Again, see the ticket description first before assuming things.
> The benchmark you posted is flawed because it does much, much more than
> benchmarking the time required to create a new Symbol or String
> instance. Lets take a look at the most basic benchmark of these two data
> types:
>
> require 'benchmark'
>
> amount = 50000000
>
> Benchmark.bmbm(40) do |run|
> run.report 'Symbols' do
> amount.times do
> :foobar
> end
> end
>
> run.report 'Strings' do
> amount.times do
> 'foobar'
> end
> end
> end
>
> On the laptop I'm currently using this results in the following output:
>
>
> Rehearsal
> ----------------------------------------------------------------------------
> Symbols 2.310000 0.000000
> 2.310000 ( 2.311325)
> Strings 5.710000 0.000000
> 5.710000 ( 5.725365)
>
> -------------------------------------------------------------------
> total: 8.020000sec
>
> user system
> total real
> Symbols 2.670000 0.000000
> 2.670000 ( 2.680489)
> Strings 6.560000 0.010000
> 6.570000 ( 6.584651)
>
> This shows that the use of Strings is roughly 2,5 times slower than
> Symbols. Now execution time isn't the biggest concern in this case, it's
> memory usage.
Exactly, no real-world software would consist mostly of creating
strings/symbols. Even in a simplistic context like my example, it is
hard to notice any impact on the overall code caused by string
allocation taking more time than symbols.When we get more complete code
we'll notice that it really doesn't make any difference if we're using
symbols or strings all over our code...
Also, any improvements on threading and parallelizing support are likely
to yield much bigger performance boots than any micro-optimization with
symbols instead of strings.
> For this I used the following basic benchmark:
>
> def get_memory
> return `ps -o rss= #{Process.pid}`.strip.to_f
> end
>
> def benchmark_memory
> before = get_memory
>
> yield
>
> return get_memory - before
> end
>
> amount = 50000000
>
> puts "Start memory: #{get_memory} KB"
>
> symbols = benchmark_memory do
> amount.times do
> :foobar
> end
> end
>
> strings = benchmark_memory do
> amount.times do
> 'foobar'
> end
> end
>
> puts "Symbols used #{symbols} KB"
> puts "Strings used #{strings} KB"
>
> This results in the following:
>
> Start memory: 4876.0 KB
> Symbols used 0.0 KB
> Strings used 112.0 KB
>
> Now I wouldn't be too surprised if there's some optimization going on
> because I'm re-creating the same values over and over again but it
> already shows a big difference between the two.
112KB isn't certainly a big difference in my opinion unless you're
designing some embedded application. I've worked with embedded devices
in the past and although I see some attempts to make a lighter Ruby
subset (like mRuby) for such use-case I'd certainly use C or C++ for my
embedded apps these days. Did you know that Java initially was supposed
to be used by embedded devices from what I've been told? Then it tried
to convince people to use it to create multi-platform desktop apps.
After that its initial footprint was so big that it wasn't a good idea
to try it on embedded devices for most cases. Then they tried to make it
work in browsers through applets. Now it seems people want to use Java
mostly for web servers (HTTP and other protocols). The result was a big
mess in my opinion. I don't think Ruby (the full specification) should
be concerned about embedded devices. C is already a good fit for devices
with small memory constraints. When you consider using Ruby it is likely
that you have more CPU and memory resources than a typical small device
would have, so 112KB wouldn't make much difference.
And for embedded devices, it is also recommended that they run some RTOS
instead of plain Linux. If they want to keep with Linux, an option would
be to patch it with Xenomai patch for instance. But in that case, any
real-time task would be implemented in C, not in Ruby or any other
language subjected to garbage collected, like Java. So, if we keep the
focus on applications running on normal computers, 112KB won't really
make any difference, don't you agree?
> To cut a long story short: I can understand what you're trying to get
> at, both with the two data types being merged and the ddos issue.
> However, I feel neither of these issues are an issue directly related to
> Ruby itself. If Ruby were to automatically convert things to Symbols for
> you then yes, but in this case frameworks such as Rails are the cause of
> the problem.
Rails is not related at all to the use case I pointed out in this ticket
description. It happens with regular Ruby classes (JSON, Hash) and with
the "redis" gem that is independent from Rails.
> Merging the two datatypes would most likely make such a
> huge different usage/code wise that it would probably be something for
> Ruby 5.0 (in other words, not in the near future).
Ruby 3.0 won't happen in a near future. Next Major means Ruby 3.0 if I
understand it correctly.