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

pref: remove sync.Pool and prev allocate buffer for small tx #384

Merged
merged 4 commits into from
Jul 27, 2023
Merged

pref: remove sync.Pool and prev allocate buffer for small tx #384

merged 4 commits into from
Jul 27, 2023

Conversation

bigboss2063
Copy link
Member

@bigboss2063 bigboss2063 commented Jul 26, 2023

Based on issue #354, I have removed the usage of sync.pool. If it is a write transaction, it is always concurrency-safe. Instead, I have added a preallocated Buffer for reuse, and only transactions larger than this Buffer size will trigger a new Buffer.

tx.go Outdated Show resolved Hide resolved
@elliotchenzichang
Copy link
Member

I merge another PR just now. And there is raising some conflicts in this PR. Could you help resolve them? Thanks!

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #384 (f88034a) into master (a8e3cba) will increase coverage by 0.09%.
The diff coverage is 87.50%.

❗ Current head f88034a differs from pull request most recent head 407fd2e. Consider uploading reports for the commit 407fd2e to get more accurate results

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
+ Coverage   60.46%   60.55%   +0.09%     
==========================================
  Files          25       25              
  Lines        4320     4340      +20     
==========================================
+ Hits         2612     2628      +16     
- Misses       1494     1498       +4     
  Partials      214      214              
Files Changed Coverage Δ
options.go 66.10% <60.00%> (-4.27%) ⬇️
db.go 45.21% <100.00%> (+0.30%) ⬆️
tx.go 69.17% <100.00%> (+0.66%) ⬆️

tx.go Outdated Show resolved Hide resolved
tx.go Outdated Show resolved Hide resolved
@bigboss2063 bigboss2063 changed the title pref: remove sync.pool and prev allocate buffer for small tx pref: remove sync.Pool and prev allocate buffer for small tx Jul 27, 2023
tx.go Outdated Show resolved Hide resolved
Copy link
Member

@elliotchenzichang elliotchenzichang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for this contribution.

@elliotchenzichang elliotchenzichang merged commit fb0527b into nutsdb:master Jul 27, 2023
4 checks passed
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.

None yet

2 participants