Skip to content

Commit

Permalink
Add missing libtool dependency and missing benchmark.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
fbdtemme committed Feb 19, 2021
1 parent d7884af commit e7d5707
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
100 changes: 100 additions & 0 deletions benchmark/benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/env bash

program_name=$1
working_dir=$2
target=$3
threads=$4

function benchmark_mktorrent()
{
target="$1"
threads="$2"
rm *.torrent
out="$(time mktorrent -t$threads -l20 "$target" 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}

function benchmark_torrenttools_openssl()
{
target="$1"
threads="$2"
rm *.torrent
# gdbserver :1234 torrenttools-release create -t$threads -l20 "$target"
out="$(time torrenttools-release create -t$threads -l20 "$target" 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}

function benchmark_torrenttools_isal()
{
target="$1"
threads="$2"
rm *.torrent
# torrenttools-isal-release create -t$threads -l20 "$target" 2>&1
out="$(time torrenttools-isal-release create -t$threads -l20 "$target" 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}


function benchmark_imdl()
{
target="$1"
threads="$2"
rm *.torrent
out="$(time imdl torrent create --piece-length 1MiB "$target" 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}

function benchmark_dottorrent_cli()
{
target="$1"
threads="$2"
rm *.torrent
out="$(time dottorrent --piece_size 1M "$target" "output.torrent" 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}

function benchmark_pyrocore()
{
target="$1"
threads="$2"
rm *.torrent
out="$(time mktor --chunk-min=1M --chunk-max=1M "$target" https://testurl.com/announce 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}


function benchmark_transmission()
{
target="$1"
threads="$2"
rm *.torrent
out="$(time transmission-create --piece-size 1024 "$target" 1> /dev/null 2> /dev/null)";
echo "$out"
return;
}


cd "$working_dir"

if [ $program_name == "mktorrent" ]; then
# echo "mktorrent"
benchmark_mktorrent "$target" "$threads"
elif [ $program_name == "torrenttools_openssl" ]; then
benchmark_torrenttools_openssl "$target" "$threads"
elif [ $program_name == "torrenttools_isal" ]; then
benchmark_torrenttools_isal "$target" "$threads"
elif [ $program_name == "imdl" ]; then
benchmark_imdl "$target" "$threads"
elif [ $program_name == "pyrocore" ]; then
benchmark_pyrocore "$target" "$threads"
elif [ $program_name == "dottorrent-cli" ]; then
benchmark_dottorrent_cli "$target" "$threads"
elif [ $program_name == "transmission-create" ]; then
benchmark_transmission "$target" "$threads"
fi
2 changes: 2 additions & 0 deletions packages/rpm/torrenttools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ BuildRequires: make
BuildRequires: git
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: nasm

%{?fedora:BuildRequires: gcc-c++ >= 10.0.0}
%{?fedora:BuildRequires: libstdc++-devel >= 10.0.0}
Expand Down
2 changes: 2 additions & 0 deletions packages/rpm/torrenttools.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ BuildRequires: make
BuildRequires: git
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: nasm

%{?fedora:BuildRequires: gcc-c++ >= 10.0.0}
%{?fedora:BuildRequires: libstdc++-devel >= 10.0.0}
Expand Down

0 comments on commit e7d5707

Please sign in to comment.