Giter Site home page Giter Site logo

camel-case-bench's Introduction

Camel case benchmark

A collection of benchmarks for camel casing a large chunk of data. Rules for implementations:

  • Read input from stdin
  • Write camel cased output to stdout
  • Camel casing works one line at a time
  • Treat anything besides upper and lower case ASCII letters (a-z) as spaces
  • Any letter following a space must be upper cased
  • Any space character must be stripped (besides newlines, which are retained)
  • First character in a line may or may not be upper cased, implementation defined

Running the benchmarks:

  • Install the Rust toolchain
  • Run cargo run --release

Running the haskell-based benchmarks

  • curl http://www.gutenberg.org/files/2600/2600-0.txt -o war-and-peace.txt
  • ./main.hs

camel-case-bench's People

Contributors

snoyberg avatar chrisdone avatar

Stargazers

andrea denisse avatar

Watchers

 avatar  avatar

camel-case-bench's Issues

The Haskell versions are all different

For hello world as input.

The C version gives:

$ echo 'hello world' | ./camel
helloWorld

The Haskell String version gives:

HelloWorld

The Haskell bytestring-simple version gives:

Hello
World

The chrisdone one matches the C one.

I'm not complaining, but I'm using this simple demo as my "locked down Haskell" strawman project in lieu of other ideas, and noticed a cursory test of all three yielding different results. ๐Ÿ˜‚

I think the String version and the C one are correct, but the bytestring-simple one is buggy.

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.