Skip to content

Optimize: bytes.Index and humanize.IBytes in SyncStandaloneReader#909

Merged
suxb201 merged 5 commits intotair-opensource:v4from
cyningsun:optimize_repl_diskless
Jan 14, 2025
Merged

Optimize: bytes.Index and humanize.IBytes in SyncStandaloneReader#909
suxb201 merged 5 commits intotair-opensource:v4from
cyningsun:optimize_repl_diskless

Conversation

@cyningsun
Copy link
Contributor

Opt:

  1. Replace bytes.Index with bytes.Equal between lastBytes and EOF MARKER
  2. Move humanize from every write to stats print

Before:
image

After:
image

@EquentR
Copy link
Collaborator

EquentR commented Dec 25, 2024

Here's a question: Will doing this make the status interface unable to retrieve the humanized result? What if I want to view the status? In pkg: internal/status

@cyningsun
Copy link
Contributor Author

cyningsun commented Dec 25, 2024

Currently Interface Statusable retrieve the humanized result only by method StatusString(). And StatusString can convert those stats to humanized result when called instead of calculated those stats to humanized result after every writing to rdb

@EquentR
Copy link
Collaborator

EquentR commented Dec 25, 2024

Currently Interface Statusable retrieve the humanized result only by method StatusString(). And StatusString can convert those stats to humanized result when called instead of calculated those stats to humanized result after every writing to rdb

No no, you look at the Statusable interface, in the json result obtained using the web interface, the Status func is used to generate json result!

@EquentR
Copy link
Collaborator

EquentR commented Dec 25, 2024

image

@cyningsun
Copy link
Contributor Author

cyningsun commented Dec 25, 2024

Got it. Will check and fix it.

@cyningsun
Copy link
Contributor Author

@EquentR Issue resolved.

@EquentR
Copy link
Collaborator

EquentR commented Dec 26, 2024

@suxb201 看一下,好像是能提高一点点性能的样子

Copy link
Member

@suxb201 suxb201 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你是正确的

        /* If this was a diskless replication, we need to really put
         * the slave online when the first ACK is received (which
         * confirms slave is online and ready to get more data). */
        if (c->repl_put_online_on_ack && c->replstate == SLAVE_STATE_ONLINE)
            putSlaveOnline(c);

@suxb201 suxb201 merged commit 0046b84 into tair-opensource:v4 Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants