mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
6f304d197d
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.
25 lines
685 B
TOML
25 lines
685 B
TOML
[package]
|
|
name = "jid"
|
|
version = "0.9.4"
|
|
authors = [
|
|
"lumi <lumi@pew.im>",
|
|
"Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>",
|
|
"Maxime “pep” Buquet <pep@bouah.net>",
|
|
]
|
|
description = "A crate which provides a Jid struct for Jabber IDs."
|
|
homepage = "https://gitlab.com/xmpp-rs/xmpp-rs"
|
|
repository = "https://gitlab.com/xmpp-rs/xmpp-rs"
|
|
documentation = "https://docs.rs/jid"
|
|
readme = "README.md"
|
|
keywords = ["xmpp", "jid"]
|
|
license = "MPL-2.0"
|
|
edition = "2018"
|
|
|
|
[badges]
|
|
gitlab = { repository = "xmpp-rs/xmpp-rs" }
|
|
|
|
[dependencies]
|
|
memchr = "2.5"
|
|
minidom = { version = "0.15", optional = true }
|
|
serde = { version = "1.0", features = ["derive"], optional = true }
|
|
stringprep = "0.1.3"
|