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

Performance Optimizations #45

Merged
4 commits merged into from Apr 26, 2016
Merged

Performance Optimizations #45

4 commits merged into from Apr 26, 2016

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2016

This change also adds quite a few benchmarks, and minor performance tweaks.

  • Rather then preallocating the array as a giant block of 1M EIDS, we build it sparsely. Memory is lazily added in a thread safe way.
    • The world::world_new benchmark is improved from ~1MS to 37us on my machine.
  • allocate() used a compare-and-exchange when a store would have worked.
    • Reduced allocation times from 51us -> 41us

This bring specs back up the performance it had prior to #44

@ghost ghost changed the title Make the AtomicBitSet sparse Performance Optimizations Apr 26, 2016
@@ -26,3 +26,4 @@ pulse = "0.5"
threadpool = "1.0"
fnv = "1.0"
tuple_utils="0.2"
atom = "0.3"
Copy link
Member

Choose a reason for hiding this comment

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

new line missing

@kvark
Copy link
Member

kvark commented Apr 26, 2016

Looks great! Special thanks for the benchmarks 👍
Please merge when ready.

@ghost ghost merged commit 0c220f2 into amethyst:master Apr 26, 2016
xMAC94x pushed a commit to xMAC94x/specs that referenced this pull request Mar 10, 2021
126: Update hashbrown requirement from 0.1.7 to 0.2.0 r=torkleyy a=dependabot[bot]

Updates the requirements on [hashbrown](https://github.com/Amanieu/hashbrown) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [hashbrown's changelog](https://github.com/Amanieu/hashbrown/blob/master/CHANGELOG.md).*

> ## [v0.2.0] - 2019-03-31
> 
> ### Changed
> - The code has been updated to Rust 2018 edition. This means that the minimum
>   Rust version has been bumped to 1.31 (2018 edition).
> 
> ### Added
> - Added `insert_with_hasher` to the raw_entry API to allow `K: !(Hash + Eq)`. ([amethyst#54](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/54))
> - Added support for using hashbrown as the hash table implementation in libstd. ([amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46))
> 
> ### Fixed
> - Fixed cargo build with minimal-versions. ([amethyst#45](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/45))
> - Fixed `#[may_dangle]` attributes to match the libstd `HashMap`. ([amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46))
> - ZST keys and values are now handled properly. ([amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46))
> 
> ## [v0.1.8] - 2019-01-14
> 
> ### Added
> - Rayon parallel iterator support ([amethyst#37](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/37))
> - `raw_entry` support ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> - `#[may_dangle]` on nightly ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> - `try_reserve` support ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> 
> ### Fixed
> - Fixed variance on `IterMut`. ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> 
> ## [v0.1.7] - 2018-12-05
> 
> ### Fixed
> - Fixed non-SSE version of convert_special_to_empty_and_full_to_deleted. ([amethyst#32](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/32))
> - Fixed overflow in rehash_in_place. ([amethyst#33](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/33))
> 
> ## [v0.1.6] - 2018-11-17
> 
> ### Fixed
> - Fixed compile error on nightly. ([amethyst#29](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/29))
> 
> ## [v0.1.5] - 2018-11-08
> 
> ### Fixed
> - Fixed subtraction overflow in generic::Group::match_byte. ([amethyst#28](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/28))
> 
> ## [v0.1.4] - 2018-11-04
> 
> ### Fixed
> - Fixed a bug in the `erase_no_drop` implementation. ([amethyst#26](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/26))
> 
> ## [v0.1.3] - 2018-11-01
> 
> ### Added
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`af90bc9`](Amanieu/hashbrown@af90bc9) Version 0.2.0
- [`83ce3d5`](Amanieu/hashbrown@83ce3d5) Merge [amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46)
- [`f9bcc42`](Amanieu/hashbrown@f9bcc42) Add #[may_dangle] to RawIntoIter
- [`b11f8cd`](Amanieu/hashbrown@b11f8cd) Upgrade to 2018 edition
- [`2bd15ed`](Amanieu/hashbrown@2bd15ed) Apply feedback from https://github-redirect.dependabot.com/rust-lang/rust/pull/56241
- [`91d3e4a`](Amanieu/hashbrown@91d3e4a) Merge [amethyst#55](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/55)
- [`49a9d6c`](Amanieu/hashbrown@49a9d6c) use --exclude-should-panic
- [`c36d49a`](Amanieu/hashbrown@c36d49a) install Miri via rustup
- [`332db4d`](Amanieu/hashbrown@332db4d) Prepare hashbrown for inclusion in the standard library
- [`edf79d0`](Amanieu/hashbrown@edf79d0) Merge [amethyst#54](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/54)
- Additional commits viewable in [compare view](Amanieu/hashbrown@v0.1.7...v0.2.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <[email protected]>
xMAC94x pushed a commit to xMAC94x/specs that referenced this pull request Mar 10, 2021
135: Update hashbrown requirement from 0.2.0 to 0.3.0 r=torkleyy a=dependabot[bot]

Updates the requirements on [hashbrown](https://github.com/Amanieu/hashbrown) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [hashbrown's changelog](https://github.com/Amanieu/hashbrown/blob/master/CHANGELOG.md).*

> ## [v0.3.0] - 2019-04-23
> 
> ### Changed
> - Changed shrink_to to not panic if min_capacity < capacity. ([amethyst#67](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/67))
> 
> ### Fixed
> - Worked around emscripten bug emscripten-core/emscripten-fastcomp#258. ([amethyst#66](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/66))
> 
> ## [v0.2.2] - 2019-04-16
> 
> ### Fixed
> - Inlined non-nightly lowest_set_bit_nonzero. ([amethyst#64](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/64))
> - Fixed build on latest nightly. ([amethyst#65](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/65))
> 
> ## [v0.2.1] - 2019-04-14
> 
> ### Changed
> - Use for_each in map Extend and FromIterator. ([amethyst#58](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/58))
> - Improved worst-case performance of HashSet.is_subset. ([amethyst#61](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/61))
> 
> ### Fixed
> - Removed incorrect debug_assert. ([amethyst#60](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/60))
> 
> ## [v0.2.0] - 2019-03-31
> 
> ### Changed
> - The code has been updated to Rust 2018 edition. This means that the minimum
>   Rust version has been bumped to 1.31 (2018 edition).
> 
> ### Added
> - Added `insert_with_hasher` to the raw_entry API to allow `K: !(Hash + Eq)`. ([amethyst#54](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/54))
> - Added support for using hashbrown as the hash table implementation in libstd. ([amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46))
> 
> ### Fixed
> - Fixed cargo build with minimal-versions. ([amethyst#45](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/45))
> - Fixed `#[may_dangle]` attributes to match the libstd `HashMap`. ([amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46))
> - ZST keys and values are now handled properly. ([amethyst#46](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/46))
> 
> ## [v0.1.8] - 2019-01-14
> 
> ### Added
> - Rayon parallel iterator support ([amethyst#37](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/37))
> - `raw_entry` support ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> - `#[may_dangle]` on nightly ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> - `try_reserve` support ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> 
> ### Fixed
> - Fixed variance on `IterMut`. ([amethyst#31](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/31))
> 
> ## [v0.1.7] - 2018-12-05
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`7e79b0c`](Amanieu/hashbrown@7e79b0c) Version 0.3.0
- [`7e2da14`](Amanieu/hashbrown@7e2da14) Merge [amethyst#67](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/67)
- [`8ec72d0`](Amanieu/hashbrown@8ec72d0) Change shrink_to to not panic if min_capacity < capacity
- [`ddf59a9`](Amanieu/hashbrown@ddf59a9) Merge [amethyst#66](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/66)
- [`6eddbe4`](Amanieu/hashbrown@6eddbe4) Work around emscripten bug emscripten-core/emscripten-fastcomp#258
- [`7dbd666`](Amanieu/hashbrown@7dbd666) Version 0.2.2
- [`12e8bb9`](Amanieu/hashbrown@12e8bb9) Merge [amethyst#64](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/64)
- [`a657af5`](Amanieu/hashbrown@a657af5) Merge [amethyst#65](https://github-redirect.dependabot.com/Amanieu/hashbrown/issues/65)
- [`373a9d4`](Amanieu/hashbrown@373a9d4) Fix warning on latest nightly
- [`79c5b41`](Amanieu/hashbrown@79c5b41) Inline non-nightly lowest_set_bit_nonzero
- Additional commits viewable in [compare view](Amanieu/hashbrown@v0.2.0...v0.3.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <[email protected]>
xMAC94x pushed a commit to xMAC94x/specs that referenced this pull request Mar 10, 2021
142: Update hashbrown requirement from 0.3.0 to 0.4.0 r=torkleyy a=dependabot-preview[bot]

Updates the requirements on [hashbrown](https://github.com/rust-lang/hashbrown) to permit the latest version.
<details>
<summary>Changelog</summary>

*Sourced from [hashbrown's changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md).*

> ## [v0.4.0] - 2019-05-30
> 
> ### Fixed
> - Fixed `Send` trait bounds on `IterMut` not matching the libstd one. ([amethyst#82](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/82))
> 
> ## [v0.3.1] - 2019-05-30
> 
> ### Fixed
> - Fixed incorrect use of slice in unsafe code. ([amethyst#80](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/80))
> 
> ## [v0.3.0] - 2019-04-23
> 
> ### Changed
> - Changed shrink_to to not panic if min_capacity < capacity. ([amethyst#67](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/67))
> 
> ### Fixed
> - Worked around emscripten bug emscripten-core/emscripten-fastcomp#258. ([amethyst#66](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/66))
> 
> ## [v0.2.2] - 2019-04-16
> 
> ### Fixed
> - Inlined non-nightly lowest_set_bit_nonzero. ([amethyst#64](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/64))
> - Fixed build on latest nightly. ([amethyst#65](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/65))
> 
> ## [v0.2.1] - 2019-04-14
> 
> ### Changed
> - Use for_each in map Extend and FromIterator. ([amethyst#58](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/58))
> - Improved worst-case performance of HashSet.is_subset. ([amethyst#61](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/61))
> 
> ### Fixed
> - Removed incorrect debug_assert. ([amethyst#60](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/60))
> 
> ## [v0.2.0] - 2019-03-31
> 
> ### Changed
> - The code has been updated to Rust 2018 edition. This means that the minimum
>   Rust version has been bumped to 1.31 (2018 edition).
> 
> ### Added
> - Added `insert_with_hasher` to the raw_entry API to allow `K: !(Hash + Eq)`. ([amethyst#54](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/54))
> - Added support for using hashbrown as the hash table implementation in libstd. ([amethyst#46](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/46))
> 
> ### Fixed
> - Fixed cargo build with minimal-versions. ([amethyst#45](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/45))
> - Fixed `#[may_dangle]` attributes to match the libstd `HashMap`. ([amethyst#46](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/46))
> - ZST keys and values are now handled properly. ([amethyst#46](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/46))
> 
> ## [v0.1.8] - 2019-01-14
> 
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`987b962`](rust-lang/hashbrown@987b962) Version 0.4.0
- [`a9ddbcf`](rust-lang/hashbrown@a9ddbcf) Auto merge of [amethyst#82](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/82) - Amanieu:itermut_send, r=Amanieu
- [`a4eba4f`](rust-lang/hashbrown@a4eba4f) Fix the bounds on K for the Send impl of IterMut
- [`1889600`](rust-lang/hashbrown@1889600) Version 0.3.1
- [`c765ea0`](rust-lang/hashbrown@c765ea0) Auto merge of [amethyst#80](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/80) - RalfJung:raw, r=Amanieu
- [`2693d12`](rust-lang/hashbrown@2693d12) cast the entire slice to a raw pointer, not just the first element
- [`4368aa4`](rust-lang/hashbrown@4368aa4) Auto merge of [amethyst#78](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/78) - RalfJung:miri, r=Amanieu
- [`419f2ac`](rust-lang/hashbrown@419f2ac) skip Miri tests if the setup fails
- [`538d149`](rust-lang/hashbrown@538d149) Merge pull request [amethyst#77](https://github-redirect.dependabot.com/rust-lang/hashbrown/issues/77) from lzutao/refresh-doc
- [`70afa1b`](rust-lang/hashbrown@70afa1b) Use docs.rs badge
- Additional commits viewable in [compare view](rust-lang/hashbrown@v0.3.0...v0.4.0)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

[//]: # (dependabot-acquisition-announcement-start)

---

<a href='https://dependabot.com/blog/hello-github/'><img width='376' alt='Dependabot has been acquired by GitHub  🎉' src='https://user-images.githubusercontent.com/20165/58035530-e739b700-7b20-11e9-9d1b-12a7630b84e0.png'></a>

[//]: # (dependabot-acquisition-announcement-end)

Co-authored-by: dependabot-preview[bot] <dependabot-preview[bot]@users.noreply.github.com>
This pull request was closed.
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