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) # and rebuilt the reserve (get_next already instantiates the reserve)
# #
def get_more def get_more
first_object = get_chain self.reserve = get_chain
link = first_object last_link = self.reserve
count = Factory.reserve_size count = Factory.reserve_size
while(count > 0) while(count > 0)
link = get_next_for(link) last_link = get_next_for(last_link)
count -= 1 count -= 1
end end
self.next_object = get_next_for(link) self.next_object = get_next_for(last_link)
set_next_for( link , nil ) set_next_for( last_link , nil )
self.reserve = first_object
self self
end end

View File

@ -16,7 +16,7 @@ Also output was unbuffered, because that is what rubyx implements.
# Results # Results
Results were measured by a ruby script. Mean and variance was measured until variance was low, 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. 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. Results (in ms) should be seen as relative, not absolute.