This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BasedOnStyle: LLVM | |
| IndentWidth: 4 | |
| TabWidth: 4 | |
| UseTab: Always | |
| BreakBeforeBraces: Custom | |
| AllowShortIfStatementsOnASingleLine: true | |
| ColumnLimit: 0 | |
| AccessModifierOffset: -2 | |
| AlignAfterOpenBracket: Align | |
| AlignConsecutiveAssignments: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # **************************************************************************** # | |
| # # | |
| # ::: :::::::: # | |
| # Makefile :+: :+: :+: # | |
| # +:+ +:+ +:+ # | |
| # By: craimond <bomboclat@bidol.juis> +#+ +:+ +#+ # | |
| # +#+#+#+#+#+ +#+ # | |
| # Created: 2024/04/26 15:33:59 by craimond #+# #+# # | |
| # Updated: 2024/06/21 10:51:48 by craimond ### ########.fr # | |
| # # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # **************************************************************************** # | |
| # # | |
| # ::: :::::::: # | |
| # Makefile :+: :+: :+: # | |
| # +:+ +:+ +:+ # | |
| # By: craimond <bomboclat@bidol.juis> +#+ +:+ +#+ # | |
| # +#+#+#+#+#+ +#+ # | |
| # Created: 2024/08/06 01:09:08 by craimond #+# #+# # | |
| # Updated: 2024/09/15 14:24:42 by craimond ### ########.fr # | |
| # # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //TODO find a way to make them const, forcing prevention of thread safety issues, constexpr?? | |
| #ifdef __AVX512F__ | |
| static __m512i _512_vec_A_minus_1; | |
| static __m512i _512_vec_case_range; | |
| static __m512i _512_add_mask; | |
| #endif | |
| #ifdef __AVX2__ | |
| static __m256i _256_vec_A_minus_1; | |
| static __m256i _256_vec_case_range; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import subprocess | |
| import datetime | |
| import re | |
| CREATOR_NAME = "Claudio Raimondi" | |
| CREATOR_EMAIL = "claudio.raimondi@pm.me" | |
| HEADER_WIDTH = 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| description: | |
| takes pointers to the head and tail of the singly-linked list. | |
| sorts the list in ascending order by ASCII value. | |
| implementation: | |
| use of mergesort because linked lists inherently don't provide random access. could be bypassed by constructing an array of pointers but that's a poor design choice O(n)... | |
| merge sort is the fastest known sorting algo for linked lists, even though finding the midpoint is O(n/2) = O(n). | |
| use of the slow-fast pointer technique to find the midpoint of the list. same performance as the doubly-linked list -> <- approach. | |
| implemented by changing pointers, even though a char is 1 byte and easier to copy, for better mantainability, reusability, and standard compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <typename T, typename Comparator> | |
| HOT ssize_t forward_lower_bound(std::span<const T> data, const T elem, const Comparator &comp) noexcept | |
| { | |
| static_assert(std::is_integral<T>::value, "T must be an integral type"); | |
| static_assert(std::hardware_constructive_interference_size == 64, "Cache line size must be 64 bytes"); | |
| static constexpr uint8_t chunk_size = sizeof(__m512i) / sizeof(T); | |
| const T *begin = data.data(); | |
| const size_t size = data.size(); | |
| size_t remaining = size; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -u | |
| out_file="benchmarks_throwing_exception.txt" | |
| log="$(mktemp)" | |
| mapfile -t benches < <(./build/bin/bench_bitcoin --list) | |
| rm -f "$out_file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| N=${1:-1} | |
| FILTER=${2:-} | |
| TIME=${3:-} | |
| CURRENT_COMMIT=$(git rev-parse HEAD) | |
| COMMITS=$(git rev-list --max-count="$N" --reverse HEAD) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| N=${1:-1} | |
| CURRENT_COMMIT=$(git rev-parse HEAD) | |
| COMMITS=$(git rev-list --max-count="$N" --reverse HEAD) | |
| trap 'git checkout -q "$CURRENT_COMMIT"' EXIT SIGINT SIGTERM |
OlderNewer