Skip to content

export function name and time to run#32

Open
Luis-Leao-rbcx wants to merge 3 commits into
MuddyHope:contributing_prfrom
Luis-Leao-rbcx:exporter
Open

export function name and time to run#32
Luis-Leao-rbcx wants to merge 3 commits into
MuddyHope:contributing_prfrom
Luis-Leao-rbcx:exporter

Conversation

@Luis-Leao-rbcx

Copy link
Copy Markdown

Like you asked "Instead of this, can you implement a built-in exporter that shows the function name and the time it takes for it to be executed?"

Note: I have idea why contributing.md shows changes, i didnt touch it.

MuddyHope and others added 3 commits June 13, 2025 06:21
… basically the same but the v2 the csv and json files are not deleted so we can inspect them
the performace exporter will print the function name and the time it takes for it to be executed.

@MuddyHope MuddyHope left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you pull the latest main ?
Also do look at one

assert output.startswith("Function 'dummy_function' executed in ")

# Extract the ms part and check it's within reasonable range
match = re.search(r'executed in ([\d\.]+) ms', output)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Regex search becomes a costly operation.


class BuiltinPerformanceExporter:
def __init__(self, output_func=print):
self.output_func = output_func

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you implement something like this PR. #24

It has to be configurable via the main decorator.

@MuddyHope

Copy link
Copy Markdown
Owner

Hi @Luis-Leao-rbcx, are you still working on this?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants