Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Add an option for skipping first call of a function #143

Open
timabbott opened this issue Mar 17, 2019 · 0 comments
Open

Add an option for skipping first call of a function #143

timabbott opened this issue Mar 17, 2019 · 0 comments

Comments

@timabbott
Copy link

A common situation when profiling is that a piece of code has a high first-call cost (e.g. the first call will do some expensive initialization), but future calls to the piece of code will be fast because they can reuse that initialization. It'd be awesome if there were a way to pass an argument to LineProfiler to skip the first run of a given function for the purposes of the statistics. E.g. syntax like this:

import line_profiler                                                                                                                        
profile = line_profiler.LineProfiler()                                                                                                      
                                                                                                                                            
@profile(skip_first_call=True)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant