https://github.com/vedro-universe/vedro-import-profiler
Import profiler for Vedro framework
https://github.com/vedro-universe/vedro-import-profiler
vedro vedro-plugin
Last synced: 12 months ago
JSON representation
Import profiler for Vedro framework
- Host: GitHub
- URL: https://github.com/vedro-universe/vedro-import-profiler
- Owner: vedro-universe
- License: apache-2.0
- Created: 2024-02-24T16:25:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-11T15:17:39.000Z (about 2 years ago)
- Last Synced: 2025-05-17T11:37:22.018Z (about 1 year ago)
- Topics: vedro, vedro-plugin
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vedro Import Profiler
Vedro Import Profiler allows you to profile your imports in [Vedro](https://vedro.io) projects, helping you identify and optimize import statements for better performance.
## Installation
To get started, you first need to install the [vedro-import-profiler](https://pypi.org/project/vedro-import-profiler/) plugin. Open your terminal and run the following command:
```shell
$ pip install vedro-import-profiler
```
## Enabling the Plugin Temporarily
Once installed, you can temporarily enable the Vedro Import Profiler for your current session. Additionally, you may need to disable the `assert_rewriter` plugin to avoid conflicts. Run these commands in your terminal:
```shell
$ vedro plugins enable vedro-import-profiler
$ vedro plugins disable vedro.plugins.assert_rewriter
```
## Running the Profiler
To run the profiler and generate a log of your import times, use the command below. Make sure to prepend `PYTHONPROFILEIMPORTTIME=yes` to capture the necessary data:
```shell
$ PYTHONPROFILEIMPORTTIME=yes vedro run --vedro-import-profiler 2> import.log
```
## Visualizing Import Times
After running the profiler, you can visualize the import times using the [tuna](https://github.com/nschloe/tuna) viewer. Tuna provides an intuitive interface for analyzing the performance of your imports. To use Tuna with your generated log file, execute the following command:
```shell
$ tuna import.log
```