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

Write messages directly onto message buffer instead of allocating on own buffer #283

Merged

Conversation

zainkabani
Copy link
Contributor

@zainkabani zainkabani commented Jan 16, 2023

pgbench -t 1000 -c 16 -j 2 --protocol extended -C:

PR:

Stats {
    allocations: 3873384,
    deallocations: 3870448,
    reallocations: 130708,
    bytes_allocated: 497650190,
    bytes_deallocated: 496466494,
    bytes_reallocated: 3722992,
}

Original:

Stats {
    allocations: 4578799,
    deallocations: 4575881,
    reallocations: 130689,
    bytes_allocated: 509003135,
    bytes_deallocated: 507846373,
    bytes_reallocated: 3716031,
}

Results in about a 15% decrease in allocations

pgbench -t 1000 -c 16 -j 2 --protocol extended:

PR

Stats {
    allocations: 2656700,
    deallocations: 2653782,
    reallocations: 2808,
    bytes_allocated: 65691251,
    bytes_deallocated: 64544049,
    bytes_reallocated: 742898,
}

Original

STATS: Stats {
    allocations: 3361868,
    deallocations: 3358897,
    reallocations: 2863,
    bytes_allocated: 77151598,
    bytes_deallocated: 75935794,
    bytes_reallocated: 757720,
}

Results in about a 20% decrease in allocations

@levkk
Copy link
Contributor

levkk commented Jan 17, 2023

This is very neat!

@levkk levkk merged commit ab0bad6 into postgresml:main Jan 17, 2023
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.

2 participants