Skip to content

Instantly share code, notes, and snippets.

@debugger22
Last active August 29, 2015 14:23
Show Gist options
  • Save debugger22/45cb816867ad0938aee5 to your computer and use it in GitHub Desktop.
Save debugger22/45cb816867ad0938aee5 to your computer and use it in GitHub Desktop.
Time and memory consumption report

When Symbol is modified

Line #    Mem usage    Increment   Line Contents
================================================
     6     30.2 MiB      0.0 MiB   @profile
     7                             def mem_test():
     8     30.5 MiB      0.3 MiB       _syms = [Symbol('x_' + str(i), real=True, positive=True) for i in range(1, 101)]
     9     34.7 MiB      4.2 MiB       for i in _syms:
    10     34.7 MiB      0.0 MiB           assert ask(Q.positive(i)) is True

pyinstrument report: https://www.dropbox.com/s/ndujng8drhouj4v/sym_mod.html?dl=0

When ask handlers are modified

Line #    Mem usage    Increment   Line Contents
================================================
     6     30.2 MiB      0.0 MiB   @profile
     7                             def mem_test():
     8     30.4 MiB      0.2 MiB       _syms = [Symbol('x_' + str(i), real=True, positive=True) for i in range(1, 101)]
     9     31.5 MiB      1.1 MiB       for i in _syms:
    10     31.5 MiB      0.0 MiB           assert ask(Q.positive(i)) is True

pyinstrument report: https://www.dropbox.com/s/6823wp6iob4zjg5/ask_mod.html?dl=0

When satask handlers are modified

Line #    Mem usage    Increment   Line Contents
================================================
     6     30.2 MiB      0.0 MiB   @profile
     7                             def mem_test():
     8     30.4 MiB      0.2 MiB       _syms = [Symbol('x_' + str(i), real=True, positive=True) for i in range(1, 101)]
     9     41.1 MiB     10.7 MiB       for i in _syms:
    10     41.1 MiB      0.0 MiB           assert ask(Q.positive(i)) is True

pyinstrument report: https://www.dropbox.com/s/l6a0037m6rxj84v/satask_mod.html?dl=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment