Skip to content

Commit

Permalink
Improve Get call performance by replacing regex with glob matching li…
Browse files Browse the repository at this point in the history
…b for wildcard handling
  • Loading branch information
rafaeling committed Jun 6, 2024
1 parent b456407 commit aea1aea
Show file tree
Hide file tree
Showing 6 changed files with 1,676 additions and 65 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions databroker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
jsonwebtoken = "9.1.0"
regex = "1.7.1"
glob-match = "0.2.1"

jemallocator = { version = "0.5.0", optional = true }
lazy_static = "1.4.0"
Expand Down
2 changes: 2 additions & 0 deletions databroker/src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub enum RegistrationError {
pub struct Metadata {
pub id: i32,
pub path: String,
pub glob_path: String,
pub data_type: DataType,
pub entry_type: EntryType,
pub change_type: ChangeType,
Expand Down Expand Up @@ -1155,6 +1156,7 @@ impl<'a, 'b> DatabaseWriteAccess<'a, 'b> {
metadata: Metadata {
id: temp_id,
path: name.clone(),
glob_path: name.replace('.', "/"),
data_type,
change_type,
entry_type,
Expand Down
Loading

0 comments on commit aea1aea

Please sign in to comment.