[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-15 Thread Zoffix Znet via RT
Well, as long as it benefits the "very fucking close", amirite? Take care of the conch.

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-15 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Well, the title says “Enum.succ and Enum.pred are O(n)” and the issue is still there, so this ticket is definitely not resolved. If anything, it was rejected. However, the reasoning for keeping O(n) kinda contradicts itself. If we're trading RAM for performance, and the amount of elements in

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-15 Thread Zoffix Znet via RT
On Thu, 14 Sep 2017 18:03:16 -0700, alex.jakime...@gmail.com wrote: > Actually, another direct implication of using .first is this: > > Code: > enum Animal (Cat => 0, Dog => 0, Human => 42); > say Dog.succ > > Result: > Dog > > > So it's not just the algorithmic complexity, and we need a test

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-15 Thread Zoffix Znet via RT
On Thu, 14 Sep 2017 18:03:16 -0700, alex.jakime...@gmail.com wrote: > Actually, another direct implication of using .first is this: > > Code: > enum Animal (Cat => 0, Dog => 0, Human => 42); > say Dog.succ > > Result: > Dog > > > So it's not just the algorithmic complexity, and we need a test

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-15 Thread Zoffix Znet via RT
On Thu, 14 Sep 2017 17:47:59 -0700, alex.jakime...@gmail.com wrote: > but I guess it is possible to store the index of the current enum value and > simply increment/decrement it when needed. That's trading more RAM for performance increase that's likely inconsequential in nearly all use cases.

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-15 Thread Zoffix Znet via RT
On Thu, 14 Sep 2017 17:47:59 -0700, alex.jakime...@gmail.com wrote: > but I guess it is possible to store the index of the current enum value and > simply increment/decrement it when needed. That's trading more RAM for performance increase that's likely inconsequential in nearly all use cases.

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-14 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Actually, another direct implication of using .first is this: Code: enum Animal (Cat => 0, Dog => 0, Human => 42); say Dog.succ Result: Dog So it's not just the algorithmic complexity, and we need a test for that. On 2017-09-14 17:47:59, alex.jakime...@gmail.com wrote: > Source code: >

[perl #132093] Enum.succ and Enum.pred are O(n)

2017-09-14 Thread via RT
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev # Please include the string: [perl #132093] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=132093 > Source code: