I know Odoo from version 15 has implemented profiling from the UI. is there any way to use profiling on the functions with @profile decorator?
This question has been flagged
1
Reply
983
Views
Hi,
You can use `import cProfile` to import cProfile tool and then
def you_func(self):
pr = cProfile.Profile()
pr.enable()
# you logic
pr.disable()
pr.print_stats(sort='ncalls')
Now in your Run window you can see the stats and profile your function. You can use the `sort` parameter to sort your result.
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up