[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101180] Re: Spectre Mitigations
— Chris Seaton <chris@...>
2020/12/01
I wouldn’t recommend using Ruby to run in-process untrusted code in the first place. Are people doing that?
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 3.0.0. From 2015 we
4 messages
2020/12/25
[ruby-core:101347] [Ruby master Bug#17383] 3.0 recursion memory|speed issues
From:
marcandre-ruby-core@...
Date:
2020-12-09 17:41:48 UTC
List:
ruby-core #101347
Issue #17383 has been updated by marcandre (Marc-Andre Lafortune).
Thanks for reporting this.
Hopefully this related to #17373.
----------------------------------------
Bug #17383: 3.0 recursion memory|speed issues
https://bugs.ruby-lang.org/issues/17383#change-89050
* Author: jzakiya (Jabari Zakiya)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Testing 3.0.0-preview2 against 2.7.2 I see it's still not as performant to 2.7.2 for the following code.
Below is code from Rosettacode.org
https://rosettacode.org/wiki/Palindromic_gapful_numbers#Orders_of_Magnitude_Faster:_Direct_Generation_of_Numbers
This is run on an I7, 3.5GHz, 16GB, Linux 5.9.10 laptop.
Using rvm, 2.7.2 uses at max ~50% of memory worst case, but for 3.0.0pre2 it hits ~70%.
It's also faster on 2.7.2 than 3.0.0-pre2
```
class PalNo
def initialize(digit)
@digit, @l, @dd = digit, 3, 11*digit
end
def fN(n)
return [0,1,2,3,4,5,6,7,8,9] if n==1
return [0,11,22,33,44,55,66,77,88,99] if n==2
a=[]; [0,1,2,3,4,5,6,7,8,9].product(fN(n-2)).each{ |g| a << g[0]*10**(n-1)+g[0]+10*g[1] }; return a
end
def show(count, keep)
to_skip, palcnt, pals = count - keep, 0, []
while palcnt < count
fN(@l-2).each{ |g| pal=@digit*10**(@l-1)+@digit+10*g;
pals << pal if pal%(@dd)==0 && (palcnt += 1) > to_skip; break if palcnt - to_skip == keep }; @l+=1
end
print pals; puts
end
end
start = Time.now
(1..9).each { |digit| PalNo.new(digit).show(20, 20) }; puts "####"
(1..9).each { |digit| PalNo.new(digit).show(100, 15) }; puts "####"
(1..9).each { |digit| PalNo.new(digit).show(1000, 10) }; puts "####"
(1..9).each { |digit| PalNo.new(digit).show(100_000, 1) }; puts "####"
(1..9).each { |digit| PalNo.new(digit).show(1_000_000, 1) }; puts "####"
(1..9).each { |digit| PalNo.new(digit).show(10_000_000, 1) }; puts "####"
puts (Time.now - start)
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>