From b42035d8a4f81ab7b66095cefecbbb23e6dedd47 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 16 Oct 2023 14:35:20 +0000 Subject: [PATCH 1/8] feat: gperftools --- barretenberg/cpp/.gitignore | 4 +- barretenberg/cpp/CMakePresets.json | 52 ++++++++++++------- .../cpp/scripts/collect_heap_information.sh | 41 +++++++++++++++ 3 files changed, 76 insertions(+), 21 deletions(-) create mode 100755 barretenberg/cpp/scripts/collect_heap_information.sh diff --git a/barretenberg/cpp/.gitignore b/barretenberg/cpp/.gitignore index 9a5226b72fa..811aef3620e 100644 --- a/barretenberg/cpp/.gitignore +++ b/barretenberg/cpp/.gitignore @@ -8,4 +8,6 @@ CMakeUserPresets.json .vscode/settings.json # to be unignored when we agree on clang-tidy rules .clangd -acir_tests \ No newline at end of file +acir_tests +# we may download go in scripts/collect_heap_information.sh +go*.tar.gz diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index 6bafa8fed7a..bda74911d93 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -135,6 +135,18 @@ "CMAKE_BUILD_TYPE": "Debug" } }, + { + "name": "gperftools", + "displayName": "Debugging build with gperftools on Clang-16", + "description": "Build with gperf", + "inherits": "clang16-dbg", + "binaryDir": "build-gperftools", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_EXE_LINKER_FLAGS": "-ltcmalloc", + "CXXFLAGS": "-fno-omit-frame-pointer" + } + }, { "name": "wasm", "displayName": "Build for WASM", @@ -183,22 +195,6 @@ "MULTITHREADING": "ON" } }, - { - "name": "xray-1thread", - "displayName": "Build with single-threaded XRay Profiling", - "description": "Build with Clang and enable single-threaded LLVM XRay for profiling", - "generator": "Unix Makefiles", - "inherits": "clang16", - "environment": { - "CFLAGS": "-fxray-instrument -fxray-instruction-threshold=10", - "CXXFLAGS": "-fxray-instrument -fxray-instruction-threshold=10", - "LDFLAGS": "-fxray-instrument -fxray-instruction-threshold=10" - }, - "cacheVariables": { - "MULTITHREADING": "OFF" - }, - "binaryDir": "build-xray-1thread" - }, { "name": "xray", "displayName": "Build with multi-threaded XRay Profiling", @@ -211,6 +207,17 @@ "LDFLAGS": "-fxray-instrument -fxray-instruction-threshold=10" }, "binaryDir": "build-xray" + }, + { + "name": "xray-1thread", + "displayName": "Build with single-threaded XRay Profiling", + "description": "Build with Clang and enable single-threaded LLVM XRay for profiling", + "generator": "Unix Makefiles", + "inherits": "xray", + "cacheVariables": { + "MULTITHREADING": "OFF" + }, + "binaryDir": "build-xray-1thread" } ], "buildPresets": [ @@ -265,6 +272,11 @@ "inherits": "clang16", "configurePreset": "fuzzing" }, + { + "name": "gperftools", + "inherits": "clang16", + "configurePreset": "gperftools" + }, { "name": "smt-verification", "inherits": "clang16", @@ -304,13 +316,13 @@ "targets": ["barretenberg.wasm"] }, { - "name": "xray-1thread", - "configurePreset": "xray-1thread", + "name": "xray", + "configurePreset": "xray", "inherits": "default" }, { - "name": "xray", - "configurePreset": "xray", + "name": "xray-1thread", + "configurePreset": "xray-1thread", "inherits": "default" } ], diff --git a/barretenberg/cpp/scripts/collect_heap_information.sh b/barretenberg/cpp/scripts/collect_heap_information.sh new file mode 100755 index 00000000000..88e799529ec --- /dev/null +++ b/barretenberg/cpp/scripts/collect_heap_information.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -eu + +PRESET=gperftools +ONLY_PROCESS=${1:-} + +# Move above script dir. +cd $(dirname $0)/.. + +# Configure and build with heap profiling preset. +cmake --preset $PRESET +cmake --build --preset $PRESET + +cd build-$PRESET + +if [ -z "$ONLY_PROCESS" ]; then + # Clear old heap profile data. + rm -f honk_bench_main_simple.heap.* + + # Run application with heap profiling. +HEAPPROFILE=./honk_bench_main_simple ./bin/honk_bench_main_simple +fi + +# Download and install Go +if [ ! -d ~/go ]; then + ARCHIVE=go1.21.3.linux-amd64.tar.gz + echo "Downloading and installing Go..." + curl -O https://golang.org/dl/$ARCHIVE + tar -C ~/ -xvf $ARCHIVE + rm $ARCHIVE + export PATH=$PATH:~/go/bin +fi + +# Install pprof +if [ ! -f ~/go/bin/pprof ]; then + echo "Installing pprof..." + ~/go/bin/go install github.com/google/pprof@latest +fi + +# Process the heap profile with pprof +~/go/bin/pprof --text ./bin/honk_bench_main_simple honk_bench_main_simple.0001.heap \ No newline at end of file From 5224ebffd39328b9e1a8ab669a80b191fa1a60a0 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 16 Oct 2023 15:04:38 +0000 Subject: [PATCH 2/8] feat: revert bbmalloc using slabs --- barretenberg/cpp/src/barretenberg/common/mem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/common/mem.cpp b/barretenberg/cpp/src/barretenberg/common/mem.cpp index d119eaf24a4..979c10d11e9 100644 --- a/barretenberg/cpp/src/barretenberg/common/mem.cpp +++ b/barretenberg/cpp/src/barretenberg/common/mem.cpp @@ -4,10 +4,10 @@ WASM_EXPORT void* bbmalloc(size_t size) { - return barretenberg::get_mem_slab_raw(size); + return aligned_alloc(32, size); } WASM_EXPORT void bbfree(void* ptr) { - barretenberg::free_mem_slab_raw(ptr); + aligned_free(ptr); } From 128d3e6735824f6bf60d76fb1a5e7707e222cde4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 16 Oct 2023 19:24:05 +0000 Subject: [PATCH 3/8] REVERTME: temporary allocation changes --- barretenberg/cpp/scripts/collect_heap_information.sh | 5 +++-- .../cpp/src/barretenberg/common/slab_allocator.cpp | 8 ++++---- .../cpp/src/barretenberg/common/slab_allocator.hpp | 8 +++++++- .../cpp/src/barretenberg/polynomials/polynomial.cpp | 3 ++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/barretenberg/cpp/scripts/collect_heap_information.sh b/barretenberg/cpp/scripts/collect_heap_information.sh index 88e799529ec..9a7407b2fe7 100755 --- a/barretenberg/cpp/scripts/collect_heap_information.sh +++ b/barretenberg/cpp/scripts/collect_heap_information.sh @@ -8,6 +8,7 @@ ONLY_PROCESS=${1:-} cd $(dirname $0)/.. # Configure and build with heap profiling preset. + cmake --preset $PRESET cmake --build --preset $PRESET @@ -15,10 +16,10 @@ cd build-$PRESET if [ -z "$ONLY_PROCESS" ]; then # Clear old heap profile data. - rm -f honk_bench_main_simple.heap.* + rm -f honk_bench_main_simple.heap* # Run application with heap profiling. -HEAPPROFILE=./honk_bench_main_simple ./bin/honk_bench_main_simple + HEAPPROFILE=./honk_bench_main_simple ./bin/honk_bench_main_simple fi # Download and install Go diff --git a/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp b/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp index 7b6d2020caf..bc0f9b7dd68 100644 --- a/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp +++ b/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp @@ -211,10 +211,10 @@ void init_slab_allocator(size_t circuit_subgroup_size) // return 0; // })(); -std::shared_ptr get_mem_slab(size_t size) -{ - return allocator.get(size); -} +// std::shared_ptr get_mem_slab(size_t size) +// { +// return allocator.get(size); +// } void* get_mem_slab_raw(size_t size) { diff --git a/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp b/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp index 050360d4db5..f15e6385274 100644 --- a/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp +++ b/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp @@ -31,7 +31,13 @@ void init_slab_allocator(size_t circuit_subgroup_size); * Returns a slab from the preallocated pool of slabs, or fallback to a new heap allocation (32 byte aligned). * Ref counted result so no need to manually free. */ -std::shared_ptr get_mem_slab(size_t size); +// std::shared_ptr get_mem_slab(size_t size); + +inline std::shared_ptr get_mem_slab(size_t size) +{ + // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) + return { malloc(size), free }; +} /** * Sometimes you want a raw pointer to a slab so you can manage when it's released manually (e.g. c_binds, containers). diff --git a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp index e3f94e9c872..8509c717eb1 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp @@ -461,7 +461,8 @@ template Polynomial Polynomial::partial_evaluate_mle(std:: return result; } -template typename Polynomial::pointer Polynomial::allocate_aligned_memory(const size_t size) const +template +BBERG_INLINE typename Polynomial::pointer Polynomial::allocate_aligned_memory(const size_t size) const { return std::static_pointer_cast(get_mem_slab(size)); } From 1c07648f6da80dec9ab5c5aa2140b66b024ffd08 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 17 Oct 2023 22:22:53 +0000 Subject: [PATCH 4/8] Memory tests --- barretenberg/cpp/scripts/collect_heap_information.sh | 6 +++++- .../benchmark/honk_bench/main.simple.cpp | 4 ++-- .../cpp/src/barretenberg/common/slab_allocator.cpp | 12 ++++++------ .../cpp/src/barretenberg/common/slab_allocator.hpp | 6 +++++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/barretenberg/cpp/scripts/collect_heap_information.sh b/barretenberg/cpp/scripts/collect_heap_information.sh index 9a7407b2fe7..92fdbc26298 100755 --- a/barretenberg/cpp/scripts/collect_heap_information.sh +++ b/barretenberg/cpp/scripts/collect_heap_information.sh @@ -38,5 +38,9 @@ if [ ! -f ~/go/bin/pprof ]; then ~/go/bin/go install github.com/google/pprof@latest fi +# Collect the heap files +files=(./honk_bench_main_simple.*.heap) +# Find the middle index based on the count +middle_index=$(( (${#files[@]} + 1) / 2 - 1)) # Process the heap profile with pprof -~/go/bin/pprof --text ./bin/honk_bench_main_simple honk_bench_main_simple.0001.heap \ No newline at end of file +~/go/bin/pprof --text ./bin/honk_bench_main_simple ${files[$middle_index]} \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/main.simple.cpp b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/main.simple.cpp index f33faf554d1..588e2727991 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/main.simple.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/main.simple.cpp @@ -45,12 +45,12 @@ void construct_proof_ultra() noexcept barretenberg::srs::init_crs_factory("../srs_db/ignition"); // Constuct circuit and prover; don't include this part in measurement auto builder = typename UltraHonk::CircuitBuilder(); - generate_sha256_test_circuit(builder, 1); + generate_sha256_test_circuit(builder, 100); auto composer = UltraHonk(); auto instance = composer.create_instance(builder); auto ext_prover = composer.create_prover(instance); - for (size_t i = 0; i < 10; i++) { + for (size_t i = 0; i < 1; i++) { auto proof = ext_prover.construct_proof(); } } diff --git a/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp b/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp index bc0f9b7dd68..c123294d091 100644 --- a/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp +++ b/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp @@ -216,12 +216,12 @@ void init_slab_allocator(size_t circuit_subgroup_size) // return allocator.get(size); // } -void* get_mem_slab_raw(size_t size) -{ - auto slab = get_mem_slab(size); - manual_slabs[slab.get()] = slab; - return slab.get(); -} +// void* get_mem_slab_raw(size_t size) +// { +// auto slab = get_mem_slab(size); +// manual_slabs[slab.get()] = slab; +// return slab.get(); +// } void free_mem_slab_raw(void* p) { diff --git a/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp b/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp index f15e6385274..11c88961a91 100644 --- a/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp +++ b/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp @@ -43,7 +43,11 @@ inline std::shared_ptr get_mem_slab(size_t size) * Sometimes you want a raw pointer to a slab so you can manage when it's released manually (e.g. c_binds, containers). * This still gets a slab with a shared_ptr, but holds the shared_ptr internally until free_mem_slab_raw is called. */ -void* get_mem_slab_raw(size_t size); +inline void* get_mem_slab_raw(size_t size) +{ + // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) + return malloc(size); +} void free_mem_slab_raw(void*); From 488fc0e7e05f3b470db241a7e86ae08e04e65e77 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 27 Oct 2023 17:24:27 +0000 Subject: [PATCH 5/8] feat: update --- barretenberg/cpp/CMakePresets.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index 0c051c88253..85193274ed8 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -221,12 +221,6 @@ "binaryDir": "build-xray" }, { -<<<<<<< HEAD - "name": "xray-1thread", - "displayName": "Build with single-threaded XRay Profiling", - "description": "Build with Clang and enable single-threaded LLVM XRay for profiling", - "generator": "Unix Makefiles", -======= "name": "xray-verbose", "displayName": "Build with detailed XRay Profiling", "description": "Build with Clang and enable detailed LLVM XRay for profiling", @@ -242,7 +236,6 @@ "name": "xray-1thread", "displayName": "Build with single-threaded XRay Profiling", "description": "Build with Clang and enable single-threaded LLVM XRay for profiling", ->>>>>>> origin/master "inherits": "xray", "cacheVariables": { "MULTITHREADING": "OFF" @@ -351,10 +344,6 @@ "targets": ["barretenberg.wasm"] }, { -<<<<<<< HEAD - "name": "xray", - "configurePreset": "xray", -======= "name": "xray-verbose", "configurePreset": "xray-verbose", "inherits": "default" @@ -362,7 +351,6 @@ { "name": "xray-1thread", "configurePreset": "xray-1thread", ->>>>>>> origin/master "inherits": "default" }, { From 1faa038c204965fc5a56a76eb4971664faabb694 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 27 Oct 2023 17:34:43 +0000 Subject: [PATCH 6/8] fixes post merge --- barretenberg/cpp/CMakePresets.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index 85193274ed8..0174d8b873b 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -151,7 +151,7 @@ "name": "gperftools", "displayName": "Debugging build with gperftools on Clang-16", "description": "Build with gperf", - "inherits": "clang16-dbg", + "inherits": "clang16", "binaryDir": "build-gperftools", "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", @@ -348,11 +348,6 @@ "configurePreset": "xray-verbose", "inherits": "default" }, - { - "name": "xray-1thread", - "configurePreset": "xray-1thread", - "inherits": "default" - }, { "name": "xray-1thread", "configurePreset": "xray-1thread", From cae72061fe97002cfcb9be1c2214da5dc5155f0b Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 27 Oct 2023 18:33:30 +0000 Subject: [PATCH 7/8] Revert code. Fix script --- .../cpp/scripts/collect_heap_information.sh | 11 +++++----- .../cpp/src/barretenberg/common/mem.cpp | 4 ++-- .../barretenberg/common/slab_allocator.cpp | 22 +++++++++---------- .../barretenberg/common/slab_allocator.hpp | 14 ++---------- .../barretenberg/polynomials/polynomial.cpp | 3 +-- 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/barretenberg/cpp/scripts/collect_heap_information.sh b/barretenberg/cpp/scripts/collect_heap_information.sh index 92fdbc26298..74bb18b2652 100755 --- a/barretenberg/cpp/scripts/collect_heap_information.sh +++ b/barretenberg/cpp/scripts/collect_heap_information.sh @@ -3,6 +3,7 @@ set -eu PRESET=gperftools ONLY_PROCESS=${1:-} +EXECUTABLE=${2:-ultra_honk_rounds_bench} # Move above script dir. cd $(dirname $0)/.. @@ -16,10 +17,10 @@ cd build-$PRESET if [ -z "$ONLY_PROCESS" ]; then # Clear old heap profile data. - rm -f honk_bench_main_simple.heap* + rm -f $EXECUTABLE.heap* - # Run application with heap profiling. - HEAPPROFILE=./honk_bench_main_simple ./bin/honk_bench_main_simple + # Run application with heap profiling to a file with prefix '$EXECUTABLE'. + HEAPPROFILE=./$EXECUTABLE ./bin/$EXECUTABLE fi # Download and install Go @@ -39,8 +40,8 @@ if [ ! -f ~/go/bin/pprof ]; then fi # Collect the heap files -files=(./honk_bench_main_simple.*.heap) +files=(./$EXECUTABLE.*.heap) # Find the middle index based on the count middle_index=$(( (${#files[@]} + 1) / 2 - 1)) # Process the heap profile with pprof -~/go/bin/pprof --text ./bin/honk_bench_main_simple ${files[$middle_index]} \ No newline at end of file +~/go/bin/pprof --text ./bin/$EXECUTABLE ${files[$middle_index]} \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/common/mem.cpp b/barretenberg/cpp/src/barretenberg/common/mem.cpp index 979c10d11e9..d119eaf24a4 100644 --- a/barretenberg/cpp/src/barretenberg/common/mem.cpp +++ b/barretenberg/cpp/src/barretenberg/common/mem.cpp @@ -4,10 +4,10 @@ WASM_EXPORT void* bbmalloc(size_t size) { - return aligned_alloc(32, size); + return barretenberg::get_mem_slab_raw(size); } WASM_EXPORT void bbfree(void* ptr) { - aligned_free(ptr); + barretenberg::free_mem_slab_raw(ptr); } diff --git a/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp b/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp index c123294d091..7b6d2020caf 100644 --- a/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp +++ b/barretenberg/cpp/src/barretenberg/common/slab_allocator.cpp @@ -211,17 +211,17 @@ void init_slab_allocator(size_t circuit_subgroup_size) // return 0; // })(); -// std::shared_ptr get_mem_slab(size_t size) -// { -// return allocator.get(size); -// } - -// void* get_mem_slab_raw(size_t size) -// { -// auto slab = get_mem_slab(size); -// manual_slabs[slab.get()] = slab; -// return slab.get(); -// } +std::shared_ptr get_mem_slab(size_t size) +{ + return allocator.get(size); +} + +void* get_mem_slab_raw(size_t size) +{ + auto slab = get_mem_slab(size); + manual_slabs[slab.get()] = slab; + return slab.get(); +} void free_mem_slab_raw(void* p) { diff --git a/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp b/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp index 11c88961a91..050360d4db5 100644 --- a/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp +++ b/barretenberg/cpp/src/barretenberg/common/slab_allocator.hpp @@ -31,23 +31,13 @@ void init_slab_allocator(size_t circuit_subgroup_size); * Returns a slab from the preallocated pool of slabs, or fallback to a new heap allocation (32 byte aligned). * Ref counted result so no need to manually free. */ -// std::shared_ptr get_mem_slab(size_t size); - -inline std::shared_ptr get_mem_slab(size_t size) -{ - // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) - return { malloc(size), free }; -} +std::shared_ptr get_mem_slab(size_t size); /** * Sometimes you want a raw pointer to a slab so you can manage when it's released manually (e.g. c_binds, containers). * This still gets a slab with a shared_ptr, but holds the shared_ptr internally until free_mem_slab_raw is called. */ -inline void* get_mem_slab_raw(size_t size) -{ - // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) - return malloc(size); -} +void* get_mem_slab_raw(size_t size); void free_mem_slab_raw(void*); diff --git a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp index 02ce5dcd011..727575b7d56 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp @@ -485,8 +485,7 @@ template Polynomial Polynomial::partial_evaluate_mle(std:: return result; } -template -BBERG_INLINE typename Polynomial::pointer Polynomial::allocate_aligned_memory(const size_t size) const +template typename Polynomial::pointer Polynomial::allocate_aligned_memory(const size_t size) const { return std::static_pointer_cast(get_mem_slab(size)); } From 77b31519036f2988b29b563f2a1c5aeb565e43af Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 2 Nov 2023 12:55:50 -0500 Subject: [PATCH 8/8] fix: collect_heap_information.sh --- barretenberg/cpp/scripts/collect_heap_information.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/scripts/collect_heap_information.sh b/barretenberg/cpp/scripts/collect_heap_information.sh index 74bb18b2652..1d25c5a791c 100755 --- a/barretenberg/cpp/scripts/collect_heap_information.sh +++ b/barretenberg/cpp/scripts/collect_heap_information.sh @@ -27,7 +27,7 @@ fi if [ ! -d ~/go ]; then ARCHIVE=go1.21.3.linux-amd64.tar.gz echo "Downloading and installing Go..." - curl -O https://golang.org/dl/$ARCHIVE + wget https://go.dev/dl/$ARCHIVE tar -C ~/ -xvf $ARCHIVE rm $ARCHIVE export PATH=$PATH:~/go/bin @@ -44,4 +44,4 @@ files=(./$EXECUTABLE.*.heap) # Find the middle index based on the count middle_index=$(( (${#files[@]} + 1) / 2 - 1)) # Process the heap profile with pprof -~/go/bin/pprof --text ./bin/$EXECUTABLE ${files[$middle_index]} \ No newline at end of file +~/go/bin/pprof --text ./bin/$EXECUTABLE ${files[$middle_index]}