mirror of
https://github.com/boostorg/boost_unordered_benchmarks.git
synced 2026-01-26 18:32:29 +00:00
added boost::unordered_node_map
This commit is contained in:
13
.github/workflows/benchmarks.yml
vendored
13
.github/workflows/benchmarks.yml
vendored
@@ -198,6 +198,10 @@ jobs:
|
||||
git submodule update --init
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
- name: Install Boost.Unordered branch feature/unordered_node_map
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
git clone -b feature/unordered_node_map https://github.com/boostorg/unordered.git boost_unordered-root
|
||||
- name: Install Abseil
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
@@ -206,7 +210,7 @@ jobs:
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE
|
||||
${{matrix.compiler}} --version
|
||||
${{matrix.compiler}} ${{matrix.sourcefile}} ${{matrix.architecture}} ${{matrix.compileroptions}} -o ${{matrix.outputfile}} -I$GITHUB_WORKSPACE/boost-root -I$GITHUB_WORKSPACE/abseil-root
|
||||
${{matrix.compiler}} ${{matrix.sourcefile}} ${{matrix.architecture}} ${{matrix.compileroptions}} -o ${{matrix.outputfile}} -I$GITHUB_WORKSPACE/boost_unordered-root/include -I$GITHUB_WORKSPACE/boost-root -I$GITHUB_WORKSPACE/abseil-root
|
||||
- name: Set reportfile name
|
||||
run: |
|
||||
echo "REPORT_FILE=${{matrix.reportdir}}/${{matrix.sourcefile}}.csv" >> $GITHUB_ENV
|
||||
@@ -309,6 +313,11 @@ jobs:
|
||||
git submodule update --init
|
||||
cmd /c bootstrap.bat
|
||||
.\b2.exe -d0 headers
|
||||
- name: Install Boost.Unordered branch feature/unordered_node_map
|
||||
shell: cmd
|
||||
run: |
|
||||
cd %GITHUB_WORKSPACE%
|
||||
git clone -b feature/unordered_node_map https://github.com/boostorg/unordered.git boost_unordered-root
|
||||
- name: Install Abseil
|
||||
shell: cmd
|
||||
run: |
|
||||
@@ -320,7 +329,7 @@ jobs:
|
||||
cd %GITHUB_WORKSPACE%
|
||||
# call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.architecture}}
|
||||
call "C:\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.architecture}}
|
||||
set INCLUDE=%INCLUDE%;%GITHUB_WORKSPACE%\boost-root;%GITHUB_WORKSPACE%\abseil-root
|
||||
set INCLUDE=%INCLUDE%;%GITHUB_WORKSPACE%\boost_unordered-root\include;%GITHUB_WORKSPACE%\boost-root;%GITHUB_WORKSPACE%\abseil-root
|
||||
echo %INCLUDE%
|
||||
${{matrix.compiler}} ${{matrix.sourcefile}} ${{matrix.compileroptions}}
|
||||
- name: Set reportfile name
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Feeds csv data into Excel file for graph generation
|
||||
#
|
||||
# Copyright 2022 Joaquin M Lopez Munoz.
|
||||
# Copyright 2022-2023 Joaquin M Lopez Munoz.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -41,8 +41,9 @@ with io.open(args.input_file,"r",encoding=args.encoding) as filein:
|
||||
ws.cell(row=row,column=2).value=None
|
||||
ws.cell(row=row,column=3).value=None
|
||||
ws.cell(row=row,column=4).value=None
|
||||
ws.cell(row=row,column=5).value=None
|
||||
|
||||
pattern=re.compile(r"([0-9]+);([0-9.]+);([0-9.]+);([0-9.]+)")
|
||||
pattern=re.compile(r"([0-9]+);([0-9.]+);([0-9.]+);([0-9.]+);([0-9.]+)")
|
||||
for row,line in enumerate(lines[lines_read:],2):
|
||||
m=pattern.match(line)
|
||||
if not m: break
|
||||
@@ -50,5 +51,6 @@ with io.open(args.input_file,"r",encoding=args.encoding) as filein:
|
||||
ws.cell(row=row,column=2).value=float(m.group(2))
|
||||
ws.cell(row=row,column=3).value=float(m.group(3))
|
||||
ws.cell(row=row,column=4).value=float(m.group(4))
|
||||
ws.cell(row=row,column=5).value=float(m.group(5))
|
||||
|
||||
wb.save(args.excel_file)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Measuring running erasure times of unordered associative containers
|
||||
* without duplicate elements.
|
||||
*
|
||||
* Copyright 2013-2022 Joaquin M Lopez Munoz.
|
||||
* Copyright 2013-2023 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -115,16 +115,17 @@ boost::reference_wrapper<const T> temp_cref(T&& x)
|
||||
|
||||
template<
|
||||
template<typename> class Tester,
|
||||
typename Container1,typename Container2,typename Container3>
|
||||
typename Container1,typename Container2,
|
||||
typename Container3,typename Container4>
|
||||
void test(
|
||||
const char* title,
|
||||
const char* name1,const char* name2,const char* name3)
|
||||
const char* name1,const char* name2,const char* name3,const char* name4)
|
||||
{
|
||||
unsigned int n0=10000,n1=10000000,dn=500;
|
||||
double fdn=1.05;
|
||||
|
||||
std::cout<<title<<":"<<std::endl;
|
||||
std::cout<<name1<<";"<<name2<<";"<<name3<<std::endl;
|
||||
std::cout<<name1<<";"<<name2<<";"<<name3<<";"<<name4<<std::endl;
|
||||
|
||||
initialize_data(n1);
|
||||
|
||||
@@ -145,31 +146,39 @@ void test(
|
||||
t=measure(boost::bind(
|
||||
Tester<Container3>(),
|
||||
temp_cref(create<Container3>(n))));
|
||||
std::cout<<";"<<(t/m)*10E6;
|
||||
|
||||
t=measure(boost::bind(
|
||||
Tester<Container4>(),
|
||||
temp_cref(create<Container4>(n))));
|
||||
std::cout<<";"<<(t/m)*10E6<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
#include "absl/container/node_hash_map.h"
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include <boost/unordered/unordered_flat_map.hpp>
|
||||
#include <boost/unordered/unordered_map.hpp>
|
||||
#include <boost/unordered/unordered_node_map.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using container_t1=absl::flat_hash_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t2=boost::unordered_flat_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t3=boost::unordered_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t2=boost::unordered_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t3=boost::unordered_flat_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t4=boost::unordered_node_map<boost::uint64_t,boost::uint64_t>;
|
||||
|
||||
test<
|
||||
running_erasure,
|
||||
container_t1,
|
||||
container_t2,
|
||||
container_t3>
|
||||
container_t3,
|
||||
container_t4>
|
||||
(
|
||||
"Running erasure",
|
||||
"absl::flat_hash_map",
|
||||
"boost::unordered_map",
|
||||
"boost::unordered_flat_map",
|
||||
"boost::unordered_map"
|
||||
"boost::unordered_node_map"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Measuring running insertion times of unordered associative containers
|
||||
* without duplicate elements.
|
||||
*
|
||||
* Copyright 2013-2022 Joaquin M Lopez Munoz.
|
||||
* Copyright 2013-2023 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -120,10 +120,11 @@ struct norehash_running_insertion
|
||||
|
||||
template<
|
||||
template<typename> class Tester,
|
||||
typename Container1,typename Container2,typename Container3>
|
||||
typename Container1,typename Container2,
|
||||
typename Container3,typename Container4>
|
||||
void test(
|
||||
const char* title,
|
||||
const char* name1,const char* name2,const char* name3)
|
||||
const char* name1,const char* name2,const char* name3,const char* name4)
|
||||
{
|
||||
unsigned int n0=10000,n1=10000000,dn=500;
|
||||
double fdn=1.05;
|
||||
@@ -131,7 +132,7 @@ void test(
|
||||
initialize_data(n1);
|
||||
|
||||
std::cout<<title<<":"<<std::endl;
|
||||
std::cout<<name1<<";"<<name2<<";"<<name3<<std::endl;
|
||||
std::cout<<name1<<";"<<name2<<";"<<name3<<";"<<name4<<std::endl;
|
||||
|
||||
for(unsigned int n=n0;n<=n1;n+=dn,dn=(unsigned int)(dn*fdn)){
|
||||
double t;
|
||||
@@ -144,31 +145,37 @@ void test(
|
||||
std::cout<<";"<<(t/m)*10E6;
|
||||
|
||||
t=measure(boost::bind(Tester<Container3>(),n));
|
||||
std::cout<<";"<<(t/m)*10E6;
|
||||
|
||||
t=measure(boost::bind(Tester<Container4>(),n));
|
||||
std::cout<<";"<<(t/m)*10E6<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
#include "absl/container/node_hash_map.h"
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include <boost/unordered/unordered_flat_map.hpp>
|
||||
#include <boost/unordered/unordered_map.hpp>
|
||||
#include <boost/unordered/unordered_node_map.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using container_t1=absl::flat_hash_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t2=boost::unordered_flat_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t3=boost::unordered_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t2=boost::unordered_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t3=boost::unordered_flat_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t4=boost::unordered_node_map<boost::uint64_t,boost::uint64_t>;
|
||||
|
||||
test<
|
||||
running_insertion,
|
||||
container_t1,
|
||||
container_t2,
|
||||
container_t3>
|
||||
container_t3,
|
||||
container_t4>
|
||||
(
|
||||
"Running insertion",
|
||||
"absl::flat_hash_map",
|
||||
"boost::unordered_map",
|
||||
"boost::unordered_flat_map",
|
||||
"boost::unordered_map"
|
||||
"boost::unordered_node_map"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Measuring lookup times of unordered associative containers
|
||||
* without duplicate elements.
|
||||
*
|
||||
* Copyright 2013-2022 Joaquin M Lopez Munoz.
|
||||
* Copyright 2013-2023 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -108,12 +108,13 @@ boost::reference_wrapper<const T> temp_cref(T&& x)
|
||||
|
||||
template<
|
||||
template<typename> class Tester,
|
||||
typename Container1,typename Container2,typename Container3,
|
||||
typename Container1,typename Container2,
|
||||
typename Container3,typename Container4,
|
||||
typename Data
|
||||
>
|
||||
void test(
|
||||
const char* title,const Data& data,
|
||||
const char* name1,const char* name2,const char* name3)
|
||||
const char* name1,const char* name2,const char* name3,const char* name4)
|
||||
{
|
||||
unsigned int n0=10000,n1=10000000,dn=500;
|
||||
double fdn=1.05;
|
||||
@@ -121,7 +122,7 @@ void test(
|
||||
initialize_data(n1);
|
||||
|
||||
std::cout<<title<<":"<<std::endl;
|
||||
std::cout<<name1<<";"<<name2<<";"<<name3<<std::endl;
|
||||
std::cout<<name1<<";"<<name2<<";"<<name3<<";"<<name4<<std::endl;
|
||||
|
||||
for(unsigned int n=n0;n<=n1;n+=dn,dn=(unsigned int)(dn*fdn)){
|
||||
double t;
|
||||
@@ -139,45 +140,55 @@ void test(
|
||||
t=measure(boost::bind(
|
||||
Tester<Container3>(),
|
||||
temp_cref(create<Container3>(n)),n,boost::cref(data)));
|
||||
std::cout<<";"<<(t/n)*10E6;
|
||||
|
||||
t=measure(boost::bind(
|
||||
Tester<Container4>(),
|
||||
temp_cref(create<Container4>(n)),n,boost::cref(data)));
|
||||
std::cout<<";"<<(t/n)*10E6<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
#include "absl/container/node_hash_map.h"
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include <boost/unordered/unordered_flat_map.hpp>
|
||||
#include <boost/unordered/unordered_map.hpp>
|
||||
#include <boost/unordered/unordered_node_map.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using container_t1=absl::flat_hash_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t2=boost::unordered_flat_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t3=boost::unordered_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t2=boost::unordered_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t3=boost::unordered_flat_map<boost::uint64_t,boost::uint64_t>;
|
||||
using container_t4=boost::unordered_node_map<boost::uint64_t,boost::uint64_t>;
|
||||
|
||||
test<
|
||||
scattered_lookup,
|
||||
container_t1,
|
||||
container_t2,
|
||||
container_t3>
|
||||
container_t3,
|
||||
container_t4>
|
||||
(
|
||||
"Scattered successful lookup",
|
||||
data,
|
||||
"absl::flat_hash_map",
|
||||
"boost::unordered_map",
|
||||
"boost::unordered_flat_map",
|
||||
"boost::unordered_map"
|
||||
"boost::unordered_node_map"
|
||||
);
|
||||
|
||||
test<
|
||||
scattered_lookup,
|
||||
container_t1,
|
||||
container_t2,
|
||||
container_t3>
|
||||
container_t3,
|
||||
container_t4>
|
||||
(
|
||||
"Scattered unsuccessful lookup",
|
||||
unsuccessful_data,
|
||||
"absl::flat_hash_map",
|
||||
"boost::unordered_map",
|
||||
"boost::unordered_flat_map",
|
||||
"boost::unordered_map"
|
||||
"boost::unordered_node_map"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user