xmpp-rs/jid
Emmanuel Gil Peyrot 6f304d197d jid: Optimise for no-transform JIDs
stringprep can make transformations to a JID, the most well-known one is
making the nodepart and domainpart lowercase but it does much more than
that.

It is extremely common to have to validate already-normalised JIDs
though, and since https://github.com/sfackler/rust-stringprep/pull/4
this is exactly what the stringprep crate does, by returning
Cow::Borrowed() for common ASCII-only cases.

This commit further reduces time spent by an additional -15%..-58% when
already using this stringprep improvement, in addition to the
89.5%..98.5% change brought by this improvement (and +1.3% total when
the JID isn’t normalised yet).

For instance, my own full JID parses in 1.83 µs before these changes,
132 ns with just the stringprep optimisation, and 46 ns with also this
commit, on an i7-8700K.
2023-07-16 19:50:12 +02:00
..
src jid: Optimise for no-transform JIDs 2023-07-16 19:50:12 +02:00
Cargo.toml jid: Optimise for no-transform JIDs 2023-07-16 19:50:12 +02:00
CHANGELOG.md jid: Optimise for no-transform JIDs 2023-07-16 19:50:12 +02:00
LICENSE Remove the -rs suffix of jid, minidom and xmpp 2020-06-22 02:17:32 +02:00
README.md Finish removing 'rs' suffix in libs 2020-07-15 10:49:50 +02:00

jid

What's this?

A crate which provides a struct Jid for Jabber IDs. It's used in xmpp-rs but other XMPP libraries can of course use this.

What license is it under?

MPL-2.0 or later, see the LICENSE file.

Notes

This library does not yet implement RFC7622.