Giter Site home page Giter Site logo

countributions's Introduction

Blog version: https://blog.rockthejvm.com/cats-effect-parallelism/

Some people say that functional programming is slow. This app demonstrates that they are bulshitting.

Parallelism is a piece of cake when programs are expressions which can be composed and manipulated like normal strings and integers.

The app aggregates all the contributors for a certain GitHub organization and sorts them by their contributions.

Flow:

As you can see the parallelism is only limited by the restrictions GitHub REST API.

However since cats-effect Runtime works on Fiber-s, it's inexpensive to abuse them ๐Ÿ˜„

You are welcome to improve the implementation.

curl localhost:9000/org/{org_name} will yield sorted JSON response which looks like:

{
  "count": 3,
  "contributors": [
    {
      "login": "user1",
      "contributions": 5000
    },
    {
      "login": "user2",
      "contributions": 2500
    },
    {
      "login": "user3",
      "contributions": 1000
    }
  ]
}

Benchmarks for different organizations:

  • quantori - 3 seconds, 59 public repos, 604 contributors
  • typelevel - 4 seconds, 101 public repos, 1077 contributors
  • zio - 5 seconds, 94 public repos, 1276 contributors
  • lightbend - 5 seconds, 109 public repos, 1558 contributors
  • facebook - 6 seconds, 128 public repos, 8687 contributors
  • apache - 10 seconds, 2534 repos, 10818 contributors
  • google - 14 seconds, 2560 public repos, 12796 contributors

countributions's People

Contributors

ghurtchu avatar gojideth avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

gojideth

countributions's Issues

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.