• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

anti-patterns

A repo to backup the assertions in my PyCon 2022 talk

Usage

$ pip install -r requirements.txt
$ richbench .

Results

                                                   Anti-Pattern Benchmark Suite, repeat=5, number=5                                                   
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Pattern โ”ƒ                                         Benchmark โ”ƒ  โ”ƒ Min     โ”ƒ Max     โ”ƒ Mean    โ”ƒ Min (+)         โ”ƒ Max (+)         โ”ƒ Mean (+)        โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚       1 โ”‚                               Copy slice to Local โ”‚  โ”‚ 0.200   โ”‚ 0.230   โ”‚ 0.209   โ”‚ 0.132 (33.8%)   โ”‚ 0.224 (2.7%)    โ”‚ 0.156 (25.4%)   โ”‚
โ”‚       2 โ”‚                                Copy name to Local โ”‚  โ”‚ 0.117   โ”‚ 0.130   โ”‚ 0.122   โ”‚ 0.084 (28.3%)   โ”‚ 0.089 (31.5%)   โ”‚ 0.086 (29.6%)   โ”‚
โ”‚       3 โ”‚                           Copy dict item to Local โ”‚  โ”‚ 0.184   โ”‚ 0.257   โ”‚ 0.219   โ”‚ 0.085 (53.9%)   โ”‚ 0.092 (64.1%)   โ”‚ 0.088 (59.7%)   โ”‚
โ”‚       4 โ”‚                          Copy class attr to Local โ”‚  โ”‚ 0.146   โ”‚ 0.149   โ”‚ 0.148   โ”‚ 0.058 (60.0%)   โ”‚ 0.060 (59.7%)   โ”‚ 0.059 (59.9%)   โ”‚
โ”‚       5 โ”‚      Importing specific name instead of namespace โ”‚  โ”‚ 0.000   โ”‚ 0.000   โ”‚ 0.000   โ”‚ 0.000 (2.9%)    โ”‚ 0.000 (40.4%)   โ”‚ 0.000 (15.7%)   โ”‚
โ”‚       6 โ”‚          Slicing with memoryview instead of bytes โ”‚  โ”‚ 0.001   โ”‚ 0.001   โ”‚ 0.001   โ”‚ 0.000 (40.0%)   โ”‚ 0.001 (23.0%)   โ”‚ 0.001 (34.9%)   โ”‚
โ”‚       7 โ”‚                   **Kwargs for known keyword args โ”‚  โ”‚ 0.000   โ”‚ 0.000   โ”‚ 0.000   โ”‚ 0.000 (38.1%)   โ”‚ 0.000 (29.9%)   โ”‚ 0.000 (35.2%)   โ”‚
โ”‚       8 โ”‚                                    Tiny Functions โ”‚  โ”‚ 0.000   โ”‚ 0.000   โ”‚ 0.000   โ”‚ 0.000 (60.7%)   โ”‚ 0.000 (55.8%)   โ”‚ 0.000 (58.6%)   โ”‚
โ”‚       9 โ”‚                        Class instead of dataclass โ”‚  โ”‚ 0.548   โ”‚ 0.654   โ”‚ 0.596   โ”‚ 0.279 (49.0%)   โ”‚ 0.306 (53.1%)   โ”‚ 0.295 (50.4%)   โ”‚
โ”‚      10 โ”‚                   Namedtuple instead of dataclass โ”‚  โ”‚ 0.556   โ”‚ 0.648   โ”‚ 0.578   โ”‚ 0.394 (29.0%)   โ”‚ 0.539 (16.7%)   โ”‚ 0.432 (25.2%)   โ”‚
โ”‚      11 โ”‚                       class instead of namedtuple โ”‚  โ”‚ 0.433   โ”‚ 0.516   โ”‚ 0.465   โ”‚ 0.293 (32.3%)   โ”‚ 0.315 (39.0%)   โ”‚ 0.303 (34.9%)   โ”‚
โ”‚      12 โ”‚            namedtuple class instead of namedtuple โ”‚  โ”‚ 0.383   โ”‚ 0.392   โ”‚ 0.387   โ”‚ 0.395 (-3.2%)   โ”‚ 0.422 (-7.6%)   โ”‚ 0.405 (-4.8%)   โ”‚
โ”‚      13 โ”‚                             dict instead of class โ”‚  โ”‚ 0.288   โ”‚ 0.307   โ”‚ 0.294   โ”‚ 0.318 (-10.6%)  โ”‚ 0.375 (-22.1%)  โ”‚ 0.345 (-17.3%)  โ”‚
โ”‚      14 โ”‚                                  class with slots โ”‚  โ”‚ 0.327   โ”‚ 0.427   โ”‚ 0.360   โ”‚ 0.257 (21.4%)   โ”‚ 0.298 (30.3%)   โ”‚ 0.275 (23.7%)   โ”‚
โ”‚      15 โ”‚                              dataclass with slots โ”‚  โ”‚ 0.561   โ”‚ 0.611   โ”‚ 0.593   โ”‚ 0.523 (6.8%)    โ”‚ 0.588 (3.7%)    โ”‚ 0.552 (7.0%)    โ”‚
โ”‚      16 โ”‚ Using a list comprehension to filter another list โ”‚  โ”‚ 0.029   โ”‚ 0.030   โ”‚ 0.029   โ”‚ 0.022 (24.7%)   โ”‚ 0.025 (14.8%)   โ”‚ 0.023 (21.6%)   โ”‚
โ”‚      17 โ”‚            Refactoring Try..except outside a loop โ”‚  โ”‚ 0.020   โ”‚ 0.020   โ”‚ 0.020   โ”‚ 0.018 (11.0%)   โ”‚ 0.019 (8.4%)    โ”‚ 0.018 (10.6%)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

More Repositories

1

vscode-pets

Adds playful pets ๐Ÿฆ€๐Ÿฑ๐Ÿถ in your VS Code window
TypeScript
1,553
star
2

wily

A Python application for tracking, reporting on timing and complexity in Python code
Python
1,205
star
3

mocker

A Docker-type runtime, written in 100% Python
Python
794
star
4

perflint

Python Linter for performance anti patterns
Python
582
star
5

pycharm-security

Finds security holes in your Python projects from PyCharm and GitHub
Kotlin
312
star
6

cpython-book-samples

Sample scripts and examples for my CPython Internals book
Python
180
star
7

instaviz

Instant visualization of Python AST and Code Objects
JavaScript
107
star
8

rich-bench

A little benchmarking tool for Python
Python
100
star
9

retox

For running a local continuous testing environment with tox
Python
76
star
10

ants-azure-demos

Collection of PoCs and Azure Demos
Python
49
star
11

python-assembly-poc

Python
46
star
12

requests-staticmock

A test utility for mocking out requests host from a fixtures directory
Python
42
star
13

django-xss-fuzzer

An XSS fuzzer for Django
Python
38
star
14

workday

A Python client for workday.com
Python
37
star
15

CSnakes

C#
37
star
16

azure-pipelines-python-examples

Example configurations for Azure Build Pipelines for Python
Python
36
star
17

hathi

A dictionary attack tool for PostgreSQL and MSSQL
Python
33
star
18

pep-explorer

An easy to use online explorer for Python Enhancement Proposals
HTML
33
star
19

notations

Estimating Big-O notations for a given function in Python
Python
24
star
20

django-on-azure

Resources for my Django on Azure workshop at PyCon US 2021
CSS
19
star
21

ServiceNowHackathon2016

Sydney Hackathon with ServiceNow March 2016- Slack and ServiceNow
JavaScript
19
star
22

tonybaloney.github.io

HTML
19
star
23

wntf

An anti-recommendation algorithm for twitter
Python
17
star
24

pyucwa

Python client for the Skype for Business (Lync) UCWA 2.0 API
Python
17
star
25

django-on-azure-demo

Tutorial for running Django on Azure
Python
16
star
26

dependabot-bot

Python
15
star
27

sciencelogic

A ScienceLogic EM7 API client for Python
Python
15
star
28

readysalted

An Internet of Things toolkit for SaltStack
C++
14
star
29

hubot-spark

A hubot integration for Cisco Spark
CoffeeScript
14
star
30

dissy

A TUI disassembler
Python
14
star
31

pyinline

Python
13
star
32

St2Client

A StackStorm API client for C#.NET including a PowerShell module
C#
13
star
33

python-railroads

A script to generate railroad diagrams for Python grammar
Python
13
star
34

tonybaloney

12
star
35

netimages

tool for sniffing images over HTTP traffic and showing them on the console. Designed for remote shells.
Python
12
star
36

bad-security-practices

Python
11
star
37

performance_testing

Results from a performance test for Python runtimes
HTML
9
star
38

try-pyjion

JavaScript
8
star
39

confluence-to-powerpoint

Python
8
star
40

generic_demos

Python
7
star
41

python-3.11-demos

Python
6
star
42

libcloud.extra

Some extra packs and examples for libcloud integration with StackStorm
Python
6
star
43

python-task-provider

TypeScript
5
star
44

pluralsight

Python
5
star
45

markdownlint-rule-titlecase

Custom title case rule for markdownlint headers
JavaScript
4
star
46

wily-pycharm

Code Complexity Plugin for PyCharm and IntelliJ-based IDEs
Kotlin
4
star
47

multicloud

Python
4
star
48

pytest-freethreaded

Python
4
star
49

pyrower

A Python Rowing Machine
Python
3
star
50

django-cosmos

A Cosmos DB driver for Django
Python
3
star
51

vs-test-detail

An NUnit extension for Azure DevOps
TypeScript
3
star
52

Cloud-auto-scaling

Provides auto-scaling capabilities to a group of Virtual Servers via SNMP, currently works with Abiquo
PHP
3
star
53

python-for-csharp-java-devs

2
star
54

pywinexe

Python bindings for winexe
Python
2
star
55

rightscale-agent-libcloud

Python
2
star
56

pathgather

Python client for Pathgather API
Python
2
star
57

pyjion-home

The website for www.trypyjion.com
CSS
2
star
58

tox-nuitka

A tox plugin for executing via nuitka
Python
2
star
59

cpython-clion-demo

Demo of debugging CPython from CLion
C
2
star
60

simple-flask-azd

A tiny template for Azure Developer CLI with Flask running in App Service
Bicep
1
star
61

email-toolbox

Python
1
star
62

panic_room

Python
1
star
63

pysaba

Python
1
star
64

cisco-spark-async-bot

A Python Asynchronous Bot for Cisco Spark API
Python
1
star
65

hubot-servicenow

JavaScript
1
star
66

ants-vscode-session

Jupyter Notebook
1
star
67

Abiquo-Backup

Backup Virtual Machines in an Abiquo Cloud
PHP
1
star
68

cognitive-kitchen-sink

SCSS
1
star
69

No-More-Spreadsheets

A web based service catalogue and pricing tool for products and services.
ASP
1
star
70

PHPVarnish

PHP Class for Varnish Management CLI
PHP
1
star
71

pycharm-webinar

Demo project for PyCharm webinar
Python
1
star
72

pyupgradesim

CSS
1
star