google / zetasketch

A collection of libraries for single-pass, distributed, sublinear-space approximate aggregation and sketching algorithms. Currently: HyperLogLog++; more to come.
Apache License 2.0
150 stars 23 forks source link

[question] Is this optimization valid? #8

Closed travis-madhive closed 4 years ago

travis-madhive commented 4 years ago

Is this optimization valid? If I understand correctly, Java arrays are objects, and therefore wouldn't be boxed.

https://github.com/google/zetasketch/blob/a2f2692fae8cf61103330f9f70e696c4ba8b94b0/java/com/google/zetasketch/HyperLogLogPlusPlus.java#L188-L197

robinyqiu commented 4 years ago

I believe "boxing" here does not refer to the Java autoboxing (e.g. int -> Integer). It means that caller of add() can call this function directly if they have a byte[] ready, instead of calling add(Object) which they have to box byte[] into ByteString.

travis-madhive commented 4 years ago

Ah, I see. Okay, thanks for the quick response!