diff --git a/Generators/people.py b/Generators/people.py index ad3317da6..2b8f568b0 100644 --- a/Generators/people.py +++ b/Generators/people.py @@ -1,4 +1,5 @@ import mem_profile +import memory_profiler import random import time @@ -7,6 +8,7 @@ print 'Memory (Before): {}Mb'.format(mem_profile.memory_usage_psutil()) +@memory_profiler.profile(precision=2) def people_list(num_people): result = [] for i in xrange(num_people): @@ -18,6 +20,7 @@ def people_list(num_people): result.append(person) return result +@memory_profiler.profile(precision=2) def people_generator(num_people): for i in xrange(num_people): person = { @@ -36,4 +39,4 @@ def people_generator(num_people): t2 = time.clock() print 'Memory (After) : {}Mb'.format(mem_profile.memory_usage_psutil()) -print 'Took {} Seconds'.format(t2-t1) \ No newline at end of file +print 'Took {} Seconds'.format(t2-t1)