# PyCall minimal overhead

**URL:** <https://discourse.julialang.org/t/pycall-minimal-overhead/41127>\
**Category:** Performance\
**Created:** [June 10, 2020, 2:03pm UTC](https://discourse.julialang.org/t/pycall-minimal-overhead/41127 "2020-06-10T14:03:38Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [June 8, 2023, 7:02pm UTC](https://discourse.julialang.org/t/pycall-minimal-overhead/41127/15 "2023-06-08T19:02:34Z")

</div>

> [@filchristou](#):
>
> Would it be possible to directly call `timeit` from inside julia ?

Sorry for unearthing this thread but I have a related question for PythonCall

@filchristou do you have the answer to your question by now?

> [@Minimizing PythonCall overhead with BenchmarkTools](https://discourse.julialang.org/t/minimizing-pythoncall-overhead-with-benchmarktools/100067):
>
> Hi there! I’m generating benchmarks with BenchmarkTools.jl, where a Python package is called with PythonCall.jl. My question is the following: how can I minimize the overhead of calling a method meth from a Python object obj? Which of these options is the most efficient, or have I perhaps missed a better one? Should I just time from within Python? using BenchmarkTools, PythonCall # define obj and x @btime $(obj).meth($x) @btime $(obj.meth)($x) @btime pycall($(obj).meth, $x) @btime pycall($(ob…

---

_[View the full topic](https://discourse.julialang.org/t/pycall-minimal-overhead/41127)._
