Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • array_create - use Array fill method to add array items with values from 0 to max_items
  • array_move - use Array insert(to, delete_at(from)) to move an item from the end of the filled array to the beginning (worst case scenario)
  • list_create - create a list header data structure and list item data structures with sample real world data using items[i]=item_info to add each item to the items array
  • list_move - use Array insert(to,delete_at(from)) to move an item from the end of the filled array to the beginning AND update prev and next links
  • list_find - use 0.upto(items.size-1) to check the value of items[i][:uri] to see if it matches the search value for uri - Test looks search for last item in list

Environments Environment for testing:

  • Laptop
    • RAM: 16 G  (approximately 4.5 G is allocated to other running programs prior to running tests)
    • Processor:  2.3 GHz quad core

Target production system:

  • DEV VM
    • RAM: 2 G  (approximately 0.6 G is allocated to other running programs prior to running tests)
    • Processor:  2.3 GHz dual core

Target production system:

  • RAM: 2-8 G
  • Processor: 2.3 GHz dual core

Test code:  https://gist.github.com/elrayle/f5f559f8c10243600dc6

 

Results:

Max Itemsarray_createarray_movelist_createlist_movelist_findComments
 LaptopDEV VMLaptopDEV VMLaptopDEV VMLaptopDEV VMLaptopDEV VM 
1,0000000000000 
10,0000000000000 
100,0000000000000 
500,0000000120000 
1,000,0000000450000 
2,000,000000011130000 
4,000,000000035OOM0 1  
8,000,0001100115 0 2  
10,000,0001100167 0 2  
20,000,0001200OOM      
40,000,0004400       
80,000,0006800       
100,000,00081111       

* Time measured in seconds

* OOM - Out of Memory

 

 

...

Use Cases:

Use Case: Fetch the first N items in the list and display to user; Fetch next N and display; Fetch prev N and display; Fetch page X and display

...