GithubHelp home page GithubHelp logo

woidda / rust-str_metrics-ruby-benchmark Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16 KB

Do some benchmarks on string metrics implemented in Rust called from Ruby vs native implementation

License: Mozilla Public License 2.0

Ruby 100.00%

rust-str_metrics-ruby-benchmark's Introduction

Some Benchmarks Jaro-Winkler in plain Ruby vs Rust

I played around with rust integration and found a project called str_metrics -- see reddit and wanted to see how fast a native Rust implementation for Jaro-Winkler distance is vs the one shipped in Ruby (used for "did-you-mean" suggestion for typos in methods). I added the Levenshtein distance as well.

The benchmark executes 50 000 times a string comparison and prints out the result. See the benchmark-rust.rb.

Note: You might need to install rust first for your environment if you want to run those benchmarks yourself or adapt it.

Results

ruby benchmark-rust.rb
These report shows the user CPU time, system CPU time, the sum of the user and system CPU times, and the elapsed real time. The unit of time is seconds.
----------
Jarowinkler test short words
----------
str_metrics
  0.278842   0.000000   0.278842 (  0.278858)
ruby
  1.056634   0.003742   1.060376 (  1.061857)
----------
Jarowinkler test longer words
----------
str_metrics
  2.914134   0.000000   2.914134 (  2.914430)
ruby
 79.243360   0.000000  79.243360 ( 79.281593)
----------
----------
Levenshtein test short words
----------
str_metrics
  0.349502   0.000000   0.349502 (  0.349512)
ruby
  3.872907   0.000000   3.872907 (  3.873256)
----------
Levenshtein test longer words
----------
str_metrics
  6.272882   0.000000   6.272882 (  6.279489)
ruby
146.693731   0.027974 146.721705 (146.746541)

rust-str_metrics-ruby-benchmark's People

Contributors

woidda avatar

Watchers

 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.