- Notifications
You must be signed in to change notification settings - Fork17
Iteratees for Cats
License
Apache-2.0, Unknown licenses found
Licenses found
travisbrown/iteratee
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project is an iteratee implementation forCats that began as a port ofScalaz'siteratee package, although the API and implementation are nowvery different from Scalaz's. There areAPI docs (but they're a work in progress), andI've published ablog post introducing the project.
The motivations for the port are similar to those forcirce—in particular I'm aiming for amore consistent API, better performance, and better documentation.
Note that this library doesn't support many of the use cases thatfs2 (formerly ScalazStream) 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 andparallelism are primary goals. Where the use cases of fs2 and this library do overlap, however, it'soften likely to be a simpler, faster solution.
The initial performance benchmarks look promising. For example, here are the throughput results forsumming a sequence of numbers with this library andcats.Id
(II
), this library and Monix'sTask
(IM
), this library and Scalaz'sTask
(IT
), this library and Twitter futures (IR
),Scalaz Stream (S
), scalaz-iteratee (Z
),play-iteratee (P
), the Scalacollections library (C
), and fs2 (F
). Higher numbers are better.
Benchmark Mode Cnt Score Error UnitsInMemoryBenchmark.sumInts0II thrpt 80 10225.388 ± 191.612 ops/sInMemoryBenchmark.sumInts1IM thrpt 80 13395.800 ± 30.912 ops/sInMemoryBenchmark.sumInts2IT thrpt 80 18609.579 ± 47.491 ops/sInMemoryBenchmark.sumInts3IR thrpt 80 15999.740 ± 114.949 ops/sInMemoryBenchmark.sumInts4S thrpt 80 72.074 ± 1.209 ops/sInMemoryBenchmark.sumInts5Z thrpt 80 310.472 ± 4.368 ops/sInMemoryBenchmark.sumInts6P thrpt 80 43.071 ± 0.543 ops/sInMemoryBenchmark.sumInts7C thrpt 80 12975.042 ± 48.702 ops/sInMemoryBenchmark.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-negativenumbers into aVector
:
Benchmark Mode Cnt Score Error UnitsStreamingBenchmark.takeLongs0II thrpt 80 2787.725 ± 16.812 ops/sStreamingBenchmark.takeLongs1IM thrpt 80 1617.848 ± 19.899 ops/sStreamingBenchmark.takeLongs2IT thrpt 80 1052.494 ± 7.707 ops/sStreamingBenchmark.takeLongs3IR thrpt 80 979.514 ± 26.197 ops/sStreamingBenchmark.takeLongs4S thrpt 80 56.882 ± 0.969 ops/sStreamingBenchmark.takeLongs5Z thrpt 80 154.103 ± 10.350 ops/sStreamingBenchmark.takeLongs6P thrpt 80 1.216 ± 0.005 ops/sStreamingBenchmark.takeLongs7C thrpt 80 3273.158 ± 55.187 ops/sStreamingBenchmark.takeLongs8F thrpt 80 7.915 ± 0.044 ops/s
And allocation rates (lower is better):
Benchmark Mode Cnt Score Error UnitsInMemoryBenchmark.sumInts0II:gc.alloc.rate.norm thrpt 20 159953.462 ± 11.863 B/opInMemoryBenchmark.sumInts1IM:gc.alloc.rate.norm thrpt 20 160203.272 ± 5.949 B/opInMemoryBenchmark.sumInts2IT:gc.alloc.rate.norm thrpt 20 160622.026 ± 6.323 B/opInMemoryBenchmark.sumInts3IR:gc.alloc.rate.norm thrpt 20 160398.303 ± 6.685 B/opInMemoryBenchmark.sumInts4S:gc.alloc.rate.norm thrpt 20 63936897.241 ± 320928.043 B/opInMemoryBenchmark.sumInts5Z:gc.alloc.rate.norm thrpt 20 16401510.998 ± 6.115 B/opInMemoryBenchmark.sumInts6P:gc.alloc.rate.norm thrpt 20 13802446.593 ± 229152.745 B/opInMemoryBenchmark.sumInts7C:gc.alloc.rate.norm thrpt 20 159851.547 ± 14.556 B/opInMemoryBenchmark.sumInts8F:gc.alloc.rate.norm thrpt 20 260454.260 ± 1522.736 B/opBenchmark Mode Cnt Score Error UnitsStreamingBenchmark.takeLongs0II:gc.alloc.rate.norm thrpt 20 3043720.338 ± 0.018 B/opStreamingBenchmark.takeLongs1IM:gc.alloc.rate.norm thrpt 20 3444961.639 ± 4.168 B/opStreamingBenchmark.takeLongs2IT:gc.alloc.rate.norm thrpt 20 5804308.795 ± 61718.228 B/opStreamingBenchmark.takeLongs3IR:gc.alloc.rate.norm thrpt 20 5124124.296 ± 5.147 B/opStreamingBenchmark.takeLongs4S:gc.alloc.rate.norm thrpt 20 75347149.315 ± 555268.150 B/opStreamingBenchmark.takeLongs5Z:gc.alloc.rate.norm thrpt 20 28588033.048 ± 238419.245 B/opStreamingBenchmark.takeLongs6P:gc.alloc.rate.norm thrpt 20 1206196498.000 ± 71329.621 B/opStreamingBenchmark.takeLongs7C:gc.alloc.rate.norm thrpt 20 526752.310 ± 0.029 B/opStreamingBenchmark.takeLongs8F:gc.alloc.rate.norm thrpt 20 531380973.839 ± 13505581.754 B/op
iteratee.io is licensed under theApache 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, softwaredistributed 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 andlimitations under the License.
About
Iteratees for Cats