Giter VIP home page Giter VIP logo

Comments (2)

clyring avatar clyring commented on June 21, 2024

The differences between the different types of Writer monads are generally not too relevant to bytestring.

As far as the performance characteristics of the various bytestring types goes:

  • Concatenating many StrictByteStrings or ShortByteStrings with (<>) via any sort of writer monad is likely to be very inefficient except in niche situations.
  • Concatenating LazyByteStrings with (<>) can be efficient as long as the calls are generally right-associative. But if the individual LazyByteStrings are short, the result may have a small average chunk size, which may or may not be a problem depending on how that LazyByteString is used.
    • The codensity transform (or adding a ContT layer) can re-associate the monadic binds, if you have many nested calls that would tend to produce inefficient left-associative (<>) calls with a basic writer monad.
  • Concatenating Builders with (<>) is almost always at least reasonably efficient.

from bytestring.

BebeSparkelSparkel avatar BebeSparkelSparkel commented on June 21, 2024

Thanks, I'm working on a biparsing package and I have not yet, if even possible, implemented printing a differing type than the type being parsed. I'll try to figure out how to allow parsing strict or lazy ByteString and printing Builder.

Thank you for the insight.

from bytestring.

Related Issues (20)

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.