Skip to content

Commit

Permalink
release: 2023-03-28 (twilight-rs#2183)
Browse files Browse the repository at this point in the history
* release: 2023-03-26 updates

* fix
  • Loading branch information
zeylahellyer authored Apr 21, 2023
1 parent 9c74649 commit 35dfeec
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
- [Bots Using Twilight](./chapter_3_bots_using_twilight.md)
- [Versions](./versions/summary.md)
- [Version 0.15](./versions/0.15/summary.md)
- [2023-03-28 Updates](./versions/0.15/2023-03-28.md)
- [2023-02-26 Updates](./versions/0.15/2023-02-26.md)
52 changes: 52 additions & 0 deletions book/src/versions/0.15/2023-03-28.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 2023-03-28 Updates

We've published minor versions of a number of crates. This release is composed
of bugfixes, performance improvements, and documentation improvements.

## Bugfixes

The [gateway queue]'s [`DayLimiter`] now properly calculates when the session
resets.

The [`UpdateGuildSticker`] request now uses the specified audit log reason;
prior, it was accidentally ignoring the reason.

Discord's Clyde AI bot has a unique avatar hash. Unlike other hashes that are
hex based, Clyde's avatar hash is simply "clyde". We now handle deserialization
of Clyde's avatar in our [`ImageHash`] optimization.

## Documentation Improvements

The [`Event::IntegrationDelete`] and [`Event::IntegrationUpdate`] variants'
documentation was inversed, and has now been corrected.

[`Standby`] now has an example of how to timeout futures and streams.

## Performance Improvements

The gateway's [`CommandRatelimiter`] performance has been improved by over 98%,
with common calls being reduced from around 4 microseconds to around 57
nanoseconds. This is something that can be used by users, and is also used by
shards when sending commands, making common operations just a bit more speedy.
Impressive!

Avatars, banners, icons, and other assets are received as hashes, which we have
[`ImageHash`] for as a performance improvement in storage. Instead of storing
hashes as heap-allocated strings, we store them as 16 bytes on the stack.
The performance of the deserialization and parsing of hashes is now 38% faster.

Caching users received in [`InteractionCreate`] events is now a bit faster in
some situations due to [keying into a HashMap][`HashMap::get`] to check for the
existence of a user instead of [iterating over the HashMap][`HashMap::iter`].

[`CommandRatelimiter`]: https://docs.rs/twilight-gateway/0.15.2/twilight_gateway/struct.CommandRatelimiter.html
[`DayLimiter`]: https://docs.rs/twilight-gateway-queue/0.15.2/twilight_gateway_queue/struct.LocalQueue.html
[`Event::IntegrationDelete`]: https://docs.rs/twilight-model/0.15.2/twilight_model/gateway/event/enum.Event.html#variant.IntegrationDelete
[`Event::IntegrationUpdate`]: https://docs.rs/twilight-model/0.15.2/twilight_model/gateway/event/enum.Event.html#variant.IntegrationUpdate
[`HashMap::get`]: https://doc.rust-lang.org/stable/std/collections/hash_map/struct.HashMap.html#method.get
[`HashMap::iter`]: https://doc.rust-lang.org/stable/std/collections/hash_map/struct.HashMap.html#method.iter
[`ImageHash`]: https://docs.rs/twilight-model/0.15.2/twilight_model/util/image_hash/struct.ImageHash.html
[`InteractionCreate`]: https://docs.rs/twilight-model/0.15.2/twilight_model/gateway/payload/incoming/struct.InteractionCreate.html
[`Standby`]: https://docs.rs/twilight-standby/0.15.2/twilight_standby/struct.Standby.html
[`UpdateGuildSticker`]: https://docs.rs/twilight-http/0.15.2/twilight_http/request/guild/sticker/struct.UpdateGuildSticker.html
[gateway queue]: https://docs.rs/twilight-gateway-queue/0.15.2/twilight_gateway_queue/index.html
1 change: 1 addition & 0 deletions book/src/versions/summary.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Version History

- [0.15 - 2023-02-05](./0.15/summary.md)
- [0.15.2 - 2023-03-28](./0.15/2023-03-28.md)
- [0.15.1 - 2023-02-26](./0.15/2023-02-26.md)

0 comments on commit 35dfeec

Please sign in to comment.