[#100689] [Ruby master Feature#17303] Make webrick to bundled gems or remove from stdlib — hsbt@...
Issue #17303 has been reported by hsbt (Hiroshi SHIBATA).
11 messages
2020/11/02
[#100852] [Ruby master Feature#17326] Add Kernel#must! to the standard library — zimmerman.jake@...
Issue #17326 has been reported by jez (Jake Zimmerman).
24 messages
2020/11/14
[#100930] [Ruby master Feature#17333] Enumerable#many? — masafumi.o1988@...
Issue #17333 has been reported by okuramasafumi (Masafumi OKURA).
10 messages
2020/11/18
[#101071] [Ruby master Feature#17342] Hash#fetch_set — hunter_spawn@...
Issue #17342 has been reported by MaxLap (Maxime Lapointe).
26 messages
2020/11/25
[ruby-core:101102] [Ruby master Feature#13381] [PATCH] Expose rb_fstring and its family to C extensions
From:
jean.boussier@...
Date:
2020-11-26 17:44:42 UTC
List:
ruby-core #101102
Issue #13381 has been updated by byroot (Jean Boussier).
> It sounds like that fstring doesn't match that purpose.
I'm not sure why it wouldn't. Ultimately the prupose is the same than `String#-@`, but from the C API and by passing a `char *`.
> Is it really better to divert fstring than separated string pools?
It would be way less efficient, consider the following case:
```ruby
objects = JSON.load_file('path/to.json') # [{"field": 1}, {"field": 2}, ...]
objects.map { |o| o['field'] }
```
Here `some_field` since it is a literal is part of the fstring table. As of Ruby 2.7 the `json` extension has to `rb_str_new()` many times, before calling `hash_aset` which will then deduplicate these strings.
In some use cases like ours, this generates a huge amount of GC pressure that could be avoided if the `json` extension (and some others) could directly lookup interned strings from a `char` pointer.
----------------------------------------
Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions
https://bugs.ruby-lang.org/issues/13381#change-88777
* Author: eagletmt (Kohei Suzuki)
* Status: Closed
* Priority: Normal
----------------------------------------
https://github.com/ruby/ruby/pull/1559
Currently, C extensions cannot use fstrings. I'd like to use
`rb_fstring_cstr` instead of `rb_str_new_cstr` for static strings in C
extensions to avoid excess allocation.
I think there's several use cases.
- https://github.com/k0kubun/hamlit/blob/v2.8.0/ext/hamlit/hamlit.c#L508-L512
- https://bitbucket.org/ged/ruby-pg/src/e5eb92cca97abc0c6fc168acfad993c2ad314589/ext/pg_connection.c?at=v0.20.0&fileviewer=file-view-default#pg_connection.c-3679
- https://bitbucket.org/ged/ruby-pg/src/e5eb92cca97abc0c6fc168acfad993c2ad314589/ext/pg_copy_coder.c?at=v0.20.0&fileviewer=file-view-default#pg_copy_coder.c-38
--
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>