Giter Site home page Giter Site logo

hexstream / trivial-jumptables Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 36 KB

Provides efficient O(1) jumptables on supported Common Lisp implementations and falls back to O(log(n)) on others.

Home Page: https://www.hexstreamsoft.com/libraries/trivial-jumptables/

License: The Unlicense

Common Lisp 100.00%
common-lisp library public-domain macro

trivial-jumptables's Introduction

Project's home: https://www.hexstreamsoft.com/libraries/trivial-jumptables/


trivial-jumptables provides efficient O(1) jump tables on supported
Common Lisp implementations and falls back to O(log(n)) on others.

Important optimizations are performed even on unsupported implementations,
notably "vectorization" which allows O(1) dispatch if all cases are constant.


This library is in the Public Domain.
See the UNLICENSE file for details.

trivial-jumptables's People

Contributors

hexstream avatar

Stargazers

YoungChief avatar  avatar  avatar  avatar Johannes Martinez Calzada avatar Svante avatar Alexander Gutev avatar

Watchers

 avatar James Cloos avatar  avatar

trivial-jumptables's Issues

Standard optimization: O(1) dispatch using simple-vector when all branches are constants

If all branches can be determined to be constants at compile-time, then we can just eval all of them into a static simple-vector at compile-time, thus getting O(1) dispatch on all implementations.

There should also be a way to use a similar strategy if not all the branches are constant, but a certain threshold of the branches are (75%?). In that case, we do the O(1) dispatch into the simple-vector, and we get a distinguished value (e.g. a special private symbol) if that branch is not a constant, and then we proceed to distinguish among the non-constant cases with the main strategy.

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.