Code Monkey home page Code Monkey logo

fzy-lua-native_updated_gitignore_repaired_makefile's Introduction

fzy-lua-native

Luajit FFI bindings to FZY.

Building

make

Running

luajit benchmark.lua

Results:

Lines: 100000

Native:
 -> Total: 34130
 -> Time:  69.418 ms
Original:
 -> Total: 34130
 -> Time:  835.683 ms

Notes

The C version of fzy in that repo contains 2 differences with the original:

  • the functions take a is_case_sensitive additional parameters that does what you think. It's a parameter rather than computed in the function because for our use-case, you want to compute is_case_sensitive once for needle, instead of on each iteration of the loop.
  • match_positions uses uint32_t for positions, because size_t (uint64_t) doesn't map well to lua types.

Usage

The fzy algorithm requires that you call fzy.has_match(string, needle) to prefilter all your matches. Only after that is done you can call the other functions such as fzy.positions(string, needle).

fzy-lua-native_updated_gitignore_repaired_makefile's People

Contributors

romgrk avatar vigoux avatar arniiiii avatar alexanderjeurissen avatar ruifm avatar xanderio avatar cryptomilk avatar jityao avatar tjdevries avatar smolck 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.