ben-manes commented on pull request #4218: URL: https://github.com/apache/iceberg/pull/4218#issuecomment-1057240621
https://github.com/apache/iceberg/blob/c45b8b4c6e4d3e0ff5e7ce8ea4ed7296d6e1b12d/core/src/main/java/org/apache/iceberg/data/GenericRecord.java#L36-L46 Note that this uses identity (`==`) equality for key lookup. If you are using equivalent (`.equals(o)`) instances instead then this will be a cache miss and the cache won't be providing much value. Since it is weak keys this seems like a likely mistake and of course lets the GC collect aggressively, so you might not get a lot of reuse. It is often a helpful feature for cases like caching request-scoped data, and I'm not familiar enough with the code base to assess if this is a problematic usage. Typically a bounded cache is better and more explicit, but does require some mental effort to decide on a decent maximum size. Otherwise if should perform similarly to a ConcurrentHashMap from the caller's perspective. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org