jrnl
jrnl copied to clipboard
Don't import cryptography package if not needed
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.
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.