8000 [BUG] CopyToString is over 100% slower than other methods · Issue #45 · DGKSK8LIFE/redisql · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[BUG] CopyToString is over 100% slower than other methods #45
Open
@DGKSK8LIFE

Description

@DGKSK8LIFE

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

Metadata

Metadata

Labels

donefinished in unstable branch, awaiting stable release

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0