[#114703] [Ruby master Bug#19875] Ruby 2.7 -> 3.1 Performance regression in String#count — "iz (Illia Zub) via ruby-core" <ruby-core@...>

Issue #19875 has been reported by iz (Illia Zub).

18 messages 2023/09/12

[#114774] [Ruby master Feature#19884] Make Safe Navigation Operator work on classes — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>

Issue #19884 has been reported by p8 (Petrik de Heus).

13 messages 2023/09/15

[#114796] [Ruby master Feature#19889] Let `Kernel.#require` search for files relative to the current working directory for non ./, ../ relative paths — "sawa (Tsuyoshi Sawada) via ruby-core" <ruby-core@...>

Issue #19889 has been reported by sawa (Tsuyoshi Sawada).

6 messages 2023/09/18

[#114803] [Ruby master Bug#19890] File#realine(chomp: true) slower/more allocations than readline.chomp! — "segiddins (Samuel Giddins) via ruby-core" <ruby-core@...>

Issue #19890 has been reported by segiddins (Samuel Giddins).

12 messages 2023/09/18

[#114817] [Ruby master Bug#19892] Build failure with 8f1b688177 — "vo.x (Vit Ondruch) via ruby-core" <ruby-core@...>

Issue #19892 has been reported by vo.x (Vit Ondruch).

8 messages 2023/09/19

[#114915] [Ruby master Feature#19905] Introduce `Queue#peek` — "hi@... (Joao Fernandes) via ruby-core" <ruby-core@...>

Issue #19905 has been reported by hi@joaofernandes.me (Joao Fernandes).

8 messages 2023/09/28

[ruby-core:114658] [Ruby master Bug#19857] Eval coverage is reset after each `eval`.

From: "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date: 2023-09-06 13:51:14 UTC
List: ruby-core #114658
Issue #19857 has been updated by mame (Yusuke Endoh).


> By the way, did you realise, eval coverage is already merged, if it's a subset of the eval'ed code?

Yes, I think that that is bad. I think I missed it because I didn't review https://github.com/ruby/ruby/pull/6396 enough. I want to limit it even from now.

I think "coverage for eval" feature was a good idea for measuring the coverage of Rails view code, but I would like to design it to the minimum necessary for that purpose. Currently, I think it is too flexible than I expected.

The design I am currently considering is as follows.

* If there are loaded and eval'ed codes with the same path, only the loaded code is measured
* If there are multiple codes eval'd with the same path, the first (or the last) eval'ed code is measured

I need to take time to understand and organize the current situation and carefully consider how it should be designed. However, I am not likely to be able to spend sufficient time to the coverage library for a while, so please wait.

BTW, I'm not keen on having `Coverage.start` have a new keyword argument for this purpose. Coverage library already has many different modes. I don't want to complicate things further. (This is mostly my fault, of course.)

----------------------------------------
Bug #19857: Eval coverage is reset after each `eval`.
https://bugs.ruby-lang.org/issues/19857#change-104488

* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED
----------------------------------------
It seems like `eval` based coverage is reset every time eval is invoked.

```ruby
#!/usr/bin/env ruby

require 'coverage'

def measure(flag)
  c = Class.new
  c.class_eval(<<~RUBY, "foo.rb", 1)
    def foo(flag)
      if flag
        puts "foo"
      else
        puts "bar"
      end
    end
  RUBY
  
  return c.new.foo(flag)
end

Coverage.start(lines: true, eval: true)

# Depending on the order of these two operations, different coverage is calculated, because the evaluation of the code is considered different, even if the content/path is the same.
measure(false)
measure(true)

p Coverage.result
```

Further investigation is required.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

In This Thread