Skip to content

bpo-40669: Make memory_profiler optional for running PEG benchmarks - #20172

Closed
lysnikolaou wants to merge 1 commit into
python:masterfrom
lysnikolaou:benchmarks
Closed

bpo-40669: Make memory_profiler optional for running PEG benchmarks#20172
lysnikolaou wants to merge 1 commit into
python:masterfrom
lysnikolaou:benchmarks

Conversation

@lysnikolaou

@lysnikolaoulysnikolaou commented May 18, 2020

Copy link
Copy Markdown
Member


def benchmark(func):
def wrapper(*args):
print(f"{func.__name__}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just ran into a situation where this was quite confusing. make time_compile prints time_compile here. But make time_stdlib_compilealso prints time_compile here. Maybe the printing should happen at an earlier point and it should print more info about the parameters to the program?

print(f"\tMemory: {max(memory)} MiB on an average of 3 runs")
if MEMORY_BENCHMARKS:
memory = memory_profiler.memory_usage((func, args))
print(f"\tMemory: {max(memory)} MiB on an average of 3 runs")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an else: that prints one line of instructions on how to install memory_profiler.

@lysnikolaou

Copy link
Copy Markdown
MemberAuthor

Superseded by #20183.

@lysnikolaou
lysnikolaou deleted the benchmarks branch May 18, 2020 15:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@lysnikolaou@gvanrossum@the-knights-who-say-ni@bedevere-bot