You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by br...@apache.org on 2024/03/21 04:47:25 UTC

(arrow) branch exp/memory-pool-bench-threads created (now 850527bf11)

This is an automated email from the ASF dual-hosted git repository.

brycemecum pushed a change to branch exp/memory-pool-bench-threads
in repository https://gitbox.apache.org/repos/asf/arrow.git


      at 850527bf11 Uncomment the older code but keep newer bit commented out

This branch includes the following new commits:

     new 7aa2380616 Use ThreadRange on memory_pool_benchmark
     new 6b39883c40 Comment out body of UpdateAllocatedBytes
     new 850527bf11 Uncomment the older code but keep newer bit commented out

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(arrow) 01/03: Use ThreadRange on memory_pool_benchmark

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brycemecum pushed a commit to branch exp/memory-pool-bench-threads
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 7aa23806162fe740ec1c56bab5b7a6f6a03432c8
Author: Bryce Mecum <pe...@gmail.com>
AuthorDate: Wed Mar 20 19:56:11 2024 -0800

    Use ThreadRange on memory_pool_benchmark
---
 cpp/src/arrow/memory_pool_benchmark.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/arrow/memory_pool_benchmark.cc b/cpp/src/arrow/memory_pool_benchmark.cc
index fe7a3dd2f8..e3069da68f 100644
--- a/cpp/src/arrow/memory_pool_benchmark.cc
+++ b/cpp/src/arrow/memory_pool_benchmark.cc
@@ -115,7 +115,7 @@ static void AllocateTouchDeallocate(
 }
 
 #define BENCHMARK_ALLOCATE_ARGS \
-  ->RangeMultiplier(16)->Range(4096, 16 * 1024 * 1024)->ArgName("size")->UseRealTime()
+  ->RangeMultiplier(16)->Range(4096, 16 * 1024 * 1024)->ArgName("size")->UseRealTime()->ThreadRange(1,32);
 
 #define BENCHMARK_ALLOCATE(benchmark_func, template_param) \
   BENCHMARK_TEMPLATE(benchmark_func, template_param) BENCHMARK_ALLOCATE_ARGS


(arrow) 03/03: Uncomment the older code but keep newer bit commented out

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brycemecum pushed a commit to branch exp/memory-pool-bench-threads
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 850527bf1195c4d8c3291a151b63ac6bcd5bc170
Author: Bryce Mecum <pe...@gmail.com>
AuthorDate: Wed Mar 20 20:35:21 2024 -0800

    Uncomment the older code but keep newer bit commented out
---
 cpp/src/arrow/memory_pool.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpp/src/arrow/memory_pool.h b/cpp/src/arrow/memory_pool.h
index 0ffa8a1fc0..df46630125 100644
--- a/cpp/src/arrow/memory_pool.h
+++ b/cpp/src/arrow/memory_pool.h
@@ -48,13 +48,13 @@ class MemoryPoolStats {
   int64_t num_allocations() const { return num_allocs_.load(); }
 
   inline void UpdateAllocatedBytes(int64_t diff, bool is_free = false) {
-//    auto allocated = bytes_allocated_.fetch_add(diff) + diff;
-//    // "maximum" allocated memory is ill-defined in multi-threaded code,
-//    // so don't try to be too rigorous here
-//    if (diff > 0 && allocated > max_memory_) {
-//      max_memory_ = allocated;
-//    }
-//
+    auto allocated = bytes_allocated_.fetch_add(diff) + diff;
+    // "maximum" allocated memory is ill-defined in multi-threaded code,
+    // so don't try to be too rigorous here
+    if (diff > 0 && allocated > max_memory_) {
+      max_memory_ = allocated;
+    }
+
 //    // Reallocations might just expand/contract the allocation in place or might
 //    // copy to a new location. We can't really know, so we just represent the
 //    // optimistic case.


(arrow) 02/03: Comment out body of UpdateAllocatedBytes

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brycemecum pushed a commit to branch exp/memory-pool-bench-threads
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 6b39883c408418fff59a14d821f281b84e1af3d2
Author: Bryce Mecum <pe...@gmail.com>
AuthorDate: Wed Mar 20 19:59:07 2024 -0800

    Comment out body of UpdateAllocatedBytes
---
 cpp/src/arrow/memory_pool.h | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/cpp/src/arrow/memory_pool.h b/cpp/src/arrow/memory_pool.h
index 712a828041..0ffa8a1fc0 100644
--- a/cpp/src/arrow/memory_pool.h
+++ b/cpp/src/arrow/memory_pool.h
@@ -48,24 +48,24 @@ class MemoryPoolStats {
   int64_t num_allocations() const { return num_allocs_.load(); }
 
   inline void UpdateAllocatedBytes(int64_t diff, bool is_free = false) {
-    auto allocated = bytes_allocated_.fetch_add(diff) + diff;
-    // "maximum" allocated memory is ill-defined in multi-threaded code,
-    // so don't try to be too rigorous here
-    if (diff > 0 && allocated > max_memory_) {
-      max_memory_ = allocated;
-    }
-
-    // Reallocations might just expand/contract the allocation in place or might
-    // copy to a new location. We can't really know, so we just represent the
-    // optimistic case.
-    if (diff > 0) {
-      total_allocated_bytes_ += diff;
-    }
-
-    // We count any reallocation as a allocation.
-    if (!is_free) {
-      num_allocs_ += 1;
-    }
+//    auto allocated = bytes_allocated_.fetch_add(diff) + diff;
+//    // "maximum" allocated memory is ill-defined in multi-threaded code,
+//    // so don't try to be too rigorous here
+//    if (diff > 0 && allocated > max_memory_) {
+//      max_memory_ = allocated;
+//    }
+//
+//    // Reallocations might just expand/contract the allocation in place or might
+//    // copy to a new location. We can't really know, so we just represent the
+//    // optimistic case.
+//    if (diff > 0) {
+//      total_allocated_bytes_ += diff;
+//    }
+//
+//    // We count any reallocation as a allocation.
+//    if (!is_free) {
+//      num_allocs_ += 1;
+//    }
   }
 
  protected: