jrnl icon indicating copy to clipboard operation
jrnl copied to clipboard

Don't import cryptography package if not needed

Open micahellison opened this issue 2 years ago • 1 comments

Feature Request

Use Case/Motivation

I noticed the 3.0 beta is running a bit slower than 2.8.4 so I ran some performance testing. It looks like the cryptography package is the slowest to load, and it's taking a lot longer to load on my system with the 3.0 beta than with 2.8.4.

However, cryptography is only needed for encrypted journals. Maybe there's a way to keep it from loading unless it's absolutely needed.

Other information

See the description of PR #719 for code on testing imports.

micahellison avatar Jun 25 '22 21:06 micahellison

Hi @micahellison, I think this problem could be solved via importing it in an if statement, For example, we can see if the user is using an encrypted journal or not via their config file, if yes, import the library, otherwise continue the program's flow.

SepehrRasouli avatar Aug 02 '22 15:08 SepehrRasouli