Dandandan commented on code in PR #7808:
URL: https://github.com/apache/arrow-rs/pull/7808#discussion_r2173436812


##########
parquet-variant/src/builder.rs:
##########
@@ -233,14 +233,14 @@ impl ValueBuffer {
 
 #[derive(Default)]
 struct MetadataBuilder {
-    field_name_to_id: BTreeMap<String, u32>,
+    field_name_to_id: HashMap<String, u32>,

Review Comment:
   I think you could store a `&str` here avoiding a `to_string()` (allocation) 
in the hot loop.



##########
parquet-variant/src/builder.rs:
##########
@@ -233,14 +233,14 @@ impl ValueBuffer {
 
 #[derive(Default)]
 struct MetadataBuilder {
-    field_name_to_id: BTreeMap<String, u32>,
+    field_name_to_id: HashMap<String, u32>,

Review Comment:
   You could use a hashmap with `ahash` as hasher, getting some more speed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to