GithubHelp home page GithubHelp logo

fastercast's Introduction

fastercast

An attempt at making Python's typing.cast faster by writing in C.

Random Benchmark

Calculated by running python benchmark.py on Windows 10 (WSL). It's not comprehensive, but it shows potential:

Python3.9:

python version: 3.9
---- Testing with type: list[int] ----
typing.cast:     3.465584092999052
fastercast.cast: 1.9172640960023273
no cast:         1.4130047959988588

---- Testing with type: <class 'list'> ----
typing.cast:     3.4464493919986126
fastercast.cast: 1.9092626999990898
no cast:         1.4313703090010677

---- Testing with type: 'list' ----
typing.cast:     3.424010521001037
fastercast.cast: 1.9051031120034168
no cast:         1.463806901996577

Python3.12:

python version: 3.12
---- Testing with type: list[int] ----
typing.cast:     2.0208555909994175
fastercast.cast: 1.5888119939991157
no cast:         1.2391334939966328

---- Testing with type: <class 'list'> ----
typing.cast:     2.0552524880004057
fastercast.cast: 1.558741792003275
no cast:         1.2164903929988213

---- Testing with type: 'list' ----
typing.cast:     2.1068942889978644
fastercast.cast: 1.5963142889995652
no cast:         1.226719090998813

fastercast's People

Contributors

sachaa-thanasius avatar

Watchers

Lucian avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.