Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Use BufReader and BufWriter #684

Merged
merged 2 commits into from
Sep 7, 2018
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Sep 7, 2018

Fixes all the performances issues, and should also fix most of the weird disconnects.

@@ -101,7 +101,7 @@ impl NetTopology {
};

let file = fs::File::create(path)?;
serialize(file, &self.store)
serialize(BufWriter::with_capacity(1024 * 1024, file), &self.store)
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, how did you get to 1Mb being a good value here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering that the file is 45MB right now, the default of 8kB looked a bit too low to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

So why 1? Why not 2? Or 5 or 45?

Copy link
Contributor Author

@tomaka tomaka Sep 7, 2018

Choose a reason for hiding this comment

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

Well, an arbitrary value had to be set.
Ideally we would benchmark multiple values, but this doesn't seem very productive to me at this stage.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree with @tomaka , TODO wouldn't hurt though

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

lgtm

@dvdplm
Copy link
Contributor

dvdplm commented Sep 7, 2018

Build is stumbling on the panic_handler.

@pepyakin
Copy link
Contributor

pepyakin commented Sep 7, 2018

Should be fixed by rebasing to the tip of the master

@gavofyork gavofyork merged commit 1c8ff0d into paritytech:master Sep 7, 2018
@tomaka tomaka deleted the buffering-file branch September 7, 2018 17:39
dvdplm added a commit that referenced this pull request Sep 8, 2018
…rs-generic-over-hasher-and-rlpcodec

* origin/master:
  Fixed sync stalling when import queue is full (#691)
  New extrinsic dispatch model (#678)
  remove parachain's Cargo.lock (#682)
  Implement json metadata for outer events (#672)
  Improvements to the Kademlia system (#688)
  Use BufReader and BufWriter (#684)
  Switch to using parity/rust:substrate which has rust nightly-2018-08-31 (#686)
  Update to latest libp2p (#673)
  Implement storage json metadata (#670)
  impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests) (#665)
  Speedup compilation (#671)
  Remove requirement of function indices for decl_module! (#666)
  DigestItem trait (v2) (#650)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants