RedMageKnight / Flow.Launcher.Plugin.BitwardenSearch

Quick access to your Bitwarden vault via Flow Launcher.
6 stars 0 forks source link

Http Server #3

Closed taooceros closed 1 week ago

taooceros commented 1 month ago

Is it possible to use the http server provided by bitwarden cli bw serve. Since the cli is really really slow, the http server can provide probably provide a much faster access.

RedMageKnight commented 1 month ago

Hi @taooceros,

It does - it uses "http://localhost:8087"

taooceros commented 1 month ago

Oh ok, but it still seems slow for me. Even for empty query it takes a couple second to show up 🤔.

RedMageKnight commented 1 month ago

Are you getting any results at all? I'm wondering if you're experiencing a configuration issue - maybe send me the plugin logs and I can see if you're getting any errors.

taooceros commented 1 month ago

I am guessing the deboucing delay is a little bit large. Each http request only takes 160ms. However I am not sure why empty query will take a while to show up.

taooceros commented 1 month ago

I take a look on the log, and it doesn't seem to have much useful info except the part that I haven't properly setup.

RedMageKnight commented 1 month ago

What part didn't you set up? The debounce delay is 300 ms. The logs don't populate retroactively - you'd need to enable the info and debug logs and then try your operation again if you haven't already done this.

taooceros commented 1 month ago

Yeah I think the 300ms is a little bit long probably, as the http request would take 150ms (test with postman) which will combine to about half a second, which can be a significant delay. Probably it is not slow as a couple second, but feels a noticeable delay.

I take a look on the log with debug open, it doesn't seem to include much interesting thing.

It is a little bit confused for me about the slowness of the empty query, as that should not trigger the debounce delay. Maybe you could add some trace function to allow us to figure out where is the slow part?

RedMageKnight commented 1 month ago

Yeah, I'm actually looking into removing the debounce on an empty query in the next minor version. Might reduce the 300ms as well. I'm pretty sure I know where that's happening and how to resolve. Over time I'll look over other optimizations, but for now, is there anything hard stopping you from using this that you want to look at or are you just looking over the performance piece? Because for me, the performance isn't a deal breaker for me and I've been actively using it without issue.

taooceros commented 1 month ago

Yeah no worry I am just pointing out the performance issue. It is mostly fine.

Thanks for developing it.

RedMageKnight commented 1 month ago

Okay sounds good! I'll keep tweaking it and taking your suggestions to improve performance, I definitely appreciate it! I just wanted to make sure it wasn't totally broken for you at this point. I'm hoping I can get an update out today or tomorrow depending on how busy things get for me personally and then you know, feel free to let me know if anything else seems off and I'll continue looking :)

RedMageKnight commented 1 week ago

Will continue working on future performance enhancements with future updates, some of which has already been addressed in recent updates but could still be improved upon.