https://github.com/danielmorell/flask-rollbar-profile
https://github.com/danielmorell/flask-rollbar-profile
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/danielmorell/flask-rollbar-profile
- Owner: danielmorell
- Created: 2023-03-09T13:05:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-09T13:06:29.000Z (over 3 years ago)
- Last Synced: 2025-02-23T11:42:46.303Z (over 1 year ago)
- Language: Python
- Size: 743 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test Rollbar Profiling Flask App
This is a simple Flask app that helps profile Rollbar's Python SDK.
## Setup
1. Clone this repo.
2. Create a virtualenv ` -m virtualenv venv`.
3. Activate the virtualenv `source venv/bin/activate`.
4. Create a virtualenv and install the requirements with `pip install -r requirements.txt`.
5. Start the app with `flask run`.
6. Run multiple profiles by executing `test.sh`.
7. View the results with `snakeviz pstat/.prof`.
There are four extra wheels available:
```text
wheels
├── rollbar-0.16.4b0-py3-none-any.whl # The current version of the SDK
├── rollbar-batched-literals.whl # The SDK with batched-transform and literals
├── rollbar-batched-transform.whl # The SDK with batched-transform
└── rollbar-literals.whl # The current version of the SDK with just literals.
```
You can install an alternate version of the Rollbar SDK by running `pip install ./wheels/`.
## The Literals
The versions marked as literals use literal types instead of the type functions
for the `transform()` method in `rollbar/lib/traverse.py`. e.g.
```diff
- dict((k, traverse(v, key=key + (k,), **kw)) for k, v in iteritems(obj)),
+ {(k, traverse(v, key=key + (k,), **kw)) for k, v in iteritems(obj)},
```
Generally, using a literal type is faster than using the type function. However,
in this instance it appeared to be much faster than I expected. Probably because
we run through this code so many times.
I included a fresh set of profiles for each of these versions. The results are
in the `pstat` directory organized by the version of the SDK.