Skip to content

Commit

Permalink
minor refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Dec 1, 2023
1 parent 273840d commit 12e025a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,10 @@ public boolean isShallowSerialize() {
public boolean isShallowSerialize(boolean inclConvert) {
// shallow serialize if non-string schema because a frame block
// is always dense but strings have large array overhead per cell
boolean ret = true;
for(int j = 0; j < _schema.length && ret; j++)
ret &= _coldata[j].isShallowSerialize();
return ret;
for(int j = 0; j < _schema.length; j++)
if(!_coldata[j].isShallowSerialize())
return false;
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ else if(ls.equals("false") || ls.equals("f"))

@Override
public boolean isShallowSerialize() {
long s = getInMemorySize();
final long s = getInMemorySize();
return _size < 100 || s / _size < 100;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2939,13 +2939,14 @@ public boolean isShallowSerialize(boolean inclConvert) {
boolean sparseDst = evalSparseFormatOnDisk();
return !sparse || !sparseDst
|| (sparse && sparseBlock instanceof SparseBlockCSR)
|| (sparse && sparseBlock instanceof SparseBlockMCSR
&& getInMemorySize() / MAX_SHALLOW_SERIALIZE_OVERHEAD
<= getExactSerializedSize())
|| (sparse && sparseBlock instanceof SparseBlockMCSR
&& nonZeros < Integer.MAX_VALUE //CSR constraint
&& inclConvert && CONVERT_MCSR_TO_CSR_ON_DEEP_SERIALIZE
&& !isUltraSparseSerialize(sparseDst));
|| (sparse && sparseBlock instanceof SparseBlockMCSR);
// || (sparse && sparseBlock instanceof SparseBlockMCSR
// && getInMemorySize() / MAX_SHALLOW_SERIALIZE_OVERHEAD
// <= getExactSerializedSize())
// || (sparse && sparseBlock instanceof SparseBlockMCSR
// && nonZeros < Integer.MAX_VALUE //CSR constraint
// && inclConvert && CONVERT_MCSR_TO_CSR_ON_DEEP_SERIALIZE
// && !isUltraSparseSerialize(sparseDst));
}

@Override
Expand Down

0 comments on commit 12e025a

Please sign in to comment.