small refactor

This commit is contained in:
Torsten 2019-08-01 09:20:08 +03:00
parent 6b1c316f04
commit 7daf015ed2
2 changed files with 6 additions and 7 deletions

View File

@ -50,16 +50,15 @@
# and rebuilt the reserve (get_next already instantiates the reserve)
#
def get_more
first_object = get_chain
link = first_object
self.reserve = get_chain
last_link = self.reserve
count = Factory.reserve_size
while(count > 0)
link = get_next_for(link)
last_link = get_next_for(last_link)
count -= 1
end
self.next_object = get_next_for(link)
set_next_for( link , nil )
self.reserve = first_object
self.next_object = get_next_for(last_link)
set_next_for( last_link , nil )
self
end

View File

@ -16,7 +16,7 @@ Also output was unbuffered, because that is what rubyx implements.
# Results
Results were measured by a ruby script. Mean and variance was measured until variance was low,
always under one percent. Noop showed that program startup is a factor, so all programs loop from 10 to 50k.
always under one percent. Noop showed that program startup is a factor, so all programs loop somewhere from 1M to 100, depending on how intensive.
The machine was a virtual arm (qemu) run on a acer swift 5 (i5 8265 3.9GHz), performance roughly equivalent to a raspberry pi.
Results (in ms) should be seen as relative, not absolute.