You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by GitBox <gi...@apache.org> on 2021/01/28 04:18:59 UTC

[GitHub] [datasketches-cpp] AlexanderSaydakov opened a new pull request #186: HLL allocator

AlexanderSaydakov opened a new pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] coveralls edited a comment on pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#issuecomment-772109138


   ## Pull Request Test Coverage Report for [Build 532041513](https://coveralls.io/builds/36807009)
   
   * **214** of **244**   **(87.7%)**  changed or added relevant lines in **25** files are covered.
   * **4** unchanged lines in **2** files lost coverage.
   * Overall coverage increased (+**0.5%**) to **94.334%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [hll/include/HllSketch-internal.hpp](https://coveralls.io/builds/36807009/source?filename=hll%2Finclude%2FHllSketch-internal.hpp#L48) | 2 | 3 | 66.67%
   | [hll/include/HllUnion-internal.hpp](https://coveralls.io/builds/36807009/source?filename=hll%2Finclude%2FHllUnion-internal.hpp#L204) | 2 | 3 | 66.67%
   | [tuple/include/tuple_sketch_impl.hpp](https://coveralls.io/builds/36807009/source?filename=tuple%2Finclude%2Ftuple_sketch_impl.hpp#L241) | 0 | 2 | 0.0%
   | [theta/include/theta_sketch_impl.hpp](https://coveralls.io/builds/36807009/source?filename=theta%2Finclude%2Ftheta_sketch_impl.hpp#L60) | 50 | 76 | 65.79%
   <!-- | **Total:** | **214** | **244** | **87.7%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [theta/include/theta_sketch_impl.hpp](https://coveralls.io/builds/36807009/source?filename=theta%2Finclude%2Ftheta_sketch_impl.hpp#L233) | 1 | 31.25% |
   | [common/include/conditional_back_inserter.hpp](https://coveralls.io/builds/36807009/source?filename=common%2Finclude%2Fconditional_back_inserter.hpp#L43) | 3 | 53.85% |
   <!-- | **Total:** | **4** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/36807009/badge)](https://coveralls.io/builds/36807009) |
   | :-- | --: |
   | Change from base [Build 521644039](https://coveralls.io/builds/36706668): |  0.5% |
   | Covered Lines: | 4462 |
   | Relevant Lines: | 4730 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] AlexanderSaydakov commented on a change in pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
AlexanderSaydakov commented on a change in pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#discussion_r574003409



##########
File path: hll/include/HllUnion-internal.hpp
##########
@@ -226,7 +201,7 @@ HllSketchImpl<A>* hll_union_alloc<A>::copy_or_downsample(const HllSketchImpl<A>*
     return src->copyAs(HLL_8);
   }
   typedef typename std::allocator_traits<A>::template rebind_alloc<Hll8Array<A>> hll8Alloc;

Review comment:
       Missed this one. Purely a matter of style.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] AlexanderSaydakov commented on a change in pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
AlexanderSaydakov commented on a change in pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#discussion_r574002759



##########
File path: hll/include/Hll4Array-internal.hpp
##########
@@ -315,12 +316,12 @@ void Hll4Array<A>::shiftToBiggerCurMin() {
 
 template<typename A>
 typename HllArray<A>::const_iterator Hll4Array<A>::begin(bool all) const {
-  return typename HllArray<A>::const_iterator(this->hllByteArr, 1 << this->lgConfigK, 0, this->tgtHllType, auxHashMap, this->curMin, all);
+  return typename HllArray<A>::const_iterator(this->hllByteArr.data(), 1 << this->lgConfigK, 0, this->tgtHllType, auxHashMap, this->curMin, all);

Review comment:
       Perhaps. It is purely cosmetic and internal. Let's not worry about this right now.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] jmalkin commented on a change in pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
jmalkin commented on a change in pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#discussion_r573584317



##########
File path: hll/include/HllUnion-internal.hpp
##########
@@ -226,7 +201,7 @@ HllSketchImpl<A>* hll_union_alloc<A>::copy_or_downsample(const HllSketchImpl<A>*
     return src->copyAs(HLL_8);
   }
   typedef typename std::allocator_traits<A>::template rebind_alloc<Hll8Array<A>> hll8Alloc;

Review comment:
       Surprised this wasn't replaced with using :)

##########
File path: hll/include/Hll4Array-internal.hpp
##########
@@ -315,12 +316,12 @@ void Hll4Array<A>::shiftToBiggerCurMin() {
 
 template<typename A>
 typename HllArray<A>::const_iterator Hll4Array<A>::begin(bool all) const {
-  return typename HllArray<A>::const_iterator(this->hllByteArr, 1 << this->lgConfigK, 0, this->tgtHllType, auxHashMap, this->curMin, all);
+  return typename HllArray<A>::const_iterator(this->hllByteArr.data(), 1 << this->lgConfigK, 0, this->tgtHllType, auxHashMap, this->curMin, all);

Review comment:
       I feel like we should probably make the iterator take the std::vector at some point.

##########
File path: hll/include/HllSketchImplFactory.hpp
##########
@@ -157,8 +159,9 @@ Hll6Array<A>* HllSketchImplFactory<A>::convertToHll6(const HllArray<A>& srcHllAr
 template<typename A>
 Hll8Array<A>* HllSketchImplFactory<A>::convertToHll8(const HllArray<A>& srcHllArr) {
   const int lgConfigK = srcHllArr.getLgConfigK();
-  typedef typename std::allocator_traits<A>::template rebind_alloc<Hll8Array<A>> hll8Alloc;
-  Hll8Array<A>* hll8Array = new (hll8Alloc().allocate(1)) Hll8Array<A>(lgConfigK, srcHllArr.isStartFullSize());
+  using Hll8Alloc = typename std::allocator_traits<A>::template rebind_alloc<Hll8Array<A>>;
+  Hll8Array<A>* hll8Array = new (Hll8Alloc(srcHllArr.getAllocator()).allocate(1))

Review comment:
       I'm always torn on whether we should define `auto srcAllocator = srcHllArr.getAllocator()` in cases like this since we use it twice and it gets a little verbose to read. Two uses like this is sort of a wash I guess?
   
   It's perfectly fine as is, I'm just not sure if we should have a preferred style?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] AlexanderSaydakov merged pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
AlexanderSaydakov merged pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] coveralls commented on pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#issuecomment-772109138


   ## Pull Request Test Coverage Report for [Build 532130414](https://coveralls.io/builds/36808119)
   
   * **214** of **244**   **(87.7%)**  changed or added relevant lines in **25** files are covered.
   * **4** unchanged lines in **2** files lost coverage.
   * Overall coverage increased (+**0.5%**) to **94.334%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [hll/include/HllSketch-internal.hpp](https://coveralls.io/builds/36808119/source?filename=hll%2Finclude%2FHllSketch-internal.hpp#L48) | 2 | 3 | 66.67%
   | [hll/include/HllUnion-internal.hpp](https://coveralls.io/builds/36808119/source?filename=hll%2Finclude%2FHllUnion-internal.hpp#L204) | 2 | 3 | 66.67%
   | [tuple/include/tuple_sketch_impl.hpp](https://coveralls.io/builds/36808119/source?filename=tuple%2Finclude%2Ftuple_sketch_impl.hpp#L241) | 0 | 2 | 0.0%
   | [theta/include/theta_sketch_impl.hpp](https://coveralls.io/builds/36808119/source?filename=theta%2Finclude%2Ftheta_sketch_impl.hpp#L60) | 50 | 76 | 65.79%
   <!-- | **Total:** | **214** | **244** | **87.7%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [theta/include/theta_sketch_impl.hpp](https://coveralls.io/builds/36808119/source?filename=theta%2Finclude%2Ftheta_sketch_impl.hpp#L233) | 1 | 31.25% |
   | [common/include/conditional_back_inserter.hpp](https://coveralls.io/builds/36808119/source?filename=common%2Finclude%2Fconditional_back_inserter.hpp#L43) | 3 | 53.85% |
   <!-- | **Total:** | **4** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/36808119/badge)](https://coveralls.io/builds/36808119) |
   | :-- | --: |
   | Change from base [Build 521644039](https://coveralls.io/builds/36706668): |  0.5% |
   | Covered Lines: | 4462 |
   | Relevant Lines: | 4730 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] coveralls commented on pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#issuecomment-772109138


   ## Pull Request Test Coverage Report for [Build 532130414](https://coveralls.io/builds/36808119)
   
   * **214** of **244**   **(87.7%)**  changed or added relevant lines in **25** files are covered.
   * **4** unchanged lines in **2** files lost coverage.
   * Overall coverage increased (+**0.5%**) to **94.334%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [hll/include/HllSketch-internal.hpp](https://coveralls.io/builds/36808119/source?filename=hll%2Finclude%2FHllSketch-internal.hpp#L48) | 2 | 3 | 66.67%
   | [hll/include/HllUnion-internal.hpp](https://coveralls.io/builds/36808119/source?filename=hll%2Finclude%2FHllUnion-internal.hpp#L204) | 2 | 3 | 66.67%
   | [tuple/include/tuple_sketch_impl.hpp](https://coveralls.io/builds/36808119/source?filename=tuple%2Finclude%2Ftuple_sketch_impl.hpp#L241) | 0 | 2 | 0.0%
   | [theta/include/theta_sketch_impl.hpp](https://coveralls.io/builds/36808119/source?filename=theta%2Finclude%2Ftheta_sketch_impl.hpp#L60) | 50 | 76 | 65.79%
   <!-- | **Total:** | **214** | **244** | **87.7%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [theta/include/theta_sketch_impl.hpp](https://coveralls.io/builds/36808119/source?filename=theta%2Finclude%2Ftheta_sketch_impl.hpp#L233) | 1 | 31.25% |
   | [common/include/conditional_back_inserter.hpp](https://coveralls.io/builds/36808119/source?filename=common%2Finclude%2Fconditional_back_inserter.hpp#L43) | 3 | 53.85% |
   <!-- | **Total:** | **4** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/36808119/badge)](https://coveralls.io/builds/36808119) |
   | :-- | --: |
   | Change from base [Build 521644039](https://coveralls.io/builds/36706668): |  0.5% |
   | Covered Lines: | 4462 |
   | Relevant Lines: | 4730 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[GitHub] [datasketches-cpp] AlexanderSaydakov commented on a change in pull request #186: HLL allocator

Posted by GitBox <gi...@apache.org>.
AlexanderSaydakov commented on a change in pull request #186:
URL: https://github.com/apache/datasketches-cpp/pull/186#discussion_r574004021



##########
File path: hll/include/HllSketchImplFactory.hpp
##########
@@ -157,8 +159,9 @@ Hll6Array<A>* HllSketchImplFactory<A>::convertToHll6(const HllArray<A>& srcHllAr
 template<typename A>
 Hll8Array<A>* HllSketchImplFactory<A>::convertToHll8(const HllArray<A>& srcHllArr) {
   const int lgConfigK = srcHllArr.getLgConfigK();
-  typedef typename std::allocator_traits<A>::template rebind_alloc<Hll8Array<A>> hll8Alloc;
-  Hll8Array<A>* hll8Array = new (hll8Alloc().allocate(1)) Hll8Array<A>(lgConfigK, srcHllArr.isStartFullSize());
+  using Hll8Alloc = typename std::allocator_traits<A>::template rebind_alloc<Hll8Array<A>>;
+  Hll8Array<A>* hll8Array = new (Hll8Alloc(srcHllArr.getAllocator()).allocate(1))

Review comment:
       I prefer not to create aliases without a good reason.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org