Guest User

Untitled

a guest
Feb 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. //run verb, give it its memory usage as it asks, be sure to wait 5 seconds from when it asks to when you enter the data. use process explorer for best results. Use dd -> ds, not direct ds run, re-launch dd between tests
  2.  
  3. #define SAMPLE_SIZE 1000000
  4. /client/verb/memorytest()
  5. var/startingmemory = input("memory usage (kb)") as num
  6. var/list/lists = new (SAMPLE_SIZE)
  7. var/listemptymemory = input("memory usage (kb)") as num
  8. for (var/i in 1 to lists.len)
  9. lists[i] = list()
  10. var/listfullmemory = input("memory usage (kb)") as num
  11. var/list/datums = new (SAMPLE_SIZE)
  12. var/datumemptymemory = input("memory usage(kb)") as num
  13. for (var/i in 1 to datums.len)
  14. datums[i] = new /datum()
  15. var/datumfullmemory = input("memory usage(kb)") as num
  16.  
  17. world << "Memory usage of list of lists with [num2text(SAMPLE_SIZE,99)] null values [num2text(listemptymemory - startingmemory, 99)]kb ([num2text((listemptymemory - startingmemory)/SAMPLE_SIZE*1024, 99)] bytes per unit)"
  18. world << "Memory usage of list of lists with [num2text(SAMPLE_SIZE,99)] list values [num2text(listfullmemory - listemptymemory, 99)]kb ([num2text((listfullmemory - listemptymemory)/SAMPLE_SIZE*1024, 99)] bytes per unit)"
  19. world << "Memory usage of list of datums with [num2text(SAMPLE_SIZE,99)] null values [num2text(datumemptymemory - listfullmemory, 99)]kb ([num2text((datumemptymemory - listfullmemory)/SAMPLE_SIZE*1024, 99)] bytes per unit)"
  20. world << "Memory usage of list of datums with [num2text(SAMPLE_SIZE,99)] datum values [num2text(datumfullmemory - datumemptymemory, 99)]kb ([num2text((datumfullmemory - datumemptymemory)/SAMPLE_SIZE*1024, 99)] bytes per unit)"
Add Comment
Please, Sign In to add comment