Files
Nobuyoshi Nakada 74856fbfb6 Use identity sets to track unspecified keyword arguments
Keyword tracking only needs membership, so replace identity hashes
with identity sets to avoid storing unused values.  Add `rb_set_p`
for the type assertion in `vm_check_keyword`.

Add benchmarks for 31, 32 and 128 keyword parameters with sparse and
dense dynamic defaults, using both direct keywords and keyword splats.
The 31-parameter cases provide a bitmask-only control.

Local arm64 macOS measurements show about 16-26% higher throughput
with many omitted dynamic defaults at 32 and 128 parameters.  Smaller
differences remain noisy, including in the bitmask-only controls.

The tracking container is created at call time, leaving IBF and
`ISeq#to_a` unchanged.  Verify IBF-loaded calls with the Integer
refinement and colliding keyword indices from [Bug #22335].
2026-09-23 21:36:41 +09:00

21 lines
796 B
C

#ifndef INTERNAL_SET_H /*-*-C-*-vi:se ft=c:*/
#define INTERNAL_SET_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @brief Internal header for Set.
*/
#include "ruby/internal/config.h"
#include "ruby/ruby.h"
VALUE rb_ident_set_new(void);
bool rb_set_add_no_check(VALUE set, VALUE element);
bool rb_set_delete_no_check(VALUE set, VALUE element);
VALUE rb_set_to_a(VALUE set);
bool rb_set_p(VALUE set);
#endif /* INTERNAL_SET_H */