Git Product home page Git Product logo

ful's Introduction

Fast Unicode Library

String operations are common, they need to be made fast.

But why?

This library came about from two ideas colliding:

  • Unicode in C++ is an embarrassment.

  • Which string operations can be made faster with simdtypes?

There are numerous libraries for Unicode processing already, why are they not good enough? Most aim to be standard conforming, i.e. not vectorized. Many are implemented in C with wrappers for C++. Some are written to work together with std::string (which has enough problems as it is already). None of these paths lead to optimal C++.

In order to guarantee some sort of performance improvements, this library can run benchmarks against string/unicode functionality using the many alternative libraries listed in the section below.

Alternatives?

The following list of libraries are summarized here in order to put ful into some sort of context. It is ordered alphabetically.

Is your favorite Unicode library not on the list? Tell me about it! Unless it is one of these other libraries that, although they have come up in searches, they cannot be built for various reasons, like at all. It will take some work to get them working.

Inspiration

Reference

Predefined macros

Without runtime probing, ful uses the following table of predefined macros in order to determine which instruction sets are available and which specialized implementations to use. With runtime probing, these macros are ignored.

feature gcc/clang msvc x86 msvc x64
sse __SSE__ __SSE__ || __SSE2__ || __AVX__ always true
sse2 __SSE2__ __SSE2__ || __AVX__ always true
sse4.2 __SSE4_2__ __AVX__ same as x86
popcnt __POPCNT__ __AVX__ same as x86
avx __AVX__ __AVX__ same as x86
bmi1 __BMI__ __AVX2__ same as x86
bmi2 __BMI2__ __AVX2__ same as x86
lzcnt __LZCNT__ __AVX2__ same as x86
avx2 __AVX2__ __AVX2__ same as x86

Consult the documentation for your favorite compiler in order to make it define the macros you expect.

The documentation on msdn does not specifically say that the more exotic instruction sets (i.e. sse4.2, popcnt, ...) are guaranteed to be available with bigger and more advanced simd types but since Windows is only supported on a few platforms, we can deduce that this must be so. Wikipedia seems to agree.

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.