Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] CopyToString is over 100% slower than other methods #45

Open
DGKSK8LIFE opened this issue Sep 29, 2021 · 2 comments
Open

[BUG] CopyToString is over 100% slower than other methods #45

DGKSK8LIFE opened this issue Sep 29, 2021 · 2 comments
Assignees
Labels
done finished in unstable branch, awaiting stable release

Comments

@DGKSK8LIFE
Copy link
Owner

Expected Behavior

Performance in CopyToString should be comparable to that of CopyToList and CopyToHash.

Current Behavior

CopyToString is over 100% slower than the aforementioned two.

Possible Solution

Because of Redis' data structures, CopyToString (strings) has to write one key per field, compared to CopyToList and CopyToHash that both write one key per row. This is not necessarily something that can be "quick fixed", but with other performance optimizations, especially transactions and pipelining, performance should improve drastically.

Steps to Reproduce

  1. Run test cases with ~10k rows or so and your preferred DB.
  2. View output:
➜  redisql git:(master) go test -v -db mysql -rows 10000 
Preparing Test...
=== RUN   TestCopyToString
--- PASS: TestCopyToString (8.43s)
=== RUN   TestCopyToList
--- PASS: TestCopyToList (0.75s)
=== RUN   TestCopyToHash
--- PASS: TestCopyToHash (0.92s)
PASS
ok      github.com/DGKSK8LIFE/redisql   17.995s
@DGKSK8LIFE DGKSK8LIFE added bug Something isn't working help wanted Extra attention is needed Hacktoberfest performance labels Sep 29, 2021
@DGKSK8LIFE DGKSK8LIFE self-assigned this Sep 29, 2021
@DGKSK8LIFE DGKSK8LIFE added enhancement New feature or request good first issue Good for newcomers labels Sep 29, 2021
@Fajrinmk
Copy link

Hi @DGKSK8LIFE , have you solved this yet? I'd like to try to solve this

@DGKSK8LIFE
Copy link
Owner Author

DGKSK8LIFE commented Sep 30, 2021

I'm working on one possible solution, but the bug is not definitively resolved. Definitely want to see your solution so go ahead and work on this, ty. @Fajrinmk

@DGKSK8LIFE DGKSK8LIFE assigned Fajrinmk and DGKSK8LIFE and unassigned Fajrinmk and DGKSK8LIFE Oct 1, 2021
@DGKSK8LIFE DGKSK8LIFE assigned Fajrinmk and DGKSK8LIFE and unassigned Fajrinmk and DGKSK8LIFE Oct 1, 2021
@DGKSK8LIFE DGKSK8LIFE added done finished in unstable branch, awaiting stable release and removed bug Something isn't working enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers Hacktoberfest performance labels Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done finished in unstable branch, awaiting stable release
Projects
None yet
Development

No branches or pull requests

2 participants