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

Avoid copies #11451

Merged
merged 2 commits into from
Feb 4, 2020
Merged

Avoid copies #11451

merged 2 commits into from
Feb 4, 2020

Conversation

dvdplm
Copy link
Collaborator

@dvdplm dvdplm commented Feb 4, 2020

Prefer into_vec() over to_vec() of owned data to avoid unecessary copies. Maybe the compiler already sees this and optimizes it away, but yeah, better be explicit.

@dvdplm dvdplm self-assigned this Feb 4, 2020
@dvdplm dvdplm added A0-pleasereview 🤓 Pull request needs code review. A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). labels Feb 4, 2020
@dvdplm dvdplm marked this pull request as ready for review February 4, 2020 21:18
@niklasad1 niklasad1 merged commit 49f338a into master Feb 4, 2020
@niklasad1 niklasad1 deleted the dp/perf/dont-copy branch February 4, 2020 22:38
@niklasad1
Copy link
Collaborator

Prefer into_vec() over to_vec() of owned data to avoid unecessary copies. Maybe the compiler already sees this and optimizes it away, but yeah, better be explicit.

You are right, https://doc.rust-lang.org/src/alloc/slice.rs.html#138-161 to_vec does allocate which into_vec doesn't

ordian added a commit that referenced this pull request Feb 5, 2020
* master:
  gcc to clang (#11453)
  Avoid copies (#11451)
  Cargo.lock: cargo lock translate (#11448)
  Avoid long state queries when serving GetNodeData requests (#11444)
  Cargo.lock: cargo update -p kvdb-rocksdb (#11447)
dvdplm added a commit that referenced this pull request Feb 8, 2020
…pstream

* master:
  upgrade some of the dependencies (#11467)
  Some more release track changes to README.md (#11465)
  Update simple one-line installer due to switching to a single stable release track (#11463)
  update Dockerfile (#11461)
  Implement EIP-2124 (#11456)
  [eth classic chainspec]: remove `balance = 1` (#11459)
  just to make sure we don't screw up this again (#11455)
  backwards compatible call_type creation_method (#11450)
  gcc to clang (#11453)
  Avoid copies (#11451)
  Cargo.lock: cargo lock translate (#11448)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-pleasereview 🤓 Pull request needs code review. A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants