Paired-Bloom-Filter: Balancing rounding to batches between the bottom-most level and other levels#371
Conversation
|
@noamhaham - Please run make format before pushing (and please do so before pushing the next commit with the updates) |
| // round down to multiple of a Batch | ||
| rv = std::max<size_t>((rv / kBatchSizeInBytes) * kBatchSizeInBytes, | ||
| kBatchSizeInBytes); | ||
| // rv = std::max<size_t>((rv / kBatchSizeInBytes) * kBatchSizeInBytes, |
There was a problem hiding this comment.
Please cleanup (remove the comment lines with "dead" code)
| if (is_bottomost_) | ||
| {num_batches_ = (num_blocks_ / speedb_filter::kPairedBloomBatchSizeInBlocks); | ||
| } else{ | ||
| num_batches_ = std::ceil((num_blocks_+0.0) / speedb_filter::kPairedBloomBatchSizeInBlocks); |
There was a problem hiding this comment.
Assuming you intend num_blocks_ to be a double in the calculation, please use
static_cast<double>(num_blocks_)
What I mean is to replace the "+0.0" with a static_cast
| rv = std::max<size_t>((rv / kBatchSizeInBytes) * kBatchSizeInBytes,kBatchSizeInBytes); | ||
| }else{ | ||
|
|
||
| rv=std::ceil<size_t>(((rv+0.0) / kBatchSizeInBytes)) * kBatchSizeInBytes; |
There was a problem hiding this comment.
Same here
you are using std::ceil as if it were a template which it isn't (std::ceil<size_t>)
Also, the function is called RoundDownUsableSpace and you may set rv to a value > available_size which I think is problematic (and definitely misleading).
There was a problem hiding this comment.
There is still the issue I have pointed out in the previous cycle:
Also, the function is called RoundDownUsableSpace and you may set rv to a value > available_size which I think is problematic (and definitely misleading).
| @@ -571,8 +576,19 @@ size_t SpdbPairedBloomBitsBuilder::RoundDownUsableSpace(size_t available_size) { | |||
| } | |||
|
|
|||
| // round down to multiple of a Batch | |||
There was a problem hiding this comment.
Please remove this comment if not applicable
| {num_batches_ = (num_blocks_ / speedb_filter::kPairedBloomBatchSizeInBlocks); | ||
| } else{ | ||
| num_batches_ = std::ceil(static_cast<double>(num_blocks_) / speedb_filter::kPairedBloomBatchSizeInBlocks); | ||
| } |
There was a problem hiding this comment.
Indentation.
Did you run make format before committting?
|
|
||
| } | ||
|
|
||
|
|
| rv = std::max<size_t>((rv / kBatchSizeInBytes) * kBatchSizeInBytes,kBatchSizeInBytes); | ||
| }else{ | ||
|
|
||
| rv=std::ceil<size_t>(((rv+0.0) / kBatchSizeInBytes)) * kBatchSizeInBytes; |
There was a problem hiding this comment.
There is still the issue I have pointed out in the previous cycle:
Also, the function is called RoundDownUsableSpace and you may set rv to a value > available_size which I think is problematic (and definitely misleading).
73ddc73 to
42110dc
Compare
|
udi-speedb
left a comment
There was a problem hiding this comment.
@noamhaham - I am approving the code of the change itself. However, please see my comments / suggestions / questions. Thanks
|
@udi-speedb, @erez-speedb, @Yuval-Ariel
|
42110dc to
bef6f1e
Compare
bef6f1e to
93763e2
Compare
|
@udi-speedb , hey we'd like to get this into the upcoming version. can you fix the build? |
@Yuval-Ariel The commit has no changes in the file that seems to cacuse the issue (util/build_version.cc.in)? |
…most level and rest of the levels (#369)
93763e2 to
e53149e
Compare
|
I have now cherry-picked the branch's commit on the latest origin/main and I hope that would solve it. |
|
@Yuval-Ariel Did the trick. Please merge. |
|
@Yuval-Ariel However, the failure occurred when it wasn't using the paired bloom filter IMO. Are you familiar with this failure? |
|
no im not, i'll run it on main to see maybe its because of recent additions. |
No description provided.