Giter VIP home page Giter VIP logo

Comments (2)

bos avatar bos commented on May 28, 2024

While there was indeed some extra performance to be squeezed out of base64-bytestring, I'd be astonished if that's what is making your application slow. My tweaked version of decodeLenient can decode in excess of 100MB/sec of data.

As far as I can tell, you've got something like 19 SSL connections in your trace above. I think that all those half million calls to decodeLenient are coming from Data.PEM.Parser, which means they're decoding lines that are about 72 bytes long. The old version of decodeLenient can decode these at 40MB/sec, since there's added overhead from the small lines and the sloppy implementation of Data.PEM.Parser. (The new version is about 50% faster.)

Since decodeLenient is being called half a million times, you're decoding about 20MB of PEM data, and it's taking roughly half a second (about 20 milliseconds per connection). That is a ludicrous amount of work to be doing for 19 SSL connections. I infer that something - probably a lot of somethings - is or are broken inside the tls code that you're using.

from base64-bytestring.

pheaver avatar pheaver commented on May 28, 2024

Yes, it looks like the problem is actually in the PEM parser, which is being called way too many times. For reference, here is the response from the author, Vincent Hanquez:

One of the problem of the current certificate verification is the design is terrible (stupid algorithm category). It's basically listing all files in /etc/ssl/certs and parsing them all one by one until the certificate you want is found. This is terribly wasteful, and this is a problem i'm trying to deal with, with the new CertificateStore object, so that we can have a "o(1)" access to the certificate we need for verification. This is not a easy thing to implement, but would solve the performance problem to a greater extend than speeding up PEM parsing.

from base64-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.