From: Eric Wong <bofh@yhbt.net>
To: raindrops-public@yhbt.net
Subject: [PATCH 1/2] linux_inet_diag: remove needless OBJ_FREEZE calls
Date: Sun, 24 Mar 2024 00:19:17 +0000 [thread overview]
Message-ID: <20240324001918.1644612-2-bofh@yhbt.net> (raw)
In-Reply-To: <20240324001918.1644612-1-bofh@yhbt.net>
OBJ_FREEZE before calling rb_hash_aset was actually preventing
deduplication since Ruby 2.6. This introduces a performance
regression for Ruby 2.5 users, but I expect the majority of
users are on newer versions (I'm on 2.7, which is still ancient).
---
ext/raindrops/linux_inet_diag.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c
index e4050cb..799b4da 100644
--- a/ext/raindrops/linux_inet_diag.c
+++ b/ext/raindrops/linux_inet_diag.c
@@ -159,7 +159,6 @@ static int st_to_hash(st_data_t key, st_data_t value, VALUE hash)
VALUE k = remove_scope_id((const char *)key);
VALUE v = rb_listen_stats(stats);
- OBJ_FREEZE(k);
rb_hash_aset(hash, k, v);
}
return st_free_data(key, value, 0);
@@ -174,7 +173,6 @@ static int st_AND_hash(st_data_t key, st_data_t value, VALUE hash)
if (rb_hash_lookup(hash, k) == Qtrue) {
VALUE v = rb_listen_stats(stats);
- OBJ_FREEZE(k);
rb_hash_aset(hash, k, v);
}
}
next prev parent reply other threads:[~2024-03-24 0:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-24 0:19 [PATCH 0/2] drop ruby/st.h usage in favor of khashl Eric Wong
2024-03-24 0:19 ` Eric Wong [this message]
2024-03-24 0:19 ` [PATCH 2/2] use switch to khashl for hash table outside of GVL Eric Wong
2024-03-24 21:10 ` [PATCH 3/2] khashl: use ruby_xrealloc2 to avoid overflow Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/raindrops/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240324001918.1644612-2-bofh@yhbt.net \
--to=bofh@yhbt.net \
--cc=raindrops-public@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/raindrops.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).