dcreemer / 1pass

A caching wrapper for the 1Password CLI

Repository from Github https://github.comdcreemer/1passRepository from Github https://github.comdcreemer/1pass

Investigate local cached performance.

jsardev opened this issue · comments

I wanted to switch to 1pass instead of op in order to gain speed as the core CLI tool is incredibly slow. As 1pass caches all the entries, I expected it to work instantly. But unfortunately, it doesn't.

A normal 1pass -p Google query takes ~2 seconds.

What can be the cause of this? Maybe it's the gpg keys decryption? Any ideas? 😄

hi - can you try running that command twice? 1pass caches entries only as they are first used, and it does not pull down and cache all entries. Please see if the commands complete in a reasonable amount of time on second use. Thanks!

Indeed it gets faster, but it's still ~1 second:

➜  .1pass /usr/bin/time 1pass WooCommerce
0.27user 0.04system **0:03.88elapsed** 8%CPU (0avgtext+0avgdata 19352maxresident)k
0inputs+24outputs (0major+8924minor)pagefaults 0swaps
➜  .1pass /usr/bin/time 1pass WooCommerce
0.04user 0.00system **0:00.95elapsed** 5%CPU (0avgtext+0avgdata 5656maxresident)k
0inputs+0outputs (0major+4614minor)pagefaults 0swaps

thanks for the test -- that matches what I get on my older Macbook. I will see what I can do. PR's welcome too!

@dcreemer Did you just insult my PC? 🤣 Just kidding.

This is not a critical issue. I'd take a look at it when I'll get some free time, but I'm out of it right now unfortunately 😢

I did a bit of performance analysis (discovered the Bash "times" builtin!) and found that I was calling GPG twice on the same file to get two different pieces of data. Those could be combined into one call, resulting in about a 30% performance boost.
c926d25
Released as v1.1.1.
Closing for now.

@dcreemer Thank you very much for taking time on this issue! ❤️