hashrock / kivi

Deno KV Explorer for VSCode
https://kivi-kv-editor.studio.site/
MIT License
42 stars 0 forks source link

Implement Pagination and Value Truncation for Improved Performance #3

Closed nberlette closed 9 months ago

nberlette commented 11 months ago

Hi hashrock,

Great project you have here, filling a notable gap with a Deno KV GUI editor.

I observed two areas for improvement:

  1. Pagination is missing for listed entries. Currently, there's a hardcoded limit of 100 in the server/kv source code. Adding pagination controls would enhance usability.

  2. Performance concerns arise when using large KV instances. I noticed the webview displays the entire value for each entry, which can be problematic for large data sets.

Possible fixes for performance:

I'm open to submitting a PR to address these issues, if you're accepting contributions.

Thanks for your work on this! Nick

hashrock commented 11 months ago

Thanks! I'm planning to work on serializing and deserializing things like BigInt for a while, so issues related to performance might be postponed. I would appreciate it if you could create a PR!

nberlette commented 10 months ago

When you say serializing bigint, are those plain bigint values or Deno.KvU64 instances? I think a binary serialization could prove useful in either case... what I mean is something along the lines of the Deno.core.serialize function, which preserves data-types and returns a Uint8Array.

Actually, I believe it could be used to serialize / deserialize all of the data types (for simplicity).

Check this code out from the gokv project by ije for an example of what I'm talking about: https://github.com/ije/gokv/blob/main/src/common/structured.ts

hashrock commented 10 months ago

That's right. Both Key and Value have various types, so they can't be handled by JSON.serialize. gokv seems like a good reference! Thanks.

hashrock commented 9 months ago

I added two preferences to solve this issue:

it also added basic pagenation feature.

https://github.com/hashrock/kivi/assets/3132889/0c6775be-55ec-42d4-bbc5-11b94338664d

I don't think these are perfect solution for performance issue, but I think it will work on most cases.