Benoit Daloze

Results 1300 comments of Benoit Daloze

> While the parallel assignment is fewer operations, it also introduces an intermediate array that requires an allocation: But only because the code you used is: ```ruby report = MemoryProfiler.report...

Quick numbers: ```ruby require 'benchmark/ips' def parallel _a, _b = 1, 2 # nil end def sequential _a = 1 _b = 2 # nil end Benchmark.ips do |x| x.report('Parallel...

And with MemoryProfiler: ``` $ ruby -rmemory_profiler -e 'MemoryProfiler.report { _a, _b = 1, 2 }.pretty_print' Total allocated: 40 bytes (1 objects) Total retained: 40 bytes (1 objects) ... $...

> This run actually has sequential being faster: I believe that's just noise or too small to matter. I ran it 3 times locally, and the first I got Sequential...

> In other cases, they are basically the same and it's only a syntactic/bytecode difference. To illustrate this point, we can use `ruby --dump=insns assign.rb` on the original benchmark: ```...

In FFI specs I just used a plain Ruby `if` because I find RSpec's `if:` impossible to understand and never doing what I want.

I wonder if https://github.com/enkessler/childprocess/issues/172 / https://github.com/enkessler/childprocess/pull/175 might solve this. At least `CHILDPROCESS_UNSET=should-be-unset bundle exec rake` passes for me on that PR with Ruby 3.0.0.

Confirmed that https://github.com/enkessler/childprocess/pull/175#issuecomment-779820190 actually fixes the CI on ruby-head (the only ruby-head CI failing is then due to installing FFI, which is unrelated and no longer needed with that PR).

TravisCI passes, except on JRuby: https://travis-ci.org/github/enkessler/childprocess/builds/759130946

TravisCI now passes with the latest JRuby, as good as master + actually it also works on ruby-head: https://travis-ci.org/github/enkessler/childprocess/builds/759183880 vs https://travis-ci.org/github/enkessler/childprocess/builds/759135035