Giter Club home page Giter Club logo

byte-set-rs's Introduction

Hey there! ๐Ÿ‘‹

I'm a software engineer and designer making a plethora of creative works.

byte-set-rs's People

Contributors

manishearth avatar nvzqz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

byte-set-rs's Issues

Add `const` range constructors for `ByteSet`

We should be able to create a ByteSet from a..b or a..=b where a and b are u8, and have it be usable in const.

The API should look like:

  • const fn from_range(range: std::ops::Range<u8>) -> ByteSet
  • const fn from_range_inclusive(range: std::ops::RangeInclusive<u8>) -> ByteSet

I expect this would be implemented via bit tricks over the integer chunk representation.

Comparison Benchmarks

There are comparison benchmarks between ByteSet and the following types:

  • [bool; 256]
  • BinaryHeap<u8>
  • BTreeSet<u8>
  • HashSet<u8>
  • InclusiveRange<u8>
  • Vec<u8>

What other types should be compared against?

Stable internal memory representation

Motivation

There are currently no guarantees about ByteSet's internal memory representation. Each byte should always map to a specific bit across compatible versions when targeting the same architecture.

This would enable the library to be ported to other languages (e.g. C, C++, D, Swift) and have the same instance be sent directly across each language.

Target-specific behavior

Properties that are allowed to change the representation are:

  • Endianness
  • Pointer width

This allows for various optimizations while still being consistent.

Use 64-bit chunks on specific 32-bit CPUs

ByteSet is composed of [u64; 4] or [u32; 8] depending on the target architecture (determined in build.rs).

Currently, chunk size is based only on native register size. ByteSet should expanded be to use 64-bit chunks on 32-bit targets with meaningful 64-bit instructions.

Consider (and benchmark!):

  • arm with neon target feature

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.