4 def initialize(max_size)
9 # Push a value onto the Timeline
11 # Implementation explanation:
12 # A performance optimization appears here to speed up the push time.
13 # In essence, the code does this:
17 # shift if size > @max_size
20 # But that's super slow due to the shift, so we resort to reverse! and pop
21 # which gives us a 2x speedup with 100 elements and a 6x speedup with 1000
23 if (size + 1) > @max_size