Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add line profiler #5

Merged
merged 3 commits into from
Mar 24, 2024
Merged

Add line profiler #5

merged 3 commits into from
Mar 24, 2024

Conversation

healeycodes
Copy link
Owner

Add a new option to the CLI that provides a line profiler (kinda inspired by cProfile).

For now, just profile the calls.

Example:

$ python cli.py --profile fib.nd
                                      ncalls  tottime  percall
for (i = 0; i < 21; i = i + 1)
  # recursive (slow)
  fun fib(x)
    if (x == 0 or x == 1)
        return x;
    fi
    return fib(x - 1) + fib(x - 2);  x57270   11.2s    195µs
  nuf
  log(fib(i));                       x42      1.9s     46ms
rof

@healeycodes healeycodes merged commit a919855 into main Mar 24, 2024
1 check passed
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.

1 participant