Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 01 10:11
    @SystemFw banned @Hudsone_gitlab
  • Jan 31 2019 04:19
    404- forked
    404-/fs2
  • Jan 31 2019 03:01
    SethTisue commented #1232
  • Jan 30 2019 17:22
  • Jan 30 2019 13:45
  • Jan 30 2019 10:48
    pchlupacek commented #1406
  • Jan 30 2019 10:47
    pchlupacek commented #1406
  • Jan 30 2019 10:39
    pchlupacek commented #1407
  • Jan 30 2019 09:58
    lJoublanc commented #870
  • Jan 30 2019 09:42
    vladimir-popov commented #1407
  • Jan 30 2019 08:10
    vladimir-popov closed #1407
  • Jan 30 2019 08:10
    vladimir-popov commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 18:57
    SystemFw commented #1406
  • Jan 29 2019 17:47
    pchlupacek commented #1406
  • Jan 29 2019 17:42
    pchlupacek commented #1406
  • Jan 29 2019 17:39
    pchlupacek commented #1407
  • Jan 29 2019 17:39
    vladimir-popov edited #1407
  • Jan 29 2019 17:38
    vladimir-popov commented #1406
Fabio Labella
@SystemFw
There's a branch, however
So in this case Scheduler will be removed since we have Timer in cats effect, and sleep will go on Stream
We are still deciding when and how to release that (new milestone? 0.11?)
Alex Henning Johannessen
@ahjohannessen
Ah great, yeah I meant branch :)
Michael Pilquist
@mpilquist
I'm still hoping for fs2 1.0 in mid-May once cats-effect 1.0 is out
Peter Aaser
@PeterAaser
today my brakes failed mid traffic
I wish hyundai would use fs2
maybe then their cars wouldn't suffer random brake failures
Gavin Bisesi
@Daenyth
Can someone explain segments vs chunks?
and how that all interacts?
Fabio Labella
@SystemFw
@Daenyth yeah, I can do it in a bit
Gavin Bisesi
@Daenyth
thanks!
Specifically I ask because I have a Stream[IO, ByteString] where ByteString is an akka rope structure like ByteVector, and I want to get to bytes so I can use text stuff with it
and I have
byteStream
      .mapChunks(c => c.map(bs => bs.toVector).toSegment)
      .flatMap(Stream.emits(_).covary[IO])
but it feels wrong
Fabio Labella
@SystemFw
why does it feel wrong?
Christopher Davenport
@ChristopherDavenport
tldr: chunk - index based access
Gavin Bisesi
@Daenyth
@SystemFw it feels like I should be able to do this in a single step
Fabio Labella
@SystemFw
wdym exactly by "this" and "a single step" sorry
Gavin Bisesi
@Daenyth
the operation above
mapChunks+flatMap(Stream.emits)
also I don't understand when I want to work with chunks vs want to work with segments
Fabio Labella
@SystemFw
ok
Edmund Noble
@edmundnoble
@mpilquist I'm doing that. I don't even use fs2-scalaz though.
Gavin Bisesi
@Daenyth
or what the relation between chunk and segment is at all
Fabio Labella
@SystemFw
I can give some context
Edmund Noble
@edmundnoble
Didn't know that was still a thing.
Fabio Labella
@SystemFw
the tl;dr is that you want to work with Segment as much as possible
so, what is this all about
basically in older versions of fs2 there was no concept of chunking (let alone segments) at all
a Stream logically works in terms of single elements, right?
Gavin Bisesi
@Daenyth
right
Fabio Labella
@SystemFw
you produce element, you transform elements, you consume elements
Gavin Bisesi
@Daenyth
I have some concept of the chunking/batching thing - you keep groups of elements close in time together in order to get locality and better performance in general, right?
Fabio Labella
@SystemFw
it's not locality
Gavin Bisesi
@Daenyth
but yeah semantically about the elements
Fabio Labella
@SystemFw
it's just that you do less operations
basically fs2 used to be very slow
and people were desperate looking to make it faster by e.g. optimising how Free is run and things like that
but the realisation was the it's a lot easier to make it faster by just reducing the amount of work
so rather than doing every operation element by element
the Stream is internally chunked, and ops happen per chunk
Gavin Bisesi
@Daenyth
ok
Fabio Labella
@SystemFw
so most operations are chunk-aware and try to preserve chunkiness
this led to the introduction of a Chunk type
which you can look at as a strict, finite sequence of elements with random-based access
basically an array
Gavin Bisesi
@Daenyth
ok
Fabio Labella
@SystemFw
which can be created from multiple sources (vectors, arrays, seqs), with some specialisation for perf (e.g. a chunk of bytes and so on)
this led to a nice perf improvement