[#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:101763] [Ruby master Bug#17483] Array#insert is pathologically slow
From:
mame@...
Date:
2020-12-28 00:43:26 UTC
List:
ruby-core #101763
Issue #17483 has been updated by mame (Yusuke Endoh). Status changed from Open to Rejected In short, it is unavoidable. Currently, an array is internally represented as consecutive memory area. Adding new elements into the middle of an array requires reallocation of the array, which takes O(n). Therefore, calling Array#insert n times takes O(n^2 ). Theoretically, by replacing the internal data structure with a tree or somthing, the order can be improved to O(n log n), but it will make other (more commonly used) operations slow. ---------------------------------------- Bug #17483: Array#insert is pathologically slow https://bugs.ruby-lang.org/issues/17483#change-89589 * Author: djberg96 (Daniel Berger) * Status: Rejected * Priority: Normal * ruby -v: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- I ran some generic Array method benchmarks: https://github.com/djberg96/berger_spec/blob/ruby23/bench/core/bench_array.rb (comment out nitems first) https://github.com/djberg96/berger_spec/blob/ruby23/bench/core/Array/bench_insert.rb What I noticed is that all of these complete in a fraction of a second, except Array#insert, which takes about 6-8 seconds on my Mac desktop. Is this unavoidable? -- 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>