Comments (2)
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.
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)
- Suggestion: introduce a Base64 newtype HOT 7
- Test suite failure on Linux/x86_64 HOT 1
- Build needs UndecidableInstances with GHC 6.12.x HOT 1
- Add support for base64url with no padding HOT 4
- Rename `decode` to `decodeStrict`, and deprecate `decode`? HOT 1
- Support for rejecting non-canonical encodings HOT 5
- Looming regression with 8.10 HOT 4
- 1.1.0.0 release planning HOT 4
- disable padding for Base64.URL? HOT 2
- Refactor and Expand Test Coverage HOT 3
- Add Head validations for correct padding HOT 1
- Improve Performance of Encoding Loop
- RFC: Should Stringly-typed messages be replaced with Ints? HOT 1
- Massive performance slowdown in 0.1.1.0 HOT 6
- Fails When String Includes Byte Order Mark HOT 2
- incorrect decoding on GHC 9.0.1
- relax bytestring version constraint HOT 1
- `joinWith` does not always terminate the input HOT 1
- Use lazy ByteStrings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base64-bytestring.