[#97086] [Ruby master Bug#16612] Enumerator::ArithmeticSequence#last with float range produces incorrect value — muraken@...
Issue #16612 has been updated by mrkn (Kenta Murata).
4 messages
2020/02/07
[#97307] [Ruby master Feature#16663] Add block or filtered forms of Kernel#caller to allow early bail-out — headius@...
Issue #16663 has been reported by headius (Charles Nutter).
29 messages
2020/02/28
[ruby-core:97165] [Ruby master Feature#16029] Expose fstring related APIs to C-extensions
From:
jean.boussier@...
Date:
2020-02-14 14:19:22 UTC
List:
ruby-core #97165
Issue #16029 has been updated by byroot (Jean Boussier).
> it makes sense to add an official API as well that does not depend on dynamic invocation
It's not just about the dynamic invocation. Sure it's a bit slower but not a huge deal.
It's mostly that to get to that invocation you need to first allocate a duplicate string.
The ideal API would allow to pass a char* to avoid all this garbage.
For context our app loads a lot of static data from flat files (json / yaml / messagepack) for a total of over 5M objects (~25% of the allocations during boot). 80% of that ends up deduplicated later on by `String#-@`.
I believe that if json / psych / messagepack had access to `rb_fstring_cstr`, I could avoid allocating all these useless objects and save a lot of GC time (~30% of our boot time is spent in GC, 25% marking and 5% sweeping).
----------------------------------------
Feature #16029: Expose fstring related APIs to C-extensions
https://bugs.ruby-lang.org/issues/16029#change-84271
* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
As discussed with @tenderlove here: https://github.com/ruby/ruby/pull/2287#issuecomment-513865160
We'd like to update various data format parsers (JSON, MessagePack, etc) to add the possibility to deduplicate strings while parsing.
But unfortunately the `rb_fstring_*` family of functions isn't available to C-extensions, so the only available fallback is `rb_funcall(str, rb_intern("-@"))` which most parsers will likely consider too slow. So the various `rb_fstring_*` functions would need to be public.
Proposed patch: https://github.com/ruby/ruby/pull/2299
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>