You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/06/02 13:25:31 UTC

[avro] 02/04: Add a new build.sh task for memory profiling the example apps

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

mgrigorov pushed a commit to branch rust-improve-cpu-and-memory-usage
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 98ca9adc39abf61a3b00bdf086e605da1a87b886
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Thu Jun 2 16:22:59 2022 +0300

    Add a new build.sh task for memory profiling the example apps
    
    Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>
---
 lang/rust/build.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lang/rust/build.sh b/lang/rust/build.sh
index e8f9bf69f..3a20e07ac 100755
--- a/lang/rust/build.sh
+++ b/lang/rust/build.sh
@@ -68,8 +68,19 @@ do
       echo -e "\nRunning single object encoding interop data tests"
       cargo run --example test_interop_single_object_encoding
       ;;
+    profile-heap)
+      echo "Heap memory profiling using KDE heaptrack tool"
+      EXAMPLE_APP=$2
+      EXAMPLE_APP=${EXAMPLE_APP:-"benchmark"}
+      echo $EXAMPLE_APP
+      RUSTFLAGS=-g cargo build --release --example $EXAMPLE_APP
+      rm -rf heaptrack.${EXAMPLE_APP}.*
+      heaptrack ./target/release/examples/$EXAMPLE_APP
+      heaptrack --analyze heaptrack.${EXAMPLE_APP}.*
+      exit
+      ;;
     *)
-      echo "Usage: $0 {lint|test|dist|clean|interop-data-generate|interop-data-test}" >&2
+      echo "Usage: $0 {lint|test|dist|clean|interop-data-generate|interop-data-test|profile-heap}" >&2
       exit 1
   esac
 done