• Stars
    star
    184
  • Rank 209,187 (Top 5 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Iteratees for Cats

iteratee.io

Build status Coverage status Gitter Maven Central

This project is an iteratee implementation for Cats that began as a port of Scalaz's iteratee package, although the API and implementation are now very different from Scalaz's. There are API docs (but they're a work in progress), and I've published a blog post introducing the project.

The motivations for the port are similar to those for circe—in particular I'm aiming for a more consistent API, better performance, and better documentation.

Note that this library doesn't support many of the use cases that fs2 (formerly Scalaz Stream) is designed to handle. It doesn't support nondeterministic reading from multiple streams, for example, and in general is a less appropriate choice for situations where concurrency and parallelism are primary goals. Where the use cases of fs2 and this library do overlap, however, it's often likely to be a simpler, faster solution.

The initial performance benchmarks look promising. For example, here are the throughput results for summing a sequence of numbers with this library and cats.Id (II), this library and Monix's Task (IM), this library and Scalaz's Task (IT), this library and Twitter futures (IR), Scalaz Stream (S), scalaz-iteratee (Z), play-iteratee (P), the Scala collections library (C), and fs2 (F). Higher numbers are better.

Benchmark                      Mode  Cnt      Score     Error  Units
InMemoryBenchmark.sumInts0II  thrpt   80  10225.388 ± 191.612  ops/s
InMemoryBenchmark.sumInts1IM  thrpt   80  13395.800 ±  30.912  ops/s
InMemoryBenchmark.sumInts2IT  thrpt   80  18609.579 ±  47.491  ops/s
InMemoryBenchmark.sumInts3IR  thrpt   80  15999.740 ± 114.949  ops/s
InMemoryBenchmark.sumInts4S   thrpt   80     72.074 ±   1.209  ops/s
InMemoryBenchmark.sumInts5Z   thrpt   80    310.472 ±   4.368  ops/s
InMemoryBenchmark.sumInts6P   thrpt   80     43.071 ±   0.543  ops/s
InMemoryBenchmark.sumInts7C   thrpt   80  12975.042 ±  48.702  ops/s
InMemoryBenchmark.sumInts8F   thrpt   80   9610.699 ±  41.936  ops/s

And the results for collecting the first 10,000 values from an infinite stream of non-negative numbers into a Vector:

Benchmark                         Mode  Cnt     Score    Error  Units
StreamingBenchmark.takeLongs0II  thrpt   80  2787.725 ± 16.812  ops/s
StreamingBenchmark.takeLongs1IM  thrpt   80  1617.848 ± 19.899  ops/s
StreamingBenchmark.takeLongs2IT  thrpt   80  1052.494 ±  7.707  ops/s
StreamingBenchmark.takeLongs3IR  thrpt   80   979.514 ± 26.197  ops/s
StreamingBenchmark.takeLongs4S   thrpt   80    56.882 ±  0.969  ops/s
StreamingBenchmark.takeLongs5Z   thrpt   80   154.103 ± 10.350  ops/s
StreamingBenchmark.takeLongs6P   thrpt   80     1.216 ±  0.005  ops/s
StreamingBenchmark.takeLongs7C   thrpt   80  3273.158 ± 55.187  ops/s
StreamingBenchmark.takeLongs8F   thrpt   80     7.915 ±  0.044  ops/s

And allocation rates (lower is better):

Benchmark                                            Mode  Cnt           Score          Error  Units
InMemoryBenchmark.sumInts0II:gc.alloc.rate.norm     thrpt   20      159953.462 ±       11.863   B/op
InMemoryBenchmark.sumInts1IM:gc.alloc.rate.norm     thrpt   20      160203.272 ±        5.949   B/op
InMemoryBenchmark.sumInts2IT:gc.alloc.rate.norm     thrpt   20      160622.026 ±        6.323   B/op
InMemoryBenchmark.sumInts3IR:gc.alloc.rate.norm     thrpt   20      160398.303 ±        6.685   B/op
InMemoryBenchmark.sumInts4S:gc.alloc.rate.norm      thrpt   20    63936897.241 ±   320928.043   B/op
InMemoryBenchmark.sumInts5Z:gc.alloc.rate.norm      thrpt   20    16401510.998 ±        6.115   B/op
InMemoryBenchmark.sumInts6P:gc.alloc.rate.norm      thrpt   20    13802446.593 ±   229152.745   B/op
InMemoryBenchmark.sumInts7C:gc.alloc.rate.norm      thrpt   20      159851.547 ±       14.556   B/op
InMemoryBenchmark.sumInts8F:gc.alloc.rate.norm      thrpt   20      260454.260 ±     1522.736   B/op

Benchmark                                            Mode  Cnt           Score          Error  Units
StreamingBenchmark.takeLongs0II:gc.alloc.rate.norm  thrpt   20     3043720.338 ±        0.018   B/op
StreamingBenchmark.takeLongs1IM:gc.alloc.rate.norm  thrpt   20     3444961.639 ±        4.168   B/op
StreamingBenchmark.takeLongs2IT:gc.alloc.rate.norm  thrpt   20     5804308.795 ±    61718.228   B/op
StreamingBenchmark.takeLongs3IR:gc.alloc.rate.norm  thrpt   20     5124124.296 ±        5.147   B/op
StreamingBenchmark.takeLongs4S:gc.alloc.rate.norm   thrpt   20    75347149.315 ±   555268.150   B/op
StreamingBenchmark.takeLongs5Z:gc.alloc.rate.norm   thrpt   20    28588033.048 ±   238419.245   B/op
StreamingBenchmark.takeLongs6P:gc.alloc.rate.norm   thrpt   20  1206196498.000 ±    71329.621   B/op
StreamingBenchmark.takeLongs7C:gc.alloc.rate.norm   thrpt   20      526752.310 ±        0.029   B/op
StreamingBenchmark.takeLongs8F:gc.alloc.rate.norm   thrpt   20   531380973.839 ± 13505581.754   B/op

License

iteratee.io is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

memory.lol

memory.lol
Rust
471
star
2

cancel-culture

Tools for fighting abuse on Twitter
Rust
411
star
3

dhallj

Dhall for Java
Java
174
star
4

blue

Twitter Blue data
122
star
5

octocrabby

Tools for managing GitHub block lists
Rust
98
star
6

type-provider-examples

Macro-based type providers for Scala (examples)
Scala
85
star
7

twitter-watch

Tracking the far right on Twitter
Rust
58
star
8

abstracted

Forget your methods
Scala
41
star
9

expressier

A regular expression type provider demo
Scala
40
star
10

sized

Scala
35
star
11

hassreden-tracker

Hassreden-Tracker
Rust
34
star
12

unsuspensions

Elon Musk's suspension reversals
32
star
13

metaplasm

meta.plasm.us
HTML
32
star
14

scala-quickstart

Getting started in the Scala REPL
Shell
28
star
15

deleted-tweets

Deleted tweet archive metadata and code
26
star
16

typelevel-tour

A tour of some Typelevel libraries
Scala
25
star
17

itm

Interactive topic modeling
Java
24
star
18

stop-the-steal

Stop the Steal / J6 Twitter user profiles
20
star
19

evasion

Tracking far-right ban evasion on Twitter
19
star
20

circe-derivation

Scala
17
star
21

mstparser

Scala
17
star
22

circe-algebra

Experimental decoding algebra for circe
Scala
13
star
23

wayback-rs

Tools for working with the Wayback Machine in Rust
Rust
13
star
24

orcrs

An ORC reader for Rust
Rust
12
star
25

scala-java-interop

Scala-Java interoperability examples
Java
12
star
26

dotty-experiments

Scala
11
star
27

incompletes

Derivation for incomplete type class instances
Scala
9
star
28

instancez

Scalaz 7 type class instances for various Scala and Java libraries.
Scala
9
star
29

names

Named-entity recognition with Finagle
Scala
8
star
30

coverages

A sandbox for experimenting with Scala code coverage tools
Scala
7
star
31

rotation-rs

Document rotation detection
Rust
7
star
32

tsg-metadata

Metadata related to the Twitter Stream Grab from Archive Team
Rust
7
star
33

macavity

Faster stuff for Cats
Scala
7
star
34

memory-lol

memory.lol
Java
7
star
35

rust-jvm-demo

Rust on the JVM
Scala
6
star
36

concurrent

Scala
6
star
37

syzygist

Various utilities for Scalaz streams
Scala
6
star
38

scrooge-circe-demo

Circe codecs for Scrooge-generated code
Scala
6
star
39

at-twitter-stream

Tools for working with Twitter JSON data
Rust
5
star
40

haskell-cpython

CPython bindings for Haskell
Haskell
5
star
41

woodchipper

Woodchipper
JavaScript
5
star
42

deleted-tweets-archive

Deleted Tweets Archive - These tweets display several bad actors' most divisive uses of the Twitter platform.
5
star
43

iteratee-twitter

iteratee.io module for Twitter Util
Scala
5
star
44

twitter-model

JSON Schema definitions for the Twitter API
Rust
4
star
45

hkvdb

hkvdb
Rust
4
star
46

sbt-javacc

An sbt plugin for JavaCC
Scala
4
star
47

parquetry

Rust
4
star
48

sbt-opinions

Standard SBT project plugin
Scala
4
star
49

twprs

Twitter profile tools for Rust
Rust
4
star
50

mallet

MALLET
Java
3
star
51

egg-mode-extras

Rate-limit-aware streams and other helpers for egg-mode
Rust
3
star
52

twpis

Rust
2
star
53

sentlex

Haskell
2
star
54

sbt-jacc

An sbt plugin for JFlex and Jacc
Java
2
star
55

xmlunit

XmlUnit
Java
2
star
56

tesseract

Tesseract
C++
2
star
57

shapeless-twitter

Twitter + Shapeless experiments
Scala
2
star
58

findmyfrens

Tracking findmyfrens.net
Rust
2
star
59

cli-helpers

Rust
1
star
60

misccli

Miscellaneous command-line tools
Rust
1
star
61

relate

A prosopography visualization tool
Java
1
star
62

scala-visitor

Scala
1
star
63

smoothlife

A simple version of SmoothLife in Haskell
Haskell
1
star
64

morphadorner

Java
1
star
65

dotfiles

My configuration
Vim Script
1
star
66

euler

Project Euler framework and solutions
Scala
1
star
67

abbot

TEI conversion utilities
Shell
1
star
68

disinfo-notes

1
star
69

rocksdb-table

Some helpers for working with RocksDB databases in Rust
Rust
1
star
70

rearranger

Rust
1
star
71

gothic

Analysis of a collection of Gothic texts
1
star
72

scardf

Scala RDF API
Scala
1
star
73

corporacamp-site

PHP
1
star
74

travisbrown

1
star
75

oscon-challenge

Twitter Challenge at OSCON 2014
JavaScript
1
star
76

circles

Miscellaneous files for Romantic Circles
1
star
77

archivindex-builder

Archivindex Builder
HTML
1
star
78

gistlist

List your gists
Rust
1
star
79

retryable-error

Rust
1
star
80

json-schema-tools

JSON Schema tools
Rust
1
star