Counts objects for each T_IMEMO
type.
This method is only for MRI developers interested in performance and memory usage of Ruby programs.
It returns a hash as:
{:imemo_ifunc=>8, :imemo_svar=>7, :imemo_cref=>509, :imemo_memo=>1, :imemo_throw_data=>1}
If the optional argument, result_hash, is given, it is overwritten and returned. This is intended to avoid probe effect.
The contents of the returned hash is implementation specific and may change in the future.
In this version, keys are symbol objects.
This method is only expected to work with C Ruby.
Add the –prerelease option to the option parser.
Marshal
dumps exit locations to the given filename.
Usage:
If ‘–yjit-exit-locations` is passed, a file named “yjit_exit_locations.dump” will automatically be generated.
If you want to collect traces manually, call ‘dump_exit_locations` directly.
Note that calling this in a script will generate stats after the dump is created, so the stats data may include exits from the dump itself.
In a script call:
at_exit do RubyVM::YJIT.dump_exit_locations("my_file.dump") end
Then run the file with the following options:
ruby --yjit --yjit-trace-exits test.rb
Once the code is done running, use Stackprof to read the dump file. See Stackprof documentation for options.
Like Enumerable#map
, but chains operation to be lazy-evaluated.
(1..Float::INFINITY).lazy.map {|i| i**2 } #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map> (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3) #=> [1, 4, 9]
Like Enumerable#select
, but chains operation to be lazy-evaluated.
Returns the canceled status.
Selects specified components from URI
.
require 'uri' uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx') uri.select(:userinfo, :host, :path) # => ["myuser:mypass", "my.example.com", "/test.rbx"]
If a block is provided, returns a new array containing [key, value] pairs for which the block returns true.
Otherwise, same as values_at