harrynull / Flow.Launcher.Dictionary

A dictionary plugin for Flow Launcher that supports spelling correction and synonym.
GNU Lesser General Public License v3.0
24 stars 4 forks source link

Use separate connection with pooling for each function #8

Closed taooceros closed 3 years ago

taooceros commented 3 years ago

QueryRange and QueryLike takes quite a bit of time when query string is short, so one connection is hard to handle them when typing fast. With this build I can see the result pop out fluently, when I am typing quickly. On the past, sometimes it takes quite a while to wait until the result pop up for latest query after typing a word.

I believe multiple connection help concurrent reading quite a lot. However, not sure whether it would be better to keep one connection per query or keep one connection per select, but I think using pool will be fine.

harrynull commented 3 years ago

That's interesting. I thought it'd take more time to open a new connection because of IO...

taooceros commented 3 years ago

That's interesting. I thought it'd take more time to open a new connection because of IO...

I originally also think that will be the case, but after taking a trial, the result surprise me. Also, I think the connection pool will overcome the issue of IO because it will maintain a few connections for us to reuse.

harrynull commented 3 years ago

Sorry I've been busy this week. I might review and merge it later this week or early next week.

taooceros commented 3 years ago

Sorry I've been busy this week. I might review and merge it later this week or early next week.

No problem. 😉