tarantool / tarantool/tarantool

Qsync perf optimizations

Open
#5,136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

optimization qsync replication
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

This ticket is a set of optimizations which could speed up the synchronous transaction, and reduce slow down of the async transactions.

  • txn_journal_entry_new() in each statement dereferences stmt->space->def->opts in order to check whether the space is sync. This is 3 pointer derefences and could be quite slow;
  • txn_commit() has 3 checks for whether the transaction is sync: it takes TXN_WAIT_SYNC flags, + it checks is_sync boolean variable twice. First way to reduce number of checks - check is_sync only once and then handle async and sync transactions completely separately. Second way - keep track of sync space count in the schema. When it is 0, don't even try to check any sync flags.
  • <Add more optimizatons here>.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating txn_journal_entry_new() and txn_commit(), then trace how stmt->space->def->opts, TXN_WAIT_SYNC, and is_sync are used for synchronous and asynchronous transactions. The issue leaves additional optimizations open; done means the selected changes preserve transaction behavior while reducing the relevant sync checks and improving the stated performance.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
databases, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.