about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <bofh@yhbt.net>2024-03-24 00:19:17 +0000
committerEric Wong <bofh@yhbt.net>2024-03-25 21:19:06 +0000
commit6d5ba2a10884303dc52df2557a08f3a87d1299b1 (patch)
tree1ab28f9557f3f226e5a7b62d21f8e087ab7dd53a /ext
parenta36cf00dee5d7657bf95b66bd4559feaab010989 (diff)
downloadraindrops-6d5ba2a10884303dc52df2557a08f3a87d1299b1.tar.gz
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).
Diffstat (limited to 'ext')
-rw-r--r--ext/raindrops/linux_inet_diag.c2
1 files changed, 0 insertions, 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);
                 }
         }