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

Also add new_with_buffer_capacity #4

Merged
merged 8 commits into from
Jan 13, 2023

Conversation

ryoqun
Copy link
Contributor

@ryoqun ryoqun commented Dec 10, 2022

we need to adjust the internal BufWriter capacity via its construction for best performance of super write intensive tasks: https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.with_capacity

so, add another method, not to break compatibility.

src/lib.rs Outdated Show resolved Hide resolved
@kevinhoffman
Copy link
Contributor

@ryoqun - thanks for the PR, looks good. Could you run cargo fmt and resubmit so it will pass the test suite? Also, perhaps modify the tests build_context function to accept a new Option(usize) capacity arg and call new or new_with_capacity as appropriate, and then add a new test to test that when a large capacity is specified things work as designed?

@kevinhoffman
Copy link
Contributor

@ryoqun - it also looks like clippy is failing now since chrono::TimeZone::ymd is deprecated it wants us to use with_ymd_and_hms -- chrono dependency could be explicitly advanced to require 0.4.23 and use the new function, or locked to 0.4.22 to avoid the deprecated function (might cause issues later). I'd be happy to address this first, or if you wanted to address that change with another commit in this PR too that is fine.

@ryoqun
Copy link
Contributor Author

ryoqun commented Jan 7, 2023

@kevinhoffman thanks for reply!

Could you run cargo fmt and resubmit so it will pass the test suite?

done

Also, perhaps modify the tests build_context function to accept a new Option(usize) capacity arg and call new or new_with_capacity as appropriate, and then add a new test to test that when a large capacity is specified things work as designed?

yeah done (mostly at 33bb6c6)

it also looks like clippy is failing now since chrono::TimeZone::ymd is deprecated it wants us to use with_ymd_and_hms -- chrono dependency could be explicitly advanced to require 0.4.23 and use the new function, or locked to 0.4.22 to avoid the deprecated function (might cause issues later). I'd be happy to address this first, or if you wanted to address that change with another commit in this PR too that is fine.

after some research and thought, i decided to bump chrono version. it seems that this is what other crates are doing according to https://crates.io/crates/chrono/reverse_dependencies.

@kevinhoffman
Copy link
Contributor

@ryoqun - wonderful. and thank you for fixing the clippy/chrono items too.

@kevinhoffman kevinhoffman merged commit 97ee27a into Axcient:main Jan 13, 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