Skip to content

Customizing line_profiler #188

Open
Open

Description

@jtlz2

I love the module and have been using it for years, for which many thanks.

A StackOverflow question appeared yesterday asking - wait for it - about type checking (32-bit vs 64-bit) for every function call. Here is the Q:

https://stackoverflow.com/questions/74516195/detecting-unexpected-type-conversion-in-python

I suggested line_profiler (or memory_profiler) might be hackable along the lines of https://stackoverflow.com/a/74517678/1021819

Do you have any advice on whether customizing line_profiler in this way would be feasible, and if so how one might go about it?

Thanks again!

Activity

  1. Erotemic commented on Nov 28, 2022

    @Erotemic
    Member

    Because this repo requires each function is manually registered to be profiled, I think this might not be a fit. However, there were discussions about automatically discovering and profiling all functions automatically, which is more aligned with what you need.

    See #21 and #24 I thought there was another where I discuss using code in xdoctest / mkinit to automatically enumerate items to profile, but I can't find it.

  2. ta946 commented on Dec 10, 2022

    @ta946

    i dont recommend following whats in issues #21 & #24. they are very hacky and inefficient.
    I've updated the code to use AST which is alot more reliable. you can follow the changes i made in my fork under autoprofile branch and use it as a stepping stone to get what you want as I don't plan on maintaining my fork and keeping it up to date.

    also @Erotemic you were looking for this discussion where you mentioned using xdoctest. And if you have some free time i've responded in there that my autoprofiler is close to completion :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions