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

Add #[inline] for Uuid::from_bytes[_ref] and Uuid::{as,into}_bytes #693

Merged
merged 1 commit into from Jul 16, 2023

Conversation

jrose-signal
Copy link
Contributor

As seen in this playground, neither from_bytes nor from_bytes_ref are currently inlined by the compiler even though they are const, resulting in less efficient generated code for these trivial functions, even with Thin LTO enabled. There's a slippery slope here for what counts as "trivial", but the functions that do not change representations are a pretty safe bet.

(I didn't include the Builder versions of the same functions, because the next thing you do with a Builder is likely to be a function call anyway, but it could go either way.)

@jrose-signal jrose-signal changed the title Add #[inline] for Uuid::from_bytes and Uuid::from_bytes_ref Add #[inline] for Uuid::from_bytes[_ref] and Uuid::{as,into}_bytes Jul 12, 2023
Copy link
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

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

Thanks @jrose-signal! This looks good to me.

@KodrAus KodrAus merged commit 6b0cfb2 into uuid-rs:main Jul 16, 2023
19 checks passed
kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Jul 17, 2023
Bumps uuid from 1.4.0 to 1.4.1.

Release notes
Sourced from uuid's releases.

1.4.1
What's Changed

Fix macro hygiene by @​teohhanhui in uuid-rs/uuid#694
Add #[inline] for Uuid::from_bytes[_ref] and Uuid::{as,into}_bytes by @​jrose-signal in uuid-rs/uuid#693
Print uuids in examples by @​KodrAus in uuid-rs/uuid#697
Prepare for 1.4.1 release by @​KodrAus in uuid-rs/uuid#698

New Contributors

@​teohhanhui made their first contribution in uuid-rs/uuid#694
@​jrose-signal made their first contribution in uuid-rs/uuid#693

Full Changelog: uuid-rs/uuid@1.4.0...1.4.1



Commits

97b7f07 Merge pull request #698 from uuid-rs/cargo/1.4.1
8e930cf prepare for 1.4.1 release
0041b3b Merge pull request #697 from uuid-rs/chore/example-printing
5a1f3f5 use uuid_unstable
6b0cfb2 Merge pull request #693 from jrose-signal/inline-from_bytes
33f6b3e print uuids in examples
bd7df72 Merge pull request #694 from teohhanhui/fix/macro-hygiene
1d1ae31 Fix macro hygiene
317d925 Add #[inline] for Uuid::from_bytes[_ref] and Uuid::{as,into}_bytes
See full diff in compare view




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 commands and options

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 close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor 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)
akrantz01 pushed a commit to akrantz01/lers that referenced this pull request Jul 17, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [uuid](https://togithub.com/uuid-rs/uuid) | dependencies | minor |
`1.3.4` -> `1.4.1` |

---

### Release Notes

<details>
<summary>uuid-rs/uuid (uuid)</summary>

### [`v1.4.1`](https://togithub.com/uuid-rs/uuid/releases/tag/1.4.1)

[Compare
Source](https://togithub.com/uuid-rs/uuid/compare/1.4.0...1.4.1)

#### What's Changed

- Fix macro hygiene by
[@&#8203;teohhanhui](https://togithub.com/teohhanhui) in
[uuid-rs/uuid#694
- Add #\[inline] for Uuid::from_bytes\[\_ref] and Uuid::{as,into}\_bytes
by [@&#8203;jrose-signal](https://togithub.com/jrose-signal) in
[uuid-rs/uuid#693
- Print uuids in examples by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#697
- Prepare for 1.4.1 release by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#698

#### New Contributors

- [@&#8203;teohhanhui](https://togithub.com/teohhanhui) made their first
contribution in
[uuid-rs/uuid#694
- [@&#8203;jrose-signal](https://togithub.com/jrose-signal) made their
first contribution in
[uuid-rs/uuid#693

**Full Changelog**:
uuid-rs/uuid@1.4.0...1.4.1

### [`v1.4.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.4.0)

[Compare
Source](https://togithub.com/uuid-rs/uuid/compare/1.3.4...1.4.0)

#### What's Changed

- Fixed wasm tests not running due to incorrect attribute target by
[@&#8203;kmusick](https://togithub.com/kmusick) in
[uuid-rs/uuid#688
- Fixing issue with Cloudflare Workers and wasm32-unknown-unknown when
using now() by [@&#8203;kmusick](https://togithub.com/kmusick) in
[uuid-rs/uuid#690
- Add `borsh` support by
[@&#8203;grovesNL](https://togithub.com/grovesNL) in
[uuid-rs/uuid#686
- Fix some timestamp generation by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#691
- Prepare for 1.4.0 release by
[@&#8203;KodrAus](https://togithub.com/KodrAus) in
[uuid-rs/uuid#692

#### New Contributors

- [@&#8203;kmusick](https://togithub.com/kmusick) made their first
contribution in
[uuid-rs/uuid#688
- [@&#8203;grovesNL](https://togithub.com/grovesNL) made their first
contribution in
[uuid-rs/uuid#686

**Full Changelog**:
uuid-rs/uuid@1.3.4...1.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/akrantz01/lers).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDEuMyIsInVwZGF0ZWRJblZlciI6IjM2LjguMTEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@jrose-signal jrose-signal deleted the inline-from_bytes branch July 17, 2023 18:15
crapStone added a commit to Calciumdibromid/CaBr2 that referenced this pull request Jul 17, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [uuid](https://github.com/uuid-rs/uuid) | dependencies | patch | `1.4.0` -> `1.4.1` |

---

### Release Notes

<details>
<summary>uuid-rs/uuid (uuid)</summary>

### [`v1.4.1`](https://github.com/uuid-rs/uuid/releases/tag/1.4.1)

[Compare Source](uuid-rs/uuid@1.4.0...1.4.1)

#### What's Changed

-   Fix macro hygiene by [@&#8203;teohhanhui](https://github.com/teohhanhui) in uuid-rs/uuid#694
-   Add #\[inline] for Uuid::from_bytes\[\_ref] and Uuid::{as,into}\_bytes by [@&#8203;jrose-signal](https://github.com/jrose-signal) in uuid-rs/uuid#693
-   Print uuids in examples by [@&#8203;KodrAus](https://github.com/KodrAus) in uuid-rs/uuid#697
-   Prepare for 1.4.1 release by [@&#8203;KodrAus](https://github.com/KodrAus) in uuid-rs/uuid#698

#### New Contributors

-   [@&#8203;teohhanhui](https://github.com/teohhanhui) made their first contribution in uuid-rs/uuid#694
-   [@&#8203;jrose-signal](https://github.com/jrose-signal) made their first contribution in uuid-rs/uuid#693

**Full Changelog**: uuid-rs/uuid@1.4.0...1.4.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44LjExIiwidXBkYXRlZEluVmVyIjoiMzYuOC4xMSIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AifQ==-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Co-authored-by: crapStone <crapstone01@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1962
Reviewed-by: crapStone <crapstone01@gmail.com>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
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