giner (Stanislav German-Evtushenko)
- Login: giner
- Registered on: 03/01/2023
- Last sign in: 05/28/2024
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 1 | 1 | 2 |
Activity
05/28/2024
-
03:25 AM Ruby Bug #20512 (Closed): Order of magnitude performance differenfce in single character slicing UTF-8 strings before and after length method is executed
- Slicing of a single character of UTF-8 string becomes ~15 times faster after method "length" is executed on the string.
```ruby
# Single byte symbols
letters = ("a".."z").to_a
length = 100000
str = length.times.map{letters[rand(...
03/07/2023
-
07:27 AM Ruby Bug #19470: Frequent small range-reads from and then writes to a large array are very slow
- > Perhaps we should make COW less hidden? Add something like Array#fresh_slice to opt into non-COW slicing when you know you're still mutating the original?
Sounds like a good compromise
03/01/2023
-
11:38 PM Ruby Bug #19470: Frequent small range-reads from and then writes to a large array are very slow
- > Do you have any evidence that this problem actually occurs frequently?
I cannot say whether this affects many projects. I've encountered this twice so far when optimizing code to reduce memory allocations (by writing to the same arr... -
05:36 AM Ruby Bug #19470 (Open): Frequent small range-reads from and then writes to a large array are very slow
- Write to a large array gets very slow when done after range-reading more than 3 items. In such case the original array gets marked as shared which triggers CoW on a small change afterwards. This leads to a significant performance impact ...