Skip to content

Conversation

@bradfitz
Copy link
Member

@bradfitz bradfitz commented Nov 3, 2025

Updates tailscale/corp#34015

@bradfitz bradfitz requested review from alisdair and raggi and removed request for alisdair November 3, 2025 18:15
Comment on lines +1554 to +1562
// Verify we didn't build with -DSQLITE_DEFAULT_MEMSTATUS=0.
// We want memory stats.
func TestDBMemoryUsed(t *testing.T) {
conn := getTestConn(t)
mem0 := conn.db.MemoryUsed()
if mem0 == 0 {
t.Error("MemoryUsed=0; want non-zero; did you build with -DSQLITE_DEFAULT_MEMSTATUS=0?")
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@raggi, see this new test.

@alisdair
Copy link
Contributor

alisdair commented Nov 4, 2025

Some benchmarks run on my MacBook, three runs:

go test -bench=UpdateRoutes ./control/cfgdb
  • Without this change: 29.558s, 29.385s, 29.128s / mean 29.357
  • With this change: 33.243s, 34.611s, 31.700s / mean 33.185 (1.13x slowdown)

That's a bigger impact than I expected. Maybe worth doing some better measurement?

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