Skip to main content

Cython speedups for various parts of discord.py

Project description

discord-ext-speedups

Cython speedups for various parts of discord.py

Installation

pip install discord-ext-speedups

Usage

import discord
from discord.ext import speedups
speedups.install()

This monkeypatches all available C extensions into discord.py, replacing the existing ones. This is best done immediately after import discord. To only install specific patches, pass the names to install(). For more info, see the reference section below.

To revert patches, simply call speedups.uninstall() to restore all modules to normal. This function also takes specific module names as arguments. Note: You should probably avoid doing this while you're using the modules or objects this library alters.

Available patches

copus

Cython bindings for libopus. This was written as an experiment in cython and doesn't produce that much of a speedup. A benchmark indicated a 10% speedup of Encoder.encode(), but this also works out to a mere 0.5% of the total time window for this call (20ms/frame).

Reference

install(*install_modules, ignore=False)

Patches in replacement modules.

  • *install_modules (str)

    Module names to install. The list of available module names can be found above, or by calling get_available_patches().

  • ignore (bool)

    If True, install all available modules except the given modules.

Returns a list[str] of module names.

uninstall(*uninstall_modules, ignore=False)

Undo patching and restore the original modules.

  • *uninstall_modules (str)

    Modules names to uninstall. The list of installed module names can be found by calling get_installed_patches().

  • ignore (bool)

    If True, uninstall all available modules except the given modules.

get_available_patches()

Returns a tuple[str] of available module names.

get_installed_patches()

Returns a tuple[str] of installed module names.

Requirements

  • Python 3.6.4+
  • discord.py

Compiling from source requires:

  • cython 0.27.3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for discord-ext-speedups, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size discord_ext_speedups-0.0.1-cp36-cp36m-manylinux1_x86_64.whl (394.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp36-cp36m-manylinux2010_x86_64.whl (394.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp36-cp36m-win32.whl (164.8 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp36-cp36m-win_amd64.whl (215.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp37-cp37m-manylinux1_x86_64.whl (391.6 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp37-cp37m-manylinux2010_x86_64.whl (391.6 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp37-cp37m-win32.whl (164.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-cp37-cp37m-win_amd64.whl (215.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-py3.6-linux-x86_64.egg (206.7 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-py3.6-win32.egg (168.9 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-py3.6-win-amd64.egg (219.2 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-py3.7-linux-x86_64.egg (204.4 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-py3.7-win32.egg (168.9 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size discord_ext_speedups-0.0.1-py3.7-win-amd64.egg (219.4 kB) File type Egg Python version 3.7 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page