![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A small utility library that wraps cProfile and makes it easy to debug performance problems in your Python code.
A small python package that wraps Python's own cProfile
library to make it more user friendly.
When developing Python programs, you'll sometimes have functions that take a long time to execute and you are really not sure why. Profiling helps to find and analyze these bottlenecks and guides you into fixing performance problems. Uses snakeviz for interactive visualizations.
Install it with pip install profiling-helpers
.
Visualize profile files with snakeviz profile_xyz.prof
.
There are two decorators, time_it
and profile_it
. Use them anywhere in your code, like this:
from profiling_helpers import time_it, profile_it
from time import sleep
@time_it
def my_slow_function(x):
sleep(10)
return x
my_slow_function(42) # Prints: Function "my_slow_function" took 10.01061 s to run
@profile_it("my/profile/save/dir", open_visualization=True)
def my_slow_function(x):
sleep(10)
return x
my_slow_function(42) # Opens snakeviz after this function is completed
Profiles are normally saved on the local file system. If you have other save targets, you can
either use included FileSavers (currently only for AWS S3) or implement your own one by inheriting
from the BaseFileSaver
class. Here is a variant with S3:
from profiling_helpers import profile_it, S3FileSaver
@profile_it(S3FileSaver("s3://my-bucket/my/path/to/profiles/", kms_key_id="..."))
def my_slow_function(x):
sleep(10)
return x
my_slow_function(42)
FAQs
A small utility library that wraps cProfile and makes it easy to debug performance problems in your Python code.
We found that profiling-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.