Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

add_compile_definitions(DISABLE_META_INTERNAL_COMPRESSOR=1)
add_compile_definitions(
DISABLE_META_INTERNAL_MEMORY_REALLOCATION_OPTIMIZATION=1
)

# Sets new behavior for CMP0135, which controls how timestamps are extracted
# when using ExternalProject_Add():
Expand Down
11 changes: 11 additions & 0 deletions dwio/nimble/velox/StreamChunker.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#pragma once

#include "dwio/nimble/velox/StreamData.h"
#ifndef DISABLE_META_INTERNAL_MEMORY_REALLOCATION_OPTIMIZATION
#include "justknobs/JustKnobProxy.h"
#endif

namespace facebook::nimble {
namespace detail {
Expand All @@ -32,6 +35,14 @@ uint64_t getNewBufferCapacity(
uint64_t maxChunkSize,
uint64_t currentCapacityCount,
uint64_t requiredCapacityCount) {
#ifndef DISABLE_META_INTERNAL_MEMORY_REALLOCATION_OPTIMIZATION
static facebook::jk::BooleanKnob disableMemoryReallocationOptimization(
"dwio/nimble_chunking:disable_memory_reallocation_optimization");
if (disableMemoryReallocationOptimization()) {
return requiredCapacityCount;
}
#endif

const auto maxChunkElementCount = maxChunkSize / sizeof(T);
if (currentCapacityCount < maxChunkElementCount) {
return std::max<uint64_t>(
Expand Down
2 changes: 0 additions & 2 deletions dwio/nimble/velox/VeloxWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,6 @@ bool VeloxWriter::evalauateFlushPolicy() {
if (continueChunking) {
// Relieve memory pressure by chunking small streams.
// Sort streams for chunking based on raw memory usage.
// TODO(T240072104): Improve performance by bucketing the streams
// by size (by most significant bit) instead of sorting them.
streamIndices.resize(streams.size());
std::iota(streamIndices.begin(), streamIndices.end(), 0);
std::sort(
Expand Down
Loading