Skip to content

Scalene - accumulative memory vs instant memory #265

Answered by emeryberger
sjvdm asked this question in Q&A
Discussion options

You must be logged in to vote

It's not currently possible in Scalene. Here's why. The only approach I am aware of is counting lines via https://docs.python.org/3/library/sys.html#sys.settrace. In my tests, this can slow down pure Python execution by almost 10x, which makes it a dealbreaker as a default. On the other hand, for programs like the one above that make extensive use of native modules like numpy and Pandas, the overhead is negligible, so it could be optionally activated.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sjvdm
Comment options

@emeryberger
Comment options

@emeryberger
Comment options

Answer selected by emeryberger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants