GithubHelp home page GithubHelp logo

sungjjinkang / std_find_simd Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 1.0 51 KB

std::find simd version

License: MIT License

C 15.12% C++ 84.88%
cpp cpp11 simd vectorization algorithms avx2 avx512 simd-instructions portable c-plus-plus

std_find_simd's Introduction

std::find simd version

std::find doesn't use simd intrinsics. ( check https://gms.tf/stdfind-and-memchr-optimizations.html )

So i thought simd can make std::find faster for some types.

Feature

  • avx2 intrinsic is used
  • You don't need worry about alignment problem. ( this library handle it )

Requirement

  • iterator's value type should be scalar type and type size of it should be 1 or 2 or 4 or 8
  • iterator should be random access iterator
  • require avx2 option
  • require c++ 11

Usage

std::vector<short> a;
a.reserve(1001);
for (unsigned short i = 0; i <= 1000; i++)
{
  a.push_back(i);
}

for (short i = 0; i < 1000; i++)
{
  fast_find_simd::find_simd(a.begin(), a.end(), (short)i);
}

Performance Comparison

tested on release mode, msvc, x64, windows
20211128031529

To develop

std_find_simd's People

Contributors

sungjjinkang avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

mfkiwl

std_find_simd's Issues

Support for multithreading

The algorithm could be significantly faster maybe if you were to use a standard matching algorithm like boyer-moore (keeping all the SIMD intrinsics) and use multithreading on it

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.