paleolimbot commented on code in PR #590:
URL: https://github.com/apache/sedona-db/pull/590#discussion_r2802116363


##########
c/sedona-proj/src/lib.rs:
##########
@@ -19,5 +19,5 @@ mod proj;
 mod proj_dyn_bindgen;
 pub mod register;
 pub mod sd_order_lnglat;
-mod st_transform;
+pub mod st_transform;

Review Comment:
   Can this be reverted? (I don't see a reference to 
`with_global_proj_engine()` in this PR?)
   
   We should probably move the PROJ engine to its own public module and/or 
abstract it so we can switch to something faster for simple transforms.



##########
rust/sedona-schema/src/crs.rs:
##########
@@ -101,6 +108,55 @@ pub fn deserialize_crs_from_obj(crs_value: 
&serde_json::Value) -> Result<Crs> {
     Ok(Some(Arc::new(projjson)))
 }
 
+/// Translating CRS into integer SRID with a cache to avoid expensive CRS 
deserialization.
+pub struct CachedCrsToSRIDMapping {
+    cache: HashMap<Cow<'static, str>, u32>,
+}

Review Comment:
   Not for this PR, but the abbreviated CRS should probably have this too (I 
have a batch-local cache for st_setsrid):
   
   
https://github.com/apache/sedona-db/blob/cb713ef27b4e8a09e7b825a70c20c40be757ab38/rust/sedona-functions/src/st_setsrid.rs#L510-L542



##########
c/sedona-proj/src/st_transform.rs:
##########
@@ -427,6 +426,10 @@ pub(crate) fn with_global_proj_engine(
 static PROJ_ENGINE_BUILDER: RwLock<Option<ProjCrsEngineBuilder>> =
     RwLock::<Option<ProjCrsEngineBuilder>>::new(None);
 
+thread_local! {
+    static PROJ_CACHE_SIZE: OnceCell<usize> = const { OnceCell::new() };
+}

Review Comment:
   Is this used in this PR?



-- 
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