You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think most programs will do some startup about loading providers, etc., and then enter a steady-state.
I think it will make sense for an application to tell OpenSSL to "freeze" the configuration: no new providers will be loaded, nor will any be unloaded. At that point, it should be possible to get very close to the 1.1.1 algorithm lookup performance.
I suggest adding one new API now, that does nothing, but can be implemented during the beta releases. Do not allow an application to "unfreeze", just have this:
int OPENSSL_freeze(void);
After calling this, no new configuration files can be loaded. No new providers can be loaded or unloaded. Nothing changes. The program has to exit.
All property queries would become infinitely cacheable, for example. Encode/decode could become built on-the-fly and reused as arrays of function pointers. TLS algorithms would become immutable based on query.
Reacted by Dmitry Belyavskiy, h-vetinari and Leonhard Wimmer
Providers that set the no-cache flag confound this. How would they fit into the freeze world?
Apart from the encode/decode part (which should happen soon), we're already caching the rest. Stop loading/unloading providers and the caches should be returning the results.
I suggest adding one new API now, that does nothing, but can be implemented during the beta releases
Beta means we're done with adding new features. According to our current policy if we were going to add such a feature it would have to be implemented before we get to beta1. I can't see OTC accepting it but I've added it to the "beta1" milestone so that it gets reviewed.
Hmmm, the idea that you're talking about is about freezing the set of methods to be fetched, not just about loading / unloading providers. That goes against a design criterion that we talked about from the very beginning, and that's the basis for the no_store flag in the fetching internals. It was quite eloquently put at a meeting, something like this "someone pulls the PKCS#11 token", and that we should be able to handle that situation.
I have no ideas about how to improve the caching. Premature optimisation is a bane, but we already know the performance in 3.0 is worse than the previous release, #15088. I can write more tests for other things.
I fail to see how "freezing" improves performance. I don't see any analysis in #15088 which tells us what is causing slower performance or why freezing will make it better. My guess is decoding is the most significant bottleneck - so I can't see how "freezing" would help improve that. Much better is to analyse the underlying causes, address those and then iterate.
Activity
paulidale commentedon Jun 3, 2021
Providers that set the no-cache flag confound this. How would they fit into the freeze world?
Apart from the encode/decode part (which should happen soon), we're already caching the rest. Stop loading/unloading providers and the caches should be returning the results.
mattcaswell commentedon Jun 3, 2021
Beta means we're done with adding new features. According to our current policy if we were going to add such a feature it would have to be implemented before we get to beta1. I can't see OTC accepting it but I've added it to the "beta1" milestone so that it gets reviewed.
levitte commentedon Jun 3, 2021
Hmmm, the idea that you're talking about is about freezing the set of methods to be fetched, not just about loading / unloading providers. That goes against a design criterion that we talked about from the very beginning, and that's the basis for the
no_storeflag in the fetching internals. It was quite eloquently put at a meeting, something like this "someone pulls the PKCS#11 token", and that we should be able to handle that situation.richsalz commentedon Jun 3, 2021
I remember the "someone pulls the token" comment. But if the hypothetical PKCS11 provider is loaded, then it should handle the token being removed.
If the project feels that the caching as-is will work, without any other work or hints from applications, so be it. I am skeptical.
paulidale commentedon Jun 3, 2021
Any tangible suggestions as to how to improve the caching?
Simply freezing things won't improve matters -- more would have to be done after that.
I've got a few ideas but I'm not sure they are a good reward/effort trade.
Premature optimisation is one of the banes of computing.
richsalz commentedon Jun 4, 2021
I have no ideas about how to improve the caching. Premature optimisation is a bane, but we already know the performance in 3.0 is worse than the previous release, #15088. I can write more tests for other things.
paulidale commentedon Jun 4, 2021
Yeah, decoding is very bad currently. It's being worked on: #15604 is the next step.
mattcaswell commentedon Jun 4, 2021
I fail to see how "freezing" improves performance. I don't see any analysis in #15088 which tells us what is causing slower performance or why freezing will make it better. My guess is decoding is the most significant bottleneck - so I can't see how "freezing" would help improve that. Much better is to analyse the underlying causes, address those and then iterate.
mattcaswell commentedon Jun 8, 2021
OTC: We will not be implementing this feature.
nicowilliams commentedon May 4, 2023
IMO this should be reconsidered.