Removing unnecessary library

This commit is contained in:
Sergio Martin 2024-01-22 17:58:58 +01:00
parent 69b6ebc445
commit 54255d59f2
196 changed files with 0 additions and 61891 deletions

View File

@ -1,57 +0,0 @@
# Use the Appveyor build number for naming the build.
# src: https://www.appveyor.com/docs/build-configuration/#build-versioning
version: '{Windows}'
# see https://www.appveyor.com/docs/how-to/repository-shallow-clone/
shallow_clone: true
platform: x64
environment:
matrix:
# CMake
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VS: 2017
CONFIG: Release
TEST: OFF
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VS: 2017
CONFIG: Release
TEST: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VS: 2017
CONFIG: Debug
TEST: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
VS: 2015
CONFIG: Release
TEST: OFF
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
VS: 2015
CONFIG: Release
TEST: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
VS: 2015
CONFIG: Debug
TEST: ON
matrix:
fast_finish: false
before_build:
# see https://www.appveyor.com/docs/lang/cpp/#visual-studio-2017
- if "%VS%"=="2017" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- if "%VS%"=="2017" set CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
# see https://www.appveyor.com/docs/lang/cpp/#visual-studio-2015
- if "%VS%"=="2015" call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
- if "%VS%"=="2015" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
- if "%VS%"=="2015" set CMAKE_GENERATOR="Visual Studio 14 2015 Win64"
build_script:
- cmake --version
- cmake -H. -Bbuild -DPHMAP_BUILD_TESTS=%TEST% -DPHMAP_BUILD_EXAMPLES=%TEST% -G %CMAKE_GENERATOR%
- cmake --build build --config %CONFIG% --target ALL_BUILD -- /maxcpucount
test_script:
- if "%TEST%"=="ON" set CTEST_OUTPUT_ON_FAILURE=1
- if "%TEST%"=="ON" cmake --build build --config %CONFIG% --target RUN_TESTS

View File

@ -1,2 +0,0 @@
* linguist-vendored
*.cc linguist-vendored=false

View File

@ -1 +0,0 @@
github: greg7mdp

View File

@ -1,25 +0,0 @@
name: Linux
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
compiler: [g++, clang++]
flags: [-std=c++11, -std=c++17]
optimize: [-O2]
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Build and test
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
run: |
mkdir build && cd build && cmake -DPHMAP_BUILD_TESTS=ON -DPHMAP_BUILD_EXAMPLES=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release .. && cmake --build . && make test

View File

@ -1,25 +0,0 @@
name: MacOS
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
compiler: [g++, clang++]
flags: [-std=c++11, -std=c++17]
optimize: [-O2]
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Build and test
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
run: |
mkdir build && cd build && cmake -DPHMAP_BUILD_TESTS=ON -DPHMAP_BUILD_EXAMPLES=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release .. && cmake --build . && make test

View File

@ -1,25 +0,0 @@
name: Windows
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
flags: ["/std:c++11", "/std:c++latest"]
optimize: [/O2]
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Build and test
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
CTEST_OUTPUT_ON_FAILURE: 1
run: |
cmake -Bbuild -DPHMAP_BUILD_TESTS=ON -DPHMAP_BUILD_EXAMPLES=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build --target ALL_BUILD && cmake --build build --target RUN_TESTS

View File

@ -1,8 +0,0 @@
VagrantFile
benchmark/build
benchmark/output
benchmark/charts.html
build*
.vagrant
**/.vscode
TAGS

View File

@ -1,150 +0,0 @@
cmake_minimum_required(VERSION 3.8)
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(DetectVersion)
cmake_policy(SET CMP0048 NEW) ## set VERSION as documented by the project() command.
set(CMAKE_CXX_STANDARD 11) ## compile with C++11 support
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(phmap VERSION ${DETECTED_PHMAP_VERSION} LANGUAGES CXX)
set(PHMAP_DIR parallel_hashmap)
set(PHMAP_HEADERS ${PHMAP_DIR}/phmap.h
${PHMAP_DIR}/phmap_base.h
${PHMAP_DIR}/phmap_bits.h
${PHMAP_DIR}/phmap_utils.h
${PHMAP_DIR}/phmap_config.h)
set(CMAKE_SUPPRESS_REGENERATION true) ## suppress ZERO_CHECK project
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(helpers)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_library(${PROJECT_NAME} INTERFACE)
target_sources(${PROJECT_NAME} INTERFACE ${PHMAP_HEADERS})
target_include_directories(
${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/${PHMAP_DIR}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHMAP_DIR})
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets)
export(EXPORT ${PROJECT_NAME}-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
## ------------------------- building tests and examples -------------
option(PHMAP_BUILD_TESTS "Whether or not to build the tests" OFF)
option(PHMAP_BUILD_EXAMPLES "Whether or not to build the examples" OFF)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
if (PHMAP_BUILD_TESTS)
include(cmake/DownloadGTest.cmake)
include_directories(${PROJECT_SOURCE_DIR})
check_target(gtest)
check_target(gtest_main)
check_target(gmock)
enable_testing()
## ---------------- regular hash maps ----------------------------
phmap_cc_test(NAME compressed_tuple SRCS "tests/compressed_tuple_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME container_memory SRCS "tests/container_memory_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME hash_policy_testing SRCS "tests/hash_policy_testing_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME node_hash_policy SRCS "tests/node_hash_policy_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME raw_hash_set SRCS "tests/raw_hash_set_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME raw_hash_set_allocator SRCS "tests/raw_hash_set_allocator_test.cc"
DEPS gmock_main)
## ---------------- regular hash maps ----------------------------
phmap_cc_test(NAME flat_hash_set SRCS "tests/flat_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
phmap_cc_test(NAME flat_hash_map SRCS "tests/flat_hash_map_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME node_hash_map SRCS "tests/node_hash_map_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME node_hash_set SRCS "tests/node_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
## --------------- parallel hash maps -----------------------------------------------
phmap_cc_test(NAME parallel_flat_hash_map SRCS "tests/parallel_flat_hash_map_test.cc"
COPTS "-DUNORDERED_MAP_CXX17" DEPS gmock_main)
phmap_cc_test(NAME parallel_flat_hash_set SRCS "tests/parallel_flat_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
phmap_cc_test(NAME parallel_node_hash_map SRCS "tests/parallel_node_hash_map_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME parallel_node_hash_set SRCS "tests/parallel_node_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
phmap_cc_test(NAME parallel_flat_hash_map_mutex SRCS "tests/parallel_flat_hash_map_mutex_test.cc"
COPTS "-DUNORDERED_MAP_CXX17" DEPS gmock_main)
phmap_cc_test(NAME dump_load SRCS "tests/dump_load_test.cc"
COPTS "-DUNORDERED_MAP_CXX17" DEPS gmock_main)
## --------------- btree -----------------------------------------------
phmap_cc_test(NAME btree SRCS "tests/btree_test.cc"
CLOPTS "-w" DEPS gmock_main)
endif()
if (PHMAP_BUILD_EXAMPLES)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wdisabled-optimization -Winit-self -Wlogical-op -Wmissing-include-dirs -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-null-sentinel -Wswitch-default -Wno-unused -Wno-unknown-warning-option -Wno-gnu-zero-variadic-macro-arguments")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /Zc:__cplusplus")
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
add_executable(ex_allmaps examples/allmaps.cc phmap.natvis)
add_executable(ex_basic examples/basic.cc phmap.natvis)
add_executable(ex_bench examples/bench.cc phmap.natvis)
add_executable(ex_emplace examples/emplace.cc phmap.natvis)
add_executable(ex_serialize examples/serialize.cc phmap.natvis)
target_include_directories(ex_serialize PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../cereal/include>)
add_executable(ex_hash_std examples/hash_std.cc phmap.natvis)
add_executable(ex_hash_value examples/hash_value.cc phmap.natvis)
add_executable(ex_two_files examples/f1.cc examples/f2.cc phmap.natvis)
add_executable(ex_insert_bench examples/insert_bench.cc phmap.natvis)
add_executable(ex_knucleotide examples/knucleotide.cc phmap.natvis)
add_executable(ex_dump_load examples/dump_load.cc phmap.natvis)
add_executable(ex_btree examples/btree.cc phmap.natvis)
add_executable(ex_matt examples/matt.cc phmap.natvis)
target_link_libraries(ex_knucleotide Threads::Threads)
target_link_libraries(ex_bench Threads::Threads)
endif()

202
extern/phmap/LICENSE vendored
View File

@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

305
extern/phmap/README.md vendored
View File

@ -1,305 +0,0 @@
<img src="https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/phash.png?raw=true" width="120" align="middle">
# The Parallel Hashmap [![Linux](https://github.com/greg7mdp/parallel-hashmap/actions/workflows/linux.yml/badge.svg)](https://github.com/greg7mdp/parallel-hashmap/actions/workflows/linux.yml) [![MacOS](https://github.com/greg7mdp/parallel-hashmap/actions/workflows/macos.yml/badge.svg)](https://github.com/greg7mdp/parallel-hashmap/actions/workflows/macos.yml) [![Windows](https://github.com/greg7mdp/parallel-hashmap/actions/workflows/windows.yml/badge.svg)](https://github.com/greg7mdp/parallel-hashmap/actions/workflows/windows.yml)
## Overview
This repository aims to provide a set of excellent **hash map** implementations, as well as a **btree** alternative to std::map and std::set, with the following characteristics:
- **Header only**: nothing to build, just copy the `parallel_hashmap` directory to your project and you are good to go.
- **drop-in replacement** for `std::unordered_map`, `std::unordered_set`, `std::map` and `std::set`
- Compiler with **C++11 support** required, **C++14 and C++17 APIs are provided (such as `try_emplace`)**
- **Very efficient**, significantly faster than your compiler's unordered map/set or Boost's, or than [sparsepp](https://github.com/greg7mdp/sparsepp)
- **Memory friendly**: low memory usage, although a little higher than [sparsepp](https://github.com/greg7mdp/sparsepp)
- Supports **heterogeneous lookup**
- Easy to **forward declare**: just include `phmap_fwd_decl.h` in your header files to forward declare Parallel Hashmap containers [note: this does not work currently for hash maps with pointer keys]
- **Dump/load** feature: when a `flat` hash map stores data that is `std::trivially_copyable`, the table can be dumped to disk and restored as a single array, very efficiently, and without requiring any hash computation. This is typically about 10 times faster than doing element-wise serialization to disk, but it will use 10% to 60% extra disk space. See `examples/serialize.cc`. _(flat hash map/set only)_
- **Tested** on Windows (vs2015 & vs2017, vs2019, Intel compiler 18 and 19), linux (g++ 4.8.4, 5, 6, 7, 8, clang++ 3.9, 4.0, 5.0) and MacOS (g++ and clang++) - click on travis and appveyor icons above for detailed test status.
- Automatic support for **boost's hash_value()** method for providing the hash function (see `examples/hash_value.h`). Also default hash support for `std::pair` and `std::tuple`.
- **natvis** visualization support in Visual Studio _(hash map/set only)_
@byronhe kindly provided this [Chinese translation](https://byronhe.com/post/2020/11/10/parallel-hashmap-btree-fast-multi-thread-intro/) of the README.md.
## Fast *and* memory friendly
Click here [For a full writeup explaining the design and benefits of the Parallel Hashmap](https://greg7mdp.github.io/parallel-hashmap/).
The hashmaps and btree provided here are built upon those open sourced by Google in the Abseil library. The hashmaps use closed hashing, where values are stored directly into a memory array, avoiding memory indirections. By using parallel SSE2 instructions, these hashmaps are able to look up items by checking 16 slots in parallel, allowing the implementation to remain fast even when the table is filled up to 87.5% capacity.
> **IMPORTANT:** This repository borrows code from the [abseil-cpp](https://github.com/abseil/abseil-cpp) repository, with modifications, and may behave differently from the original. This repository is an independent work, with no guarantees implied or provided by the authors. Please visit [abseil-cpp](https://github.com/abseil/abseil-cpp) for the official Abseil libraries.
## Installation
Copy the parallel_hashmap directory to your project. Update your include path. That's all.
If you are using Visual Studio, you probably want to add `phmap.natvis` to your projects. This will allow for a clear display of the hash table contents in the debugger.
> A cmake configuration files (CMakeLists.txt) is provided for building the tests and examples. Command for building and running the tests is: `mkdir build && cd build && cmake -DPHMAP_BUILD_TESTS=ON -DPHMAP_BUILD_EXAMPLES=ON .. && cmake --build . && make test`
## Example
```c++
#include <iostream>
#include <string>
#include <parallel_hashmap/phmap.h>
using phmap::flat_hash_map;
int main()
{
// Create an unordered_map of three strings (that map to strings)
flat_hash_map<std::string, std::string> email =
{
{ "tom", "tom@gmail.com"},
{ "jeff", "jk@gmail.com"},
{ "jim", "jimg@microsoft.com"}
};
// Iterate and print keys and values
for (const auto& n : email)
std::cout << n.first << "'s email is: " << n.second << "\n";
// Add a new entry
email["bill"] = "bg@whatever.com";
// and print it
std::cout << "bill's email is: " << email["bill"] << "\n";
return 0;
}
```
## Various hash maps and their pros and cons
The header `parallel_hashmap/phmap.h` provides the implementation for the following eight hash tables:
- phmap::flat_hash_set
- phmap::flat_hash_map
- phmap::node_hash_set
- phmap::node_hash_map
- phmap::parallel_flat_hash_set
- phmap::parallel_flat_hash_map
- phmap::parallel_node_hash_set
- phmap::parallel_node_hash_map
The header `parallel_hashmap/btree.h` provides the implementation for the following btree-based ordered containers:
- phmap::btree_set
- phmap::btree_map
- phmap::btree_multiset
- phmap::btree_multimap
The btree containers are direct ports from Abseil, and should behave exactly the same as the Abseil ones, modulo small differences (such as supporting std::string_view instead of absl::string_view, and being forward declarable).
When btrees are mutated, values stored within can be moved in memory. This means that pointers or iterators to values stored in btree containers can be invalidated when that btree is modified. This is a significant difference with `std::map` and `std::set`, as the std containers do offer a guarantee of pointer stability. The same is true for the 'flat' hash maps and sets.
The full types with template parameters can be found in the [parallel_hashmap/phmap_fwd_decl.h](https://raw.githubusercontent.com/greg7mdp/parallel-hashmap/master/parallel_hashmap/phmap_fwd_decl.h) header, which is useful for forward declaring the Parallel Hashmaps when necessary.
**Key decision points for hash containers:**
- The `flat` hash maps will move the keys and values in memory. So if you keep a pointer to something inside a `flat` hash map, this pointer may become invalid when the map is mutated. The `node` hash maps don't, and should be used instead if this is a problem.
- The `flat` hash maps will use less memory, and usually be faster than the `node` hash maps, so use them if you can. the exception is when the values inserted in the hash map are large (say more than 100 bytes [*needs testing*]) and costly to move.
- The `parallel` hash maps are preferred when you have a few hash maps that will store a very large number of values. The `non-parallel` hash maps are preferred if you have a large number of hash maps, each storing a relatively small number of values.
- The benefits of the `parallel` hash maps are:
a. reduced peak memory usage (when resizing), and
b. multithreading support (and inherent internal parallelism)
**Key decision points for btree containers:**
Btree containers are ordered containers, which can be used as alternatives to `std::map` and `std::set`. They store multiple values in each tree node, and are therefore more cache friendly and use significantly less memory.
Btree containers will usually be preferable to the default red-black trees of the STL, except when:
- pointer stability or iterator stability is required
- the value_type is large and expensive to move
When an ordering is not needed, a hash container is typically a better choice than a btree one.
## Changes to Abseil's hashmaps
- The default hash framework is std::hash, not absl::Hash. However, if you prefer the default to be the Abseil hash framework, include the Abseil headers before `phmap.h` and define the preprocessor macro `PHMAP_USE_ABSL_HASH`.
- The `erase(iterator)` and `erase(const_iterator)` both return an iterator to the element following the removed element, as does the std::unordered_map. A non-standard `void _erase(iterator)` is provided in case the return value is not needed.
- No new types, such as `absl::string_view`, are provided. All types with a `std::hash<>` implementation are supported by phmap tables (including `std::string_view` of course if your compiler provides it).
- The Abseil hash tables internally randomize a hash seed, so that the table iteration order is non-deterministic. This can be useful to prevent *Denial Of Service* attacks when a hash table is used for a customer facing web service, but it can make debugging more difficult. The *phmap* hashmaps by default do **not** implement this randomization, but it can be enabled by adding `#define PHMAP_NON_DETERMINISTIC 1` before including the header `phmap.h` (as is done in raw_hash_set_test.cc).
- Unlike the Abseil hash maps, we do an internal mixing of the hash value provided. This prevents serious degradation of the hash table performance when the hash function provided by the user has poor entropy distribution. The cost in performance is very minimal, and this helps provide reliable performance even with *imperfect* hash functions.
## Memory usage
| type | memory usage | additional *peak* memory usage when resizing |
|-----------------------|-------------------|-----------------------------------------------|
| flat tables | ![flat_mem_usage](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/flat_mem_usage.png?raw=true) | ![flat_peak_usage](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/flat_peak.png?raw=true) |
| node tables | ![node_mem_usage](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/node_mem_usage.png?raw=true) | ![node_peak_usage](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/node_peak.png?raw=true) |
| parallel flat tables | ![flat_mem_usage](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/flat_mem_usage.png?raw=true) | ![parallel_flat_peak](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/parallel_flat_peak.png?raw=true) |
| parallel node tables | ![node_mem_usage](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/node_mem_usage.png?raw=true) | ![parallel_node_peak](https://github.com/greg7mdp/parallel-hashmap/blob/master/html/img/parallel_node_peak.png?raw=true) |
- *size()* is the number of values in the container, as returned by the size() method
- *load_factor()* is the ratio: `size() / bucket_count()`. It varies between 0.4375 (just after the resize) to 0.875 (just before the resize). The size of the bucket array doubles at each resize.
- the value 9 comes from `sizeof(void *) + 1`, as the *node* hash maps store one pointer plus one byte of metadata for each entry in the bucket array.
- flat tables store the values, plus one byte of metadata per value), directly into the bucket array, hence the `sizeof(C::value_type) + 1`.
- the additional peak memory usage (when resizing) corresponds the the old bucket array (half the size of the new one, hence the 0.5), which contains the values to be copied to the new bucket array, and which is freed when the values have been copied.
- the *parallel* hashmaps, when created with a template parameter N=4, create 16 submaps. When the hash values are well distributed, and in single threaded mode, only one of these 16 submaps resizes at any given time, hence the factor `0.03` roughly equal to `0.5 / 16`
## Iterator invalidation for hash containers
The rules are the same as for `std::unordered_map`, and are valid for all the phmap hash containers:
| Operations | Invalidated |
|-------------------------------------------|----------------------------|
| All read only operations, swap, std::swap | Never |
| clear, rehash, reserve, operator= | Always |
| insert, emplace, emplace_hint, operator[] | Only if rehash triggered |
| erase | Only to the element erased |
## Iterator invalidation for btree containers
Unlike for `std::map` and `std::set`, any mutating operation may invalidate existing iterators to btree containers.
| Operations | Invalidated |
|-------------------------------------------|----------------------------|
| All read only operations, swap, std::swap | Never |
| clear, operator= | Always |
| insert, emplace, emplace_hint, operator[] | Yes |
| erase | Yes |
## Example 2 - providing a hash function for a user-defined class
In order to use a flat_hash_set or flat_hash_map, a hash function should be provided. This can be done with one of the following methods:
- Provide a hash functor via the HashFcn template parameter
- As with boost, you may add a `hash_value()` friend function in your class.
For example:
```c++
#include <parallel_hashmap/phmap_utils.h> // minimal header providing phmap::HashState()
#include <string>
using std::string;
struct Person
{
bool operator==(const Person &o) const
{
return _first == o._first && _last == o._last && _age == o._age;
}
friend size_t hash_value(const Person &p)
{
return phmap::HashState().combine(0, p._first, p._last, p._age);
}
string _first;
string _last;
int _age;
};
```
- Inject a specialization of `std::hash` for the class into the "std" namespace. We provide a convenient and small header `phmap_utils.h` which allows to easily add such specializations.
For example:
### file "Person.h"
```c++
#include <parallel_hashmap/phmap_utils.h> // minimal header providing phmap::HashState()
#include <string>
using std::string;
struct Person
{
bool operator==(const Person &o) const
{
return _first == o._first && _last == o._last && _age == o._age;
}
string _first;
string _last;
int _age;
};
namespace std
{
// inject specialization of std::hash for Person into namespace std
// ----------------------------------------------------------------
template<> struct hash<Person>
{
std::size_t operator()(Person const &p) const
{
return phmap::HashState().combine(0, p._first, p._last, p._age);
}
};
}
```
The `std::hash` specialization for `Person` combines the hash values for both first and last name and age, using the convenient phmap::HashState() function, and returns the combined hash value.
### file "main.cpp"
```c++
#include "Person.h" // defines Person with std::hash specialization
#include <iostream>
#include <parallel_hashmap/phmap.h>
int main()
{
// As we have defined a specialization of std::hash() for Person,
// we can now create sparse_hash_set or sparse_hash_map of Persons
// ----------------------------------------------------------------
phmap::flat_hash_set<Person> persons =
{ { "John", "Mitchell", 35 },
{ "Jane", "Smith", 32 },
{ "Jane", "Smith", 30 },
};
for (auto& p: persons)
std::cout << p._first << ' ' << p._last << " (" << p._age << ")" << '\n';
}
```
## Thread safety
Parallel Hashmap containers follow the thread safety rules of the Standard C++ library. In Particular:
- A single phmap hash table is thread safe for reading from multiple threads. For example, given a hash table A, it is safe to read A from thread 1 and from thread 2 simultaneously.
- If a single hash table is being written to by one thread, then all reads and writes to that hash table on the same or other threads must be protected. For example, given a hash table A, if thread 1 is writing to A, then thread 2 must be prevented from reading from or writing to A.
- It is safe to read and write to one instance of a type even if another thread is reading or writing to a different instance of the same type. For example, given hash tables A and B of the same type, it is safe if A is being written in thread 1 and B is being read in thread 2.
- The *parallel* tables can be made internally thread-safe for concurrent read and write access, by providing a synchronization type (for example [std::mutex](https://en.cppreference.com/w/cpp/thread/mutex)) as the last template argument. Because locking is performed at the *submap* level, a high level of concurrency can still be achieved. Read access can be done safely using `if_contains()`, which passes a reference value to the callback while holding the *submap* lock. Similarly, write access can be done safely using `modify_if`, `try_emplace_l` or `lazy_emplace_l`. However, please be aware that iterators or references returned by standard APIs are not protected by the mutex, so they cannot be used reliably on a hash map which can be changed by another thread.
- Examples on how to use various mutex types, including boost::mutex, boost::shared_mutex and absl::Mutex can be found in `examples/bench.cc`
## Using the Parallel Hashmap from languages other than C++
While C++ is the native language of the Parallel Hashmap, we welcome bindings making it available for other languages. One such implementation has been created for Python and is described below:
- [GetPy - A Simple, Fast, and Small Hash Map for Python](https://github.com/atom-moyer/getpy): GetPy is a thin and robust binding to The Parallel Hashmap (https://github.com/greg7mdp/parallel-hashmap.git) which is the current state of the art for minimal memory overhead and fast runtime speed. The binding layer is supported by PyBind11 (https://github.com/pybind/pybind11.git) which is fast to compile and simple to extend. Serialization is handled by Cereal (https://github.com/USCiLab/cereal.git) which supports streaming binary serialization, a critical feature for the large hash maps this package is designed to support.
## Acknowledgements
Many thanks to the Abseil developers for implementing the swiss table and btree data structures (see [abseil-cpp](https://github.com/abseil/abseil-cpp)) upon which this work is based, and to Google for releasing it as open-source.

View File

@ -1,16 +0,0 @@
# parallel-hashmap
How to run these benchmarks
===========================
These bencharks were run on windows using Visual Studio 2017, in a cygwin window with the VC++ 2017 compiler env vars (add something like this in your Cygwin.bat:
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
Running them on linux would require Makefile changes.
To build and run the tests, just update the path to the abseil libraries in the makefile, and run make.
Your charts are now in charts.html.

View File

@ -1,63 +0,0 @@
CXX=CL -EHsc -DNDEBUG -Fo$@ -O2
#CXX=CL -EHsc -g -debug -Zi -Fo$@
#CXX=g++ -ggdb -O2 -lm -std=c++11 -DNDEBUG
ABSEIL_LIBS=absl_bad_optional_access.lib absl_bad_variant_access.lib absl_base.lib absl_demangle_internal.lib absl_hash.lib absl_int128.lib absl_internal_bad_any_cast_impl.lib absl_internal_city.lib absl_internal_civil_time.lib absl_internal_debugging_internal.lib absl_internal_graphcycles_internal.lib absl_internal_hashtablez_sampler.lib absl_internal_malloc_internal.lib absl_internal_spinlock_wait.lib absl_internal_strings_internal.lib absl_internal_throw_delegate.lib absl_internal_time_zone.lib absl_optional.lib absl_raw_hash_set.lib absl_stacktrace.lib absl_strings.lib absl_symbolize.lib absl_synchronization.lib absl_time.lib
PROGS = stl_unordered_map sparsepp phmap abseil_flat abseil_parallel_flat phmap_flat
BUILD_PROGS = $(addprefix build/,$(PROGS))
SIZE = 100000000
ABSEIL = ../../abseil-cpp
PHMAP_SRC = ../parallel_hashmap
all: test
builddir:
@if [ ! -d build ]; then mkdir build; fi
build/stl_unordered_map: bench.cc Makefile
$(CXX) -DSTL_UNORDERED -I.. bench.cc -o $@
build/sparsepp: bench.cc Makefile
$(CXX) -DSPARSEPP -I.. -I../../sparsepp bench.cc -o $@
build/phmap: bench.cc Makefile $(PHMAP_SRC)/phmap.h
$(CXX) -DPHMAP -I.. -I$(ABSEIL) bench.cc /MD -o $@ /link /LIBPATH:$(ABSEIL)/build/lib ${ABSEIL_LIBS}
build/phmap_flat: bench.cc Makefile $(PHMAP_SRC)/phmap.h
$(CXX) -DPHMAP_FLAT -I.. bench.cc /MD -o $@
build/abseil_flat: bench.cc Makefile
$(CXX) -DABSEIL_FLAT -I.. -I$(ABSEIL) bench.cc /MD -o $@ /link /LIBPATH:$(ABSEIL)/build/lib ${ABSEIL_LIBS}
build/abseil_parallel_flat: bench.cc Makefile
$(CXX) -DABSEIL_PARALLEL_FLAT -I.. -I $(ABSEIL) bench.cc /MD -o $@ /link /LIBPATH:$(ABSEIL)/build/lib ${ABSEIL_LIBS}
build/emplace: emplace.cc Makefile $(PHMAP_SRC)/phmap.h
$(CXX) -DABSEIL_FLAT -I.. -I$(ABSEIL) emplace.cc /MD -o $@ /link /LIBPATH:$(ABSEIL)/build/lib ${ABSEIL_LIBS}
progs: $(BUILD_PROGS)
test: builddir progs
-rm -f output
#./build/stl_unordered_map $(SIZE) random >> output
#./build/sparsepp $(SIZE) random >> output
./build/abseil_flat $(SIZE) random >> output
#./build/phmap_flat $(SIZE) random >> output
./build/phmap $(SIZE) random >> output
./build/abseil_parallel_flat $(SIZE) random >> output
python make_chart_data.py < output
test_cust:
-rm -f output
#./build/abseil_flat $(SIZE) random >> output
#./build/sparsepp $(SIZE) random >> output
./build/abseil_parallel_flat_5 $(SIZE) random >> output
./build/abseil_parallel_flat $(SIZE) random >> output
python make_chart_data.py < output
chart:
python make_chart_data.py < output
clean:
-rm -fr output build

View File

@ -1,451 +0,0 @@
#include <inttypes.h>
#ifdef STL_UNORDERED
#include <unordered_map>
#define MAPNAME std::unordered_map
#define EXTRAARGS
#elif defined(SPARSEPP)
#define SPP_USE_SPP_ALLOC 1
#include <sparsepp/spp.h>
#define MAPNAME spp::sparse_hash_map
#define EXTRAARGS
#elif defined(ABSEIL_FLAT)
#include "absl/container/flat_hash_map.h"
#define MAPNAME absl::flat_hash_map
#define EXTRAARGS
#elif defined(PHMAP_FLAT)
#include "parallel_hashmap/phmap.h"
#define MAPNAME phmap::flat_hash_map
#define NMSP phmap
#define EXTRAARGS
#elif defined(ABSEIL_PARALLEL_FLAT) || defined(PHMAP)
#if defined(ABSEIL_PARALLEL_FLAT)
#include "absl/container/parallel_flat_hash_map.h"
#define MAPNAME absl::parallel_flat_hash_map
#define NMSP absl
#define MTX absl::Mutex
#else
#if 1
// use Abseil's mutex... faster
#include "absl/synchronization/mutex.h"
#define MTX absl::Mutex
#else
#include <mutex>
#define MTX std::mutex
#endif
#include "parallel_hashmap/phmap.h"
#define MAPNAME phmap::parallel_flat_hash_map
#define NMSP phmap
#endif
#define MT_SUPPORT 2
#if MT_SUPPORT == 1
// create the parallel_flat_hash_map without internal mutexes, for when
// we programatically ensure that each thread uses different internal submaps
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, NMSP::NullMutex
#elif MT_SUPPORT == 2
// create the parallel_flat_hash_map with internal mutexes, for when
// we read/write the same parallel_flat_hash_map from multiple threads,
// without any special precautions.
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, MTX
#else
#define EXTRAARGS
#endif
#endif
#define xstr(s) str(s)
#define str(s) #s
template <class K, class V>
using HashT = MAPNAME<K, V EXTRAARGS>;
using hash_t = HashT<int64_t, int64_t>;
using str_hash_t = HashT<const char *, int64_t>;
const char *program_slug = xstr(MAPNAME); // "_4";
#include <cassert>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <thread>
#include <chrono>
#include <ostream>
#include "parallel_hashmap/meminfo.h"
#include <vector>
using std::vector;
int64_t _abs(int64_t x) { return (x < 0) ? -x : x; }
// --------------------------------------------------------------------------
class Timer
{
typedef std::chrono::high_resolution_clock high_resolution_clock;
typedef std::chrono::milliseconds milliseconds;
public:
explicit Timer(bool run = false) { if (run) reset(); }
void reset() { _start = high_resolution_clock::now(); }
milliseconds elapsed() const
{
return std::chrono::duration_cast<milliseconds>(high_resolution_clock::now() - _start);
}
private:
high_resolution_clock::time_point _start;
};
// --------------------------------------------------------------------------
// from: https://github.com/preshing/RandomSequence
// --------------------------------------------------------------------------
class RSU
{
private:
unsigned int m_index;
unsigned int m_intermediateOffset;
static unsigned int permuteQPR(unsigned int x)
{
static const unsigned int prime = 4294967291u;
if (x >= prime)
return x; // The 5 integers out of range are mapped to themselves.
unsigned int residue = ((unsigned long long) x * x) % prime;
return (x <= prime / 2) ? residue : prime - residue;
}
public:
RSU(unsigned int seedBase, unsigned int seedOffset)
{
m_index = permuteQPR(permuteQPR(seedBase) + 0x682f0161);
m_intermediateOffset = permuteQPR(permuteQPR(seedOffset) + 0x46790905);
}
unsigned int next()
{
return permuteQPR((permuteQPR(m_index++) + m_intermediateOffset) ^ 0x5bf03635);
}
};
// --------------------------------------------------------------------------
char * new_string_from_integer(int num)
{
int ndigits = num == 0 ? 1 : (int)log10(num) + 1;
char * str = (char *)malloc(ndigits + 1);
sprintf(str, "%d", num);
return str;
}
// --------------------------------------------------------------------------
template <class T>
void _fill(vector<T> &v)
{
srand(1); // for a fair/deterministic comparison
for (size_t i = 0, sz = v.size(); i < sz; ++i)
v[i] = (T)(i * 10 + rand() % 10);
}
// --------------------------------------------------------------------------
template <class T>
void _shuffle(vector<T> &v)
{
for (size_t n = v.size(); n >= 2; --n)
std::swap(v[n - 1], v[static_cast<unsigned>(rand()) % n]);
}
// --------------------------------------------------------------------------
template <class T, class HT>
Timer _fill_random(vector<T> &v, HT &hash)
{
_fill<T>(v);
_shuffle<T>(v);
Timer timer(true);
for (size_t i = 0, sz = v.size(); i < sz; ++i)
hash.insert(typename HT::value_type(v[i], 0));
return timer;
}
// --------------------------------------------------------------------------
void out(const char* test, int64_t cnt, const Timer &t)
{
printf("%s,time,%lld,%s,%f\n", test, cnt, program_slug, (float)((double)t.elapsed().count() / 1000));
}
// --------------------------------------------------------------------------
void outmem(const char* test, int64_t cnt, uint64_t mem)
{
printf("%s,memory,%lld,%s,%lld\n", test, cnt, program_slug, mem);
}
static bool all_done = false;
static int64_t num_keys[16] = { 0 };
static int64_t loop_idx = 0;
static int64_t inner_cnt = 0;
static const char *test = "random";
// --------------------------------------------------------------------------
template <class HT>
void _fill_random_inner(int64_t cnt, HT &hash, RSU &rsu)
{
for (int64_t i=0; i<cnt; ++i)
{
hash.insert(typename HT::value_type(rsu.next(), 0));
++num_keys[0];
}
}
// --------------------------------------------------------------------------
template <class HT>
void _fill_random_inner_mt(int64_t cnt, HT &hash, RSU &rsu)
{
constexpr int64_t num_threads = 8; // has to be a power of two
std::unique_ptr<std::thread> threads[num_threads];
auto thread_fn = [&hash, cnt, num_threads](int64_t thread_idx, RSU rsu) {
#if MT_SUPPORT
size_t modulo = hash.subcnt() / num_threads; // subcnt() returns the number of submaps
for (int64_t i=0; i<cnt; ++i) // iterate over all values
{
unsigned int key = rsu.next(); // get next key to insert
#if MT_SUPPORT == 1
size_t hashval = hash.hash(key); // compute its hash
size_t idx = hash.subidx(hashval); // compute the submap index for this hash
if (idx / modulo == thread_idx) // if the submap is suitable for this thread
#elif MT_SUPPORT == 2
if (i % num_threads == thread_idx)
#endif
{
hash.insert(typename HT::value_type(key, 0)); // insert the value
++(num_keys[thread_idx]); // increment count of inserted values
}
}
#endif
};
// create and start 8 threads - each will insert in their own submaps
// thread 0 will insert the keys whose hash direct them to submap0 or submap1
// thread 1 will insert the keys whose hash direct them to submap2 or submap3
// --------------------------------------------------------------------------
for (int64_t i=0; i<num_threads; ++i)
threads[i].reset(new std::thread(thread_fn, i, rsu));
// rsu passed by value to threads... we need to increment the reference object
for (int64_t i=0; i<cnt; ++i)
rsu.next();
// wait for the threads to finish their work and exit
for (int64_t i=0; i<num_threads; ++i)
threads[i]->join();
}
// --------------------------------------------------------------------------
size_t total_num_keys()
{
size_t n = 0;
for (int i=0; i<16; ++i)
n += num_keys[i];
return n;
}
// --------------------------------------------------------------------------
template <class HT>
Timer _fill_random2(int64_t cnt, HT &hash)
{
test = "random";
unsigned int seed = 76687;
RSU rsu(seed, seed + 1);
Timer timer(true);
const int64_t num_loops = 10;
inner_cnt = cnt / num_loops;
for (int i=0; i<16; ++i)
num_keys[i] = 0;
for (loop_idx=0; loop_idx<num_loops; ++loop_idx)
{
#if 1 && MT_SUPPORT
// multithreaded insert
_fill_random_inner_mt(inner_cnt, hash, rsu);
#else
_fill_random_inner(inner_cnt, hash, rsu);
#endif
out(test, total_num_keys(), timer);
}
fprintf(stderr, "inserted %.2lfM\n", (double)hash.size() / 1000000);
return timer;
}
// --------------------------------------------------------------------------
template <class T, class HT>
Timer _lookup(vector<T> &v, HT &hash, size_t &num_present)
{
_fill_random(v, hash);
num_present = 0;
size_t max_val = v.size() * 10;
Timer timer(true);
for (size_t i = 0, sz = v.size(); i < sz; ++i)
{
num_present += (size_t)(hash.find(v[i]) != hash.end());
num_present += (size_t)(hash.find((T)(rand() % max_val)) != hash.end());
}
return timer;
}
// --------------------------------------------------------------------------
template <class T, class HT>
Timer _delete(vector<T> &v, HT &hash)
{
_fill_random(v, hash);
_shuffle(v); // don't delete in insertion order
Timer timer(true);
for(size_t i = 0, sz = v.size(); i < sz; ++i)
hash.erase(v[i]);
return timer;
}
// --------------------------------------------------------------------------
void memlog()
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
uint64_t nbytes_old_out = spp::GetProcessMemoryUsed();
uint64_t nbytes_old = spp::GetProcessMemoryUsed(); // last non outputted mem measurement
outmem(test, 0, nbytes_old);
int64_t last_loop = 0;
while (!all_done)
{
uint64_t nbytes = spp::GetProcessMemoryUsed();
if ((double)_abs(nbytes - nbytes_old_out) / nbytes_old_out > 0.03 ||
(double)_abs(nbytes - nbytes_old) / nbytes_old > 0.01)
{
if ((double)(nbytes - nbytes_old) / nbytes_old > 0.03)
outmem(test, total_num_keys() - 1, nbytes_old);
outmem(test, total_num_keys(), nbytes);
nbytes_old_out = nbytes;
last_loop = loop_idx;
}
else if (loop_idx > last_loop)
{
outmem(test, total_num_keys(), nbytes);
nbytes_old_out = nbytes;
last_loop = loop_idx;
}
nbytes_old = nbytes;
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
// --------------------------------------------------------------------------
int main(int argc, char ** argv)
{
int64_t i, value = 0;
if(argc <= 2)
return 1;
int64_t num_keys = atoi(argv[1]);
hash_t hash;
str_hash_t str_hash;
srand(1); // for a fair/deterministic comparison
Timer timer(true);
#if MT_SUPPORT
if (!strcmp(program_slug,"absl::parallel_flat_hash_map") ||
!strcmp(program_slug,"phmap::parallel_flat_hash_map"))
program_slug = xstr(MAPNAME) "_mt";
#endif
std::thread t1(memlog);
try
{
if(!strcmp(argv[2], "sequential"))
{
for(i = 0; i < num_keys; i++)
hash.insert(hash_t::value_type(i, value));
}
#if 0
else if(!strcmp(argv[2], "random"))
{
vector<int64_t> v(num_keys);
timer = _fill_random(v, hash);
out("random", num_keys, timer);
}
#endif
else if(!strcmp(argv[2], "random"))
{
fprintf(stderr, "size = %d\n", sizeof(hash));
timer = _fill_random2(num_keys, hash);
//out("random", num_keys, timer);
//fprintf(stderr, "inserted %llu\n", hash.size());
}
else if(!strcmp(argv[2], "lookup"))
{
vector<int64_t> v(num_keys);
size_t num_present;
timer = _lookup(v, hash, num_present);
//fprintf(stderr, "found %llu\n", num_present);
}
else if(!strcmp(argv[2], "delete"))
{
vector<int64_t> v(num_keys);
timer = _delete(v, hash);
}
else if(!strcmp(argv[2], "sequentialstring"))
{
for(i = 0; i < num_keys; i++)
str_hash.insert(str_hash_t::value_type(new_string_from_integer(i), value));
}
else if(!strcmp(argv[2], "randomstring"))
{
for(i = 0; i < num_keys; i++)
str_hash.insert(str_hash_t::value_type(new_string_from_integer((int)rand()), value));
}
else if(!strcmp(argv[2], "deletestring"))
{
for(i = 0; i < num_keys; i++)
str_hash.insert(str_hash_t::value_type(new_string_from_integer(i), value));
timer.reset();
for(i = 0; i < num_keys; i++)
str_hash.erase(new_string_from_integer(i));
}
//printf("%f\n", (float)((double)timer.elapsed().count() / 1000));
fflush(stdout);
//std::this_thread::sleep_for(std::chrono::seconds(1000));
}
catch (...)
{
}
all_done = true;
t1.join();
return 0;
}

View File

@ -1,73 +0,0 @@
import sys, os, subprocess, signal
programs = [
'stl_unordered_map',
'abseil_flat',
'abseil_parallel_flat'
]
test_size = 1
minkeys = 0
maxkeys = 1000
interval = 100
best_out_of = 1
if test_size == 2:
multiplier = 1000 * 1000
maxkeys = 500
best_out_of = 3
elif test_size == 1:
multiplier = 100 * 1000
interval = 200
else:
multiplier = 10 * 1000
# and use nice/ionice
# and shut down to the console
# and swapoff any swap files/partitions
outfile = open('output', 'w')
if len(sys.argv) > 1:
benchtypes = sys.argv[1:]
else:
benchtypes = ( 'random', 'lookup', 'delete',)
#benchtypes = ( 'lookup', )
for benchtype in benchtypes:
nkeys = minkeys * multiplier
while nkeys <= (maxkeys * multiplier):
for program in programs:
fastest_attempt = 1000000
fastest_attempt_data = ''
for attempt in range(best_out_of):
proc = subprocess.Popen(['./build/'+program, str(nkeys), benchtype], stdout=subprocess.PIPE)
# wait for the program to fill up memory and spit out its "ready" message
try:
runtime = float(proc.stdout.readline().strip())
except:
runtime = 0
ps_proc = subprocess.Popen(['ps up %d | tail -n1' % proc.pid], shell=True, stdout=subprocess.PIPE)
#nbytes = int(ps_proc.stdout.read().split()[4]) * 1024
#ps_proc.wait()
nbytes = 1000000
os.kill(proc.pid, signal.SIGKILL)
proc.wait()
if nbytes and runtime: # otherwise it crashed
line = ','.join(map(str, [benchtype, nkeys, program, nbytes, "%0.6f" % runtime]))
if runtime < fastest_attempt:
fastest_attempt = runtime
fastest_attempt_data = line
if fastest_attempt != 1000000:
print >> outfile, fastest_attempt_data
print fastest_attempt_data
nkeys += interval * multiplier

View File

@ -1,135 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Hash Table Benchmarks</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="./style.css" />
<link href="./js/examples.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="./js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.mousewheel.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.canvaswrapper.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.colorhelpers.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.saturated.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.browser.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.drawSeries.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.errorbars.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.uiConstants.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.logaxis.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.symbol.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.flatdata.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.navigate.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.fillbetween.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.stack.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.touchNavigate.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.hover.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.touch.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.time.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.axislabels.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.selection.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.composeImages.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.flot.legend.js"></script>
<script type="text/javascript">
series_settings = {
lines: { show: true, lineWidth: 2 },
points: { show: true, radius: 2 }
};
grid_settings = { tickColor: '#ddd' };
divider = 10
xaxis_settings = {
tickSize: 200000000 / divider, <!-- 200000000 -->
tickFormatter: function(num, obj) { return parseInt(num/1000000) + 'M'; }
};
yaxis_runtime_settings = {
labelWidth: 60,
tickFormatter: function(num, obj) { return num + ' sec.'; }
};
yaxis_memory_settings = {
labelWidth: 60,
tickSize: 10*1024*1024*1024 / divider, <!-- 1024 -->
tickFormatter: function(num, obj) { return parseInt(num/1024/1024) + 'MB'; }
};
legend_settings = {
position: 'nw',
show: true,
backgroundOpacity: 0
};
runtime_settings = {
series: series_settings,
grid: grid_settings,
xaxis: xaxis_settings,
yaxis: yaxis_runtime_settings,
legend: legend_settings,
zoom: { interactive: true },
pan: { interactive: true }
};
memory_settings = {
series: series_settings,
grid: grid_settings,
xaxis: xaxis_settings,
yaxis: yaxis_memory_settings,
legend: legend_settings,
zoom: { interactive: true },
pan: { interactive: true }
};
__CHART_DATA_GOES_HERE__
$(function () {
__PLOT_SPEC_GOES_HERE__
});
</script>
</head>
<body>
<style>
body, * { font-family: sans-serif; }
div.table-title {
width: 700px;
text-indent: 75px;
text-decoration-line: underline;
text-decoration-style: solid;
font-style: normal;
font-size: 0.9em;
color: #222;
margin-top: 25px;
margin-left: 25px;
}
div.chart {
width: 800px;
height: 300px;
font-style: normal;
font-size: 0.75em;
margin-left: 25px;
}
div.xaxis-title {
width: 700px;
text-align: center;
text-decoration-line: underline;
text-decoration-style: solid;
font-style: italic;
font-size: 0.85em;
color: #666;
margin-top: 10px;
margin-bottom: 50px;
margin-left: 25px;
}
</style>
__PLOT_DIV_SPEC_GOES_HERE__
</body>
</html>

View File

@ -1,146 +0,0 @@
* { padding: 0; margin: 0; vertical-align: top; }
body {
background: url(background.png) repeat-x;
font: 18px "proxima-nova", Helvetica, Arial, sans-serif;
line-height: 1.5;
}
a { color: #069; }
a:hover { color: #28b; }
h2 {
margin-top: 15px;
font: normal 32px "omnes-pro", Helvetica, Arial, sans-serif;
}
h3 {
margin-left: 30px;
font: normal 26px "omnes-pro", Helvetica, Arial, sans-serif;
color: #666;
}
p {
margin-top: 10px;
}
button {
font-size: 18px;
padding: 1px 7px;
}
input {
font-size: 18px;
}
input[type=checkbox] {
margin: 7px;
}
#header {
position: relative;
width: 900px;
margin: auto;
}
#header h2 {
margin-left: 10px;
vertical-align: middle;
font-size: 42px;
font-weight: bold;
text-decoration: none;
color: #000;
}
#content {
width: 880px;
margin: 0 auto;
padding: 10px;
}
#footer {
margin-top: 25px;
margin-bottom: 10px;
text-align: center;
font-size: 12px;
color: #999;
}
.demo-container {
box-sizing: border-box;
width: 850px;
height: 450px;
padding: 20px 15px 15px 15px;
margin: 15px auto 30px auto;
border: 1px solid #ddd;
background: #fff;
background: linear-gradient(#f6f6f6 0, #fff 50px);
background: -o-linear-gradient(#f6f6f6 0, #fff 50px);
background: -ms-linear-gradient(#f6f6f6 0, #fff 50px);
background: -moz-linear-gradient(#f6f6f6 0, #fff 50px);
background: -webkit-linear-gradient(#f6f6f6 0, #fff 50px);
box-shadow: 0 3px 10px rgba(0,0,0,0.15);
-o-box-shadow: 0 3px 10px rgba(0,0,0,0.1);
-ms-box-shadow: 0 3px 10px rgba(0,0,0,0.1);
-moz-box-shadow: 0 3px 10px rgba(0,0,0,0.1);
-webkit-box-shadow: 0 3px 10px rgba(0,0,0,0.1);
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.demo-placeholder {
width: 100%;
height: 100%;
font-size: 14px;
}
fieldset {
display: block;
-webkit-margin-start: 2px;
-webkit-margin-end: 2px;
-webkit-padding-before: 0.35em;
-webkit-padding-start: 0.75em;
-webkit-padding-end: 0.75em;
-webkit-padding-after: 0.625em;
min-width: -webkit-min-content;
border-width: 2px;
border-style: groove;
border-color: threedface;
border-image: initial;
padding: 10px;
}
.legend {
display: block;
-webkit-padding-start: 2px;
-webkit-padding-end: 2px;
border-width: initial;
border-style: none;
border-color: initial;
border-image: initial;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
padding-bottom: 10px;
}
.legendLayer .background {
fill: rgba(255, 255, 255, 0.85);
stroke: rgba(0, 0, 0, 0.85);
stroke-width: 1;
}
input[type="radio"] {
margin-top: -1px;
vertical-align: middle;
}
.tickLabel {
line-height: 1.1;
}

View File

@ -1,538 +0,0 @@
/** ## jquery.flot.canvaswrapper
This plugin contains the function for creating and manipulating both the canvas
layers and svg layers.
The Canvas object is a wrapper around an HTML5 canvas tag.
The constructor Canvas(cls, container) takes as parameters cls,
the list of classes to apply to the canvas adnd the containter,
element onto which to append the canvas. The canvas operations
don't work unless the canvas is attached to the DOM.
### jquery.canvaswrapper.js API functions
*/
(function($) {
var Canvas = function(cls, container) {
var element = container.getElementsByClassName(cls)[0];
if (!element) {
element = document.createElement('canvas');
element.className = cls;
element.style.direction = 'ltr';
element.style.position = 'absolute';
element.style.left = '0px';
element.style.top = '0px';
container.appendChild(element);
// If HTML5 Canvas isn't available, throw
if (!element.getContext) {
throw new Error('Canvas is not available.');
}
}
this.element = element;
var context = this.context = element.getContext('2d');
this.pixelRatio = $.plot.browser.getPixelRatio(context);
// Size the canvas to match the internal dimensions of its container
var box = container.getBoundingClientRect();
this.resize(box.width, box.height);
// Collection of HTML div layers for text overlaid onto the canvas
this.SVGContainer = null;
this.SVG = {};
// Cache of text fragments and metrics, so we can avoid expensively
// re-calculating them when the plot is re-rendered in a loop.
this._textCache = {};
}
/**
- resize(width, height)
Resizes the canvas to the given dimensions.
The width represents the new width of the canvas, meanwhile the height
is the new height of the canvas, both of them in pixels.
*/
Canvas.prototype.resize = function(width, height) {
var minSize = 10;
width = width < minSize ? minSize : width;
height = height < minSize ? minSize : height;
var element = this.element,
context = this.context,
pixelRatio = this.pixelRatio;
// Resize the canvas, increasing its density based on the display's
// pixel ratio; basically giving it more pixels without increasing the
// size of its element, to take advantage of the fact that retina
// displays have that many more pixels in the same advertised space.
// Resizing should reset the state (excanvas seems to be buggy though)
if (this.width !== width) {
element.width = width * pixelRatio;
element.style.width = width + 'px';
this.width = width;
}
if (this.height !== height) {
element.height = height * pixelRatio;
element.style.height = height + 'px';
this.height = height;
}
// Save the context, so we can reset in case we get replotted. The
// restore ensure that we're really back at the initial state, and
// should be safe even if we haven't saved the initial state yet.
context.restore();
context.save();
// Scale the coordinate space to match the display density; so even though we
// may have twice as many pixels, we still want lines and other drawing to
// appear at the same size; the extra pixels will just make them crisper.
context.scale(pixelRatio, pixelRatio);
};
/**
- clear()
Clears the entire canvas area, not including any overlaid HTML text
*/
Canvas.prototype.clear = function() {
this.context.clearRect(0, 0, this.width, this.height);
};
/**
- render()
Finishes rendering the canvas, including managing the text overlay.
*/
Canvas.prototype.render = function() {
var cache = this._textCache;
// For each text layer, add elements marked as active that haven't
// already been rendered, and remove those that are no longer active.
for (var layerKey in cache) {
if (hasOwnProperty.call(cache, layerKey)) {
var layer = this.getSVGLayer(layerKey),
layerCache = cache[layerKey];
var display = layer.style.display;
layer.style.display = 'none';
for (var styleKey in layerCache) {
if (hasOwnProperty.call(layerCache, styleKey)) {
var styleCache = layerCache[styleKey];
for (var key in styleCache) {
if (hasOwnProperty.call(styleCache, key)) {
var val = styleCache[key],
positions = val.positions;
for (var i = 0, position; positions[i]; i++) {
position = positions[i];
if (position.active) {
if (!position.rendered) {
layer.appendChild(position.element);
position.rendered = true;
}
} else {
positions.splice(i--, 1);
if (position.rendered) {
while (position.element.firstChild) {
position.element.removeChild(position.element.firstChild);
}
position.element.parentNode.removeChild(position.element);
}
}
}
if (positions.length === 0) {
if (val.measured) {
val.measured = false;
} else {
delete styleCache[key];
}
}
}
}
}
}
layer.style.display = display;
}
}
};
/**
- getSVGLayer(classes)
Creates (if necessary) and returns the SVG overlay container.
The classes string represents the string of space-separated CSS classes
used to uniquely identify the text layer. It return the svg-layer div.
*/
Canvas.prototype.getSVGLayer = function(classes) {
var layer = this.SVG[classes];
// Create the SVG layer if it doesn't exist
if (!layer) {
// Create the svg layer container, if it doesn't exist
var svgElement;
if (!this.SVGContainer) {
this.SVGContainer = document.createElement('div');
this.SVGContainer.className = 'flot-svg';
this.SVGContainer.style.position = 'absolute';
this.SVGContainer.style.top = '0px';
this.SVGContainer.style.left = '0px';
this.SVGContainer.style.bottom = '0px';
this.SVGContainer.style.right = '0px';
this.SVGContainer.style.pointerEvents = 'none';
this.element.parentNode.appendChild(this.SVGContainer);
svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svgElement.style.width = '100%';
svgElement.style.height = '100%';
this.SVGContainer.appendChild(svgElement);
} else {
svgElement = this.SVGContainer.firstChild;
}
layer = document.createElementNS('http://www.w3.org/2000/svg', 'g');
layer.setAttribute('class', classes);
layer.style.position = 'absolute';
layer.style.top = '0px';
layer.style.left = '0px';
layer.style.bottom = '0px';
layer.style.right = '0px';
svgElement.appendChild(layer);
this.SVG[classes] = layer;
}
return layer;
};
/**
- getTextInfo(layer, text, font, angle, width)
Creates (if necessary) and returns a text info object.
The object looks like this:
```js
{
width //Width of the text's wrapper div.
height //Height of the text's wrapper div.
element //The HTML div containing the text.
positions //Array of positions at which this text is drawn.
}
```
The positions array contains objects that look like this:
```js
{
active //Flag indicating whether the text should be visible.
rendered //Flag indicating whether the text is currently visible.
element //The HTML div containing the text.
text //The actual text and is identical with element[0].textContent.
x //X coordinate at which to draw the text.
y //Y coordinate at which to draw the text.
}
```
Each position after the first receives a clone of the original element.
The idea is that that the width, height, and general 'identity' of the
text is constant no matter where it is placed; the placements are a
secondary property.
Canvas maintains a cache of recently-used text info objects; getTextInfo
either returns the cached element or creates a new entry.
The layer parameter is string of space-separated CSS classes uniquely
identifying the layer containing this text.
Text is the text string to retrieve info for.
Font is either a string of space-separated CSS classes or a font-spec object,
defining the text's font and style.
Angle is the angle at which to rotate the text, in degrees. Angle is currently unused,
it will be implemented in the future.
The last parameter is the Maximum width of the text before it wraps.
The method returns a text info object.
*/
Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) {
var textStyle, layerCache, styleCache, info;
// Cast the value to a string, in case we were given a number or such
text = '' + text;
// If the font is a font-spec object, generate a CSS font definition
if (typeof font === 'object') {
textStyle = font.style + ' ' + font.variant + ' ' + font.weight + ' ' + font.size + 'px/' + font.lineHeight + 'px ' + font.family;
} else {
textStyle = font;
}
// Retrieve (or create) the cache for the text's layer and styles
layerCache = this._textCache[layer];
if (layerCache == null) {
layerCache = this._textCache[layer] = {};
}
styleCache = layerCache[textStyle];
if (styleCache == null) {
styleCache = layerCache[textStyle] = {};
}
var key = generateKey(text);
info = styleCache[key];
// If we can't find a matching element in our cache, create a new one
if (!info) {
var element = document.createElementNS('http://www.w3.org/2000/svg', 'text');
if (text.indexOf('<br>') !== -1) {
addTspanElements(text, element, -9999);
} else {
var textNode = document.createTextNode(text);
element.appendChild(textNode);
}
element.style.position = 'absolute';
element.style.maxWidth = width;
element.setAttributeNS(null, 'x', -9999);
element.setAttributeNS(null, 'y', -9999);
if (typeof font === 'object') {
element.style.font = textStyle;
element.style.fill = font.fill;
} else if (typeof font === 'string') {
element.setAttribute('class', font);
}
this.getSVGLayer(layer).appendChild(element);
var elementRect = element.getBBox();
info = styleCache[key] = {
width: elementRect.width,
height: elementRect.height,
measured: true,
element: element,
positions: []
};
//remove elements from dom
while (element.firstChild) {
element.removeChild(element.firstChild);
}
element.parentNode.removeChild(element);
}
info.measured = true;
return info;
};
/**
- addText (layer, x, y, text, font, angle, width, halign, valign, transforms)
Adds a text string to the canvas text overlay.
The text isn't drawn immediately; it is marked as rendering, which will
result in its addition to the canvas on the next render pass.
The layer is string of space-separated CSS classes uniquely
identifying the layer containing this text.
X and Y represents the X and Y coordinate at which to draw the text.
and text is the string to draw
*/
Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign, transforms) {
var info = this.getTextInfo(layer, text, font, angle, width),
positions = info.positions;
// Tweak the div's position to match the text's alignment
if (halign === 'center') {
x -= info.width / 2;
} else if (halign === 'right') {
x -= info.width;
}
if (valign === 'middle') {
y -= info.height / 2;
} else if (valign === 'bottom') {
y -= info.height;
}
y += 0.75 * info.height;
// Determine whether this text already exists at this position.
// If so, mark it for inclusion in the next render pass.
for (var i = 0, position; positions[i]; i++) {
position = positions[i];
if (position.x === x && position.y === y && position.text === text) {
position.active = true;
return;
} else if (position.active === false) {
position.active = true;
position.text = text;
if (text.indexOf('<br>') !== -1) {
y -= 0.25 * info.height;
addTspanElements(text, position.element, x);
} else {
position.element.textContent = text;
}
position.element.setAttributeNS(null, 'x', x);
position.element.setAttributeNS(null, 'y', y);
position.x = x;
position.y = y;
return;
}
}
// If the text doesn't exist at this position, create a new entry
// For the very first position we'll re-use the original element,
// while for subsequent ones we'll clone it.
position = {
active: true,
rendered: false,
element: positions.length ? info.element.cloneNode() : info.element,
text: text,
x: x,
y: y
};
positions.push(position);
if (text.indexOf('<br>') !== -1) {
y -= 0.25 * info.height;
addTspanElements(text, position.element, x);
} else {
position.element.textContent = text;
}
// Move the element to its final position within the container
position.element.setAttributeNS(null, 'x', x);
position.element.setAttributeNS(null, 'y', y);
position.element.style.textAlign = halign;
if (transforms) {
transforms.forEach(function(t) {
info.element.transform.baseVal.appendItem(t);
});
}
};
var addTspanElements = function(text, element, x) {
var lines = text.split('<br>'),
tspan, i, offset;
for (i = 0; i < lines.length; i++) {
if (!element.childNodes[i]) {
tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
element.appendChild(tspan);
} else {
tspan = element.childNodes[i];
}
tspan.textContent = lines[i];
offset = i * 1 + 'em';
tspan.setAttributeNS(null, 'dy', offset);
tspan.setAttributeNS(null, 'x', x);
}
}
/**
- removeText (layer, x, y, text, font, angle)
The function removes one or more text strings from the canvas text overlay.
If no parameters are given, all text within the layer is removed.
Note that the text is not immediately removed; it is simply marked as
inactive, which will result in its removal on the next render pass.
This avoids the performance penalty for 'clear and redraw' behavior,
where we potentially get rid of all text on a layer, but will likely
add back most or all of it later, as when redrawing axes, for example.
The layer is a string of space-separated CSS classes uniquely
identifying the layer containing this text. The following parameter are
X and Y coordinate of the text.
Text is the string to remove, while the font is either a string of space-separated CSS
classes or a font-spec object, defining the text's font and style.
*/
Canvas.prototype.removeText = function(layer, x, y, text, font, angle) {
var info, htmlYCoord;
if (text == null) {
var layerCache = this._textCache[layer];
if (layerCache != null) {
for (var styleKey in layerCache) {
if (hasOwnProperty.call(layerCache, styleKey)) {
var styleCache = layerCache[styleKey];
for (var key in styleCache) {
if (hasOwnProperty.call(styleCache, key)) {
var positions = styleCache[key].positions;
positions.forEach(function(position) {
position.active = false;
});
}
}
}
}
}
} else {
info = this.getTextInfo(layer, text, font, angle);
positions = info.positions;
positions.forEach(function(position) {
htmlYCoord = y + 0.75 * info.height;
if (position.x === x && position.y === htmlYCoord && position.text === text) {
position.active = false;
}
});
}
};
/**
- clearCache()
Clears the cache used to speed up the text size measurements.
As an (unfortunate) side effect all text within the text Layer is removed.
Use this function before plot.setupGrid() and plot.draw() if the plot just
became visible or the styles changed.
*/
Canvas.prototype.clearCache = function() {
var cache = this._textCache;
for (var layerKey in cache) {
if (hasOwnProperty.call(cache, layerKey)) {
var layer = this.getSVGLayer(layerKey);
while (layer.firstChild) {
layer.removeChild(layer.firstChild);
}
}
};
this._textCache = {};
};
function generateKey(text) {
return text.replace(/0|1|2|3|4|5|6|7|8|9/g, '0');
}
if (!window.Flot) {
window.Flot = {};
}
window.Flot.Canvas = Canvas;
})(jQuery);

View File

@ -1,199 +0,0 @@
/* Plugin for jQuery for working with colors.
*
* Version 1.1.
*
* Inspiration from jQuery color animation plugin by John Resig.
*
* Released under the MIT license by Ole Laursen, October 2009.
*
* Examples:
*
* $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
* var c = $.color.extract($("#mydiv"), 'background-color');
* console.log(c.r, c.g, c.b, c.a);
* $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
*
* Note that .scale() and .add() return the same modified object
* instead of making a new one.
*
* V. 1.1: Fix error handling so e.g. parsing an empty string does
* produce a color rather than just crashing.
*/
(function($) {
$.color = {};
// construct color object with some convenient chainable helpers
$.color.make = function (r, g, b, a) {
var o = {};
o.r = r || 0;
o.g = g || 0;
o.b = b || 0;
o.a = a != null ? a : 1;
o.add = function (c, d) {
for (var i = 0; i < c.length; ++i) {
o[c.charAt(i)] += d;
}
return o.normalize();
};
o.scale = function (c, f) {
for (var i = 0; i < c.length; ++i) {
o[c.charAt(i)] *= f;
}
return o.normalize();
};
o.toString = function () {
if (o.a >= 1.0) {
return "rgb(" + [o.r, o.g, o.b].join(",") + ")";
} else {
return "rgba(" + [o.r, o.g, o.b, o.a].join(",") + ")";
}
};
o.normalize = function () {
function clamp(min, value, max) {
return value < min ? min : (value > max ? max : value);
}
o.r = clamp(0, parseInt(o.r), 255);
o.g = clamp(0, parseInt(o.g), 255);
o.b = clamp(0, parseInt(o.b), 255);
o.a = clamp(0, o.a, 1);
return o;
};
o.clone = function () {
return $.color.make(o.r, o.b, o.g, o.a);
};
return o.normalize();
}
// extract CSS color property from element, going up in the DOM
// if it's "transparent"
$.color.extract = function (elem, css) {
var c;
do {
c = elem.css(css).toLowerCase();
// keep going until we find an element that has color, or
// we hit the body or root (have no parent)
if (c !== '' && c !== 'transparent') {
break;
}
elem = elem.parent();
} while (elem.length && !$.nodeName(elem.get(0), "body"));
// catch Safari's way of signalling transparent
if (c === "rgba(0, 0, 0, 0)") {
c = "transparent";
}
return $.color.parse(c);
}
// parse CSS color string (like "rgb(10, 32, 43)" or "#fff"),
// returns color object, if parsing failed, you get black (0, 0,
// 0) out
$.color.parse = function (str) {
var res, m = $.color.make;
// Look for rgb(num,num,num)
res = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str);
if (res) {
return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10));
}
// Look for rgba(num,num,num,num)
res = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str)
if (res) {
return m(parseInt(res[1], 10), parseInt(res[2], 10), parseInt(res[3], 10), parseFloat(res[4]));
}
// Look for rgb(num%,num%,num%)
res = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(str);
if (res) {
return m(parseFloat(res[1]) * 2.55, parseFloat(res[2]) * 2.55, parseFloat(res[3]) * 2.55);
}
// Look for rgba(num%,num%,num%,num)
res = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str);
if (res) {
return m(parseFloat(res[1]) * 2.55, parseFloat(res[2]) * 2.55, parseFloat(res[3]) * 2.55, parseFloat(res[4]));
}
// Look for #a0b1c2
res = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str);
if (res) {
return m(parseInt(res[1], 16), parseInt(res[2], 16), parseInt(res[3], 16));
}
// Look for #fff
res = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str);
if (res) {
return m(parseInt(res[1] + res[1], 16), parseInt(res[2] + res[2], 16), parseInt(res[3] + res[3], 16));
}
// Otherwise, we're most likely dealing with a named color
var name = $.trim(str).toLowerCase();
if (name === "transparent") {
return m(255, 255, 255, 0);
} else {
// default to black
res = lookupColors[name] || [0, 0, 0];
return m(res[0], res[1], res[2]);
}
}
var lookupColors = {
aqua: [0, 255, 255],
azure: [240, 255, 255],
beige: [245, 245, 220],
black: [0, 0, 0],
blue: [0, 0, 255],
brown: [165, 42, 42],
cyan: [0, 255, 255],
darkblue: [0, 0, 139],
darkcyan: [0, 139, 139],
darkgrey: [169, 169, 169],
darkgreen: [0, 100, 0],
darkkhaki: [189, 183, 107],
darkmagenta: [139, 0, 139],
darkolivegreen: [85, 107, 47],
darkorange: [255, 140, 0],
darkorchid: [153, 50, 204],
darkred: [139, 0, 0],
darksalmon: [233, 150, 122],
darkviolet: [148, 0, 211],
fuchsia: [255, 0, 255],
gold: [255, 215, 0],
green: [0, 128, 0],
indigo: [75, 0, 130],
khaki: [240, 230, 140],
lightblue: [173, 216, 230],
lightcyan: [224, 255, 255],
lightgreen: [144, 238, 144],
lightgrey: [211, 211, 211],
lightpink: [255, 182, 193],
lightyellow: [255, 255, 224],
lime: [0, 255, 0],
magenta: [255, 0, 255],
maroon: [128, 0, 0],
navy: [0, 0, 128],
olive: [128, 128, 0],
orange: [255, 165, 0],
pink: [255, 192, 203],
purple: [128, 0, 128],
violet: [128, 0, 128],
red: [255, 0, 0],
silver: [192, 192, 192],
white: [255, 255, 255],
yellow: [255, 255, 0]
};
})(jQuery);

View File

@ -1,212 +0,0 @@
/*
Axis label plugin for flot
Derived from:
Axis Labels Plugin for flot.
http://github.com/markrcote/flot-axislabels
Original code is Copyright (c) 2010 Xuan Luo.
Original code was released under the GPLv3 license by Xuan Luo, September 2010.
Original code was rereleased under the MIT license by Xuan Luo, April 2012.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(function($) {
"use strict";
var options = {
axisLabels: {
show: true
}
};
function AxisLabel(axisName, position, padding, placeholder, axisLabel, surface) {
this.axisName = axisName;
this.position = position;
this.padding = padding;
this.placeholder = placeholder;
this.axisLabel = axisLabel;
this.surface = surface;
this.width = 0;
this.height = 0;
this.elem = null;
}
AxisLabel.prototype.calculateSize = function() {
var axisId = this.axisName + 'Label',
layerId = axisId + 'Layer',
className = axisId + ' axisLabels';
var info = this.surface.getTextInfo(layerId, this.axisLabel, className);
this.labelWidth = info.width;
this.labelHeight = info.height;
if (this.position === 'left' || this.position === 'right') {
this.width = this.labelHeight + this.padding;
this.height = 0;
} else {
this.width = 0;
this.height = this.labelHeight + this.padding;
}
};
AxisLabel.prototype.transforms = function(degrees, x, y, svgLayer) {
var transforms = [], translate, rotate;
if (x !== 0 || y !== 0) {
translate = svgLayer.createSVGTransform();
translate.setTranslate(x, y);
transforms.push(translate);
}
if (degrees !== 0) {
rotate = svgLayer.createSVGTransform();
var centerX = Math.round(this.labelWidth / 2),
centerY = 0;
rotate.setRotate(degrees, centerX, centerY);
transforms.push(rotate);
}
return transforms;
};
AxisLabel.prototype.calculateOffsets = function(box) {
var offsets = {
x: 0,
y: 0,
degrees: 0
};
if (this.position === 'bottom') {
offsets.x = box.left + box.width / 2 - this.labelWidth / 2;
offsets.y = box.top + box.height - this.labelHeight;
} else if (this.position === 'top') {
offsets.x = box.left + box.width / 2 - this.labelWidth / 2;
offsets.y = box.top;
} else if (this.position === 'left') {
offsets.degrees = -90;
offsets.x = box.left - this.labelWidth / 2;
offsets.y = box.height / 2 + box.top;
} else if (this.position === 'right') {
offsets.degrees = 90;
offsets.x = box.left + box.width - this.labelWidth / 2;
offsets.y = box.height / 2 + box.top;
}
offsets.x = Math.round(offsets.x);
offsets.y = Math.round(offsets.y);
return offsets;
};
AxisLabel.prototype.cleanup = function() {
var axisId = this.axisName + 'Label',
layerId = axisId + 'Layer',
className = axisId + ' axisLabels';
this.surface.removeText(layerId, 0, 0, this.axisLabel, className);
};
AxisLabel.prototype.draw = function(box) {
var axisId = this.axisName + 'Label',
layerId = axisId + 'Layer',
className = axisId + ' axisLabels',
offsets = this.calculateOffsets(box),
style = {
position: 'absolute',
bottom: '',
right: '',
display: 'inline-block',
'white-space': 'nowrap'
};
var layer = this.surface.getSVGLayer(layerId);
var transforms = this.transforms(offsets.degrees, offsets.x, offsets.y, layer.parentNode);
this.surface.addText(layerId, 0, 0, this.axisLabel, className, undefined, undefined, undefined, undefined, transforms);
this.surface.render();
Object.keys(style).forEach(function(key) {
layer.style[key] = style[key];
});
};
function init(plot) {
plot.hooks.processOptions.push(function(plot, options) {
if (!options.axisLabels.show) {
return;
}
var axisLabels = {};
var defaultPadding = 2; // padding between axis and tick labels
plot.hooks.axisReserveSpace.push(function(plot, axis) {
var opts = axis.options;
var axisName = axis.direction + axis.n;
axis.labelHeight += axis.boxPosition.centerY;
axis.labelWidth += axis.boxPosition.centerX;
if (!opts || !opts.axisLabel || !axis.show) {
return;
}
var padding = opts.axisLabelPadding === undefined
? defaultPadding
: opts.axisLabelPadding;
var axisLabel = axisLabels[axisName];
if (!axisLabel) {
axisLabel = new AxisLabel(axisName,
opts.position, padding,
plot.getPlaceholder()[0], opts.axisLabel, plot.getSurface());
axisLabels[axisName] = axisLabel;
}
axisLabel.calculateSize();
// Incrementing the sizes of the tick labels.
axis.labelHeight += axisLabel.height;
axis.labelWidth += axisLabel.width;
});
// TODO - use the drawAxis hook
plot.hooks.draw.push(function(plot, ctx) {
$.each(plot.getAxes(), function(flotAxisName, axis) {
var opts = axis.options;
if (!opts || !opts.axisLabel || !axis.show) {
return;
}
var axisName = axis.direction + axis.n;
axisLabels[axisName].draw(axis.box);
});
});
plot.hooks.shutdown.push(function(plot, eventHolder) {
for (var axisName in axisLabels) {
axisLabels[axisName].cleanup();
}
});
});
};
$.plot.plugins.push({
init: init,
options: options,
name: 'axisLabels',
version: '3.0'
});
})(jQuery);

View File

@ -1,98 +0,0 @@
/** ## jquery.flot.browser.js
This plugin is used to make available some browser-related utility functions.
### Methods
*/
(function ($) {
'use strict';
var browser = {
/**
- getPageXY(e)
Calculates the pageX and pageY using the screenX, screenY properties of the event
and the scrolling of the page. This is needed because the pageX and pageY
properties of the event are not correct while running tests in Edge. */
getPageXY: function (e) {
// This code is inspired from https://stackoverflow.com/a/3464890
var doc = document.documentElement,
pageX = e.clientX + (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),
pageY = e.clientY + (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
return { X: pageX, Y: pageY };
},
/**
- getPixelRatio(context)
This function returns the current pixel ratio defined by the product of desktop
zoom and page zoom.
Additional info: https://www.html5rocks.com/en/tutorials/canvas/hidpi/
*/
getPixelRatio: function(context) {
var devicePixelRatio = window.devicePixelRatio || 1,
backingStoreRatio =
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;
return devicePixelRatio / backingStoreRatio;
},
/**
- isSafari, isMobileSafari, isOpera, isFirefox, isIE, isEdge, isChrome, isBlink
This is a collection of functions, used to check if the code is running in a
particular browser or Javascript engine.
*/
isSafari: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Safari 3.0+ "[object HTMLElementConstructor]"
return /constructor/i.test(window.top.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window.top['safari'] || (typeof window.top.safari !== 'undefined' && window.top.safari.pushNotification));
},
isMobileSafari: function() {
//isMobileSafari adapted from https://stackoverflow.com/questions/3007480/determine-if-user-navigated-from-mobile-safari
return navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/);
},
isOpera: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
//Opera 8.0+
return (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
},
isFirefox: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Firefox 1.0+
return typeof InstallTrigger !== 'undefined';
},
isIE: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Internet Explorer 6-11
return /*@cc_on!@*/false || !!document.documentMode;
},
isEdge: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Edge 20+
return !browser.isIE() && !!window.StyleMedia;
},
isChrome: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Chrome 1+
return !!window.chrome && !!window.chrome.webstore;
},
isBlink: function() {
// *** https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
return (browser.isChrome() || browser.isOpera()) && !!window.CSS;
}
};
$.plot.browser = browser;
})(jQuery);

View File

@ -1,202 +0,0 @@
/* Flot plugin for plotting textual data or categories.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
allows you to plot such a dataset directly.
To enable it, you must specify mode: "categories" on the axis with the textual
labels, e.g.
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
By default, the labels are ordered as they are met in the data series. If you
need a different ordering, you can specify "categories" on the axis options
and list the categories there:
xaxis: {
mode: "categories",
categories: ["February", "March", "April"]
}
If you need to customize the distances between the categories, you can specify
"categories" as an object mapping labels to values
xaxis: {
mode: "categories",
categories: { "February": 1, "March": 3, "April": 4 }
}
If you don't specify all categories, the remaining categories will be numbered
from the max value plus 1 (with a spacing of 1 between each).
Internally, the plugin works by transforming the input data through an auto-
generated mapping where the first category becomes 0, the second 1, etc.
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
is visible in hover and click events that return numbers rather than the
category labels). The plugin also overrides the tick generator to spit out the
categories as ticks instead of the values.
If you need to map a value back to its label, the mapping is always accessible
as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
*/
(function ($) {
var options = {
xaxis: {
categories: null
},
yaxis: {
categories: null
}
};
function processRawData(plot, series, data, datapoints) {
// if categories are enabled, we need to disable
// auto-transformation to numbers so the strings are intact
// for later processing
var xCategories = series.xaxis.options.mode === "categories",
yCategories = series.yaxis.options.mode === "categories";
if (!(xCategories || yCategories)) {
return;
}
var format = datapoints.format;
if (!format) {
// FIXME: auto-detection should really not be defined here
var s = series;
format = [];
format.push({ x: true, number: true, required: true, computeRange: true});
format.push({ y: true, number: true, required: true, computeRange: true });
if (s.bars.show || (s.lines.show && s.lines.fill)) {
var autoScale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
format.push({ y: true, number: true, required: false, defaultValue: 0, computeRange: autoScale });
if (s.bars.horizontal) {
delete format[format.length - 1].y;
format[format.length - 1].x = true;
}
}
datapoints.format = format;
}
for (var m = 0; m < format.length; ++m) {
if (format[m].x && xCategories) {
format[m].number = false;
}
if (format[m].y && yCategories) {
format[m].number = false;
format[m].computeRange = false;
}
}
}
function getNextIndex(categories) {
var index = -1;
for (var v in categories) {
if (categories[v] > index) {
index = categories[v];
}
}
return index + 1;
}
function categoriesTickGenerator(axis) {
var res = [];
for (var label in axis.categories) {
var v = axis.categories[label];
if (v >= axis.min && v <= axis.max) {
res.push([v, label]);
}
}
res.sort(function (a, b) { return a[0] - b[0]; });
return res;
}
function setupCategoriesForAxis(series, axis, datapoints) {
if (series[axis].options.mode !== "categories") {
return;
}
if (!series[axis].categories) {
// parse options
var c = {}, o = series[axis].options.categories || {};
if ($.isArray(o)) {
for (var i = 0; i < o.length; ++i) {
c[o[i]] = i;
}
} else {
for (var v in o) {
c[v] = o[v];
}
}
series[axis].categories = c;
}
// fix ticks
if (!series[axis].options.ticks) {
series[axis].options.ticks = categoriesTickGenerator;
}
transformPointsOnAxis(datapoints, axis, series[axis].categories);
}
function transformPointsOnAxis(datapoints, axis, categories) {
// go through the points, transforming them
var points = datapoints.points,
ps = datapoints.pointsize,
format = datapoints.format,
formatColumn = axis.charAt(0),
index = getNextIndex(categories);
for (var i = 0; i < points.length; i += ps) {
if (points[i] == null) {
continue;
}
for (var m = 0; m < ps; ++m) {
var val = points[i + m];
if (val == null || !format[m][formatColumn]) {
continue;
}
if (!(val in categories)) {
categories[val] = index;
++index;
}
points[i + m] = categories[val];
}
}
}
function processDatapoints(plot, series, datapoints) {
setupCategoriesForAxis(series, "xaxis", datapoints);
setupCategoriesForAxis(series, "yaxis", datapoints);
}
function init(plot) {
plot.hooks.processRawData.push(processRawData);
plot.hooks.processDatapoints.push(processDatapoints);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'categories',
version: '1.0'
});
})(jQuery);

View File

@ -1,325 +0,0 @@
/** ## jquery.flot.composeImages.js
This plugin is used to expose a function used to overlap several canvases and
SVGs, for the purpose of creating a snaphot out of them.
### When composeImages is used:
When multiple canvases and SVGs have to be overlapped into a single image
and their offset on the page, must be preserved.
### Where can be used:
In creating a downloadable snapshot of the plots, axes, cursors etc of a graph.
### How it works:
The entry point is composeImages function. It expects an array of objects,
which should be either canvases or SVGs (or a mix). It does a prevalidation
of them, by verifying if they will be usable or not, later in the flow.
After selecting only usable sources, it passes them to getGenerateTempImg
function, which generates temporary images out of them. This function
expects that some of the passed sources (canvas or SVG) may still have
problems being converted to an image and makes sure the promises system,
used by composeImages function, moves forward. As an example, SVGs with
missing information from header or with unsupported content, may lead to
failure in generating the temporary image. Temporary images are required
mostly on extracting content from SVGs, but this is also where the x/y
offsets are extracted for each image which will be added. For SVGs in
particular, their CSS rules have to be applied.
After all temporary images are generated, they are overlapped using
getExecuteImgComposition function. This is where the destination canvas
is set to the proper dimensions. It is then output by composeImages.
This function returns a promise, which can be used to wait for the whole
composition process. It requires to be asynchronous, because this is how
temporary images load their data.
*/
(function($) {
"use strict";
const GENERALFAILURECALLBACKERROR = -100; //simply a negative number
const SUCCESSFULIMAGEPREPARATION = 0;
const EMPTYARRAYOFIMAGESOURCES = -1;
const NEGATIVEIMAGESIZE = -2;
var pixelRatio = 1;
var browser = $.plot.browser;
var getPixelRatio = browser.getPixelRatio;
function composeImages(canvasOrSvgSources, destinationCanvas) {
var validCanvasOrSvgSources = canvasOrSvgSources.filter(isValidSource);
pixelRatio = getPixelRatio(destinationCanvas.getContext('2d'));
var allImgCompositionPromises = validCanvasOrSvgSources.map(function(validCanvasOrSvgSource) {
var tempImg = new Image();
var currentPromise = new Promise(getGenerateTempImg(tempImg, validCanvasOrSvgSource));
return currentPromise;
});
var lastPromise = Promise.all(allImgCompositionPromises).then(getExecuteImgComposition(destinationCanvas), failureCallback);
return lastPromise;
}
function isValidSource(canvasOrSvgSource) {
var isValidFromCanvas = true;
var isValidFromContent = true;
if ((canvasOrSvgSource === null) || (canvasOrSvgSource === undefined)) {
isValidFromContent = false;
} else {
if (canvasOrSvgSource.tagName === 'CANVAS') {
if ((canvasOrSvgSource.getBoundingClientRect().right === canvasOrSvgSource.getBoundingClientRect().left) ||
(canvasOrSvgSource.getBoundingClientRect().bottom === canvasOrSvgSource.getBoundingClientRect().top)) {
isValidFromCanvas = false;
}
}
}
return isValidFromContent && isValidFromCanvas && (window.getComputedStyle(canvasOrSvgSource).visibility === 'visible');
}
function getGenerateTempImg(tempImg, canvasOrSvgSource) {
tempImg.sourceDescription = '<info className="' + canvasOrSvgSource.className + '" tagName="' + canvasOrSvgSource.tagName + '" id="' + canvasOrSvgSource.id + '">';
tempImg.sourceComponent = canvasOrSvgSource;
return function doGenerateTempImg(successCallbackFunc, failureCallbackFunc) {
tempImg.onload = function(evt) {
tempImg.successfullyLoaded = true;
successCallbackFunc(tempImg);
};
tempImg.onabort = function(evt) {
tempImg.successfullyLoaded = false;
console.log('Can\'t generate temp image from ' + tempImg.sourceDescription + '. It is possible that it is missing some properties or its content is not supported by this browser. Source component:', tempImg.sourceComponent);
successCallbackFunc(tempImg); //call successCallback, to allow snapshot of all working images
};
tempImg.onerror = function(evt) {
tempImg.successfullyLoaded = false;
console.log('Can\'t generate temp image from ' + tempImg.sourceDescription + '. It is possible that it is missing some properties or its content is not supported by this browser. Source component:', tempImg.sourceComponent);
successCallbackFunc(tempImg); //call successCallback, to allow snapshot of all working images
};
generateTempImageFromCanvasOrSvg(canvasOrSvgSource, tempImg);
};
}
function getExecuteImgComposition(destinationCanvas) {
return function executeImgComposition(tempImgs) {
var compositionResult = copyImgsToCanvas(tempImgs, destinationCanvas);
return compositionResult;
};
}
function copyCanvasToImg(canvas, img) {
img.src = canvas.toDataURL('image/png');
}
function getCSSRules(document) {
var styleSheets = document.styleSheets,
rulesList = [];
for (var i = 0; i < styleSheets.length; i++) {
// in Chrome, the external CSS files are empty when the page is directly loaded from disk
var rules = styleSheets[i].cssRules || [];
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
rulesList.push(rule.cssText);
}
}
return rulesList;
}
function embedCSSRulesInSVG(rules, svg) {
var text = [
'<svg class="snapshot ' + svg.classList + '" width="' + svg.width.baseVal.value * pixelRatio + '" height="' + svg.height.baseVal.value * pixelRatio + '" viewBox="0 0 ' + svg.width.baseVal.value + ' ' + svg.height.baseVal.value + '" xmlns="http://www.w3.org/2000/svg">',
'<style>',
'/* <![CDATA[ */',
rules.join('\n'),
'/* ]]> */',
'</style>',
svg.innerHTML,
'</svg>'
].join('\n');
return text;
}
function copySVGToImgMostBrowsers(svg, img) {
var rules = getCSSRules(document),
source = embedCSSRulesInSVG(rules, svg);
source = patchSVGSource(source);
var blob = new Blob([source], {type: "image/svg+xml;charset=utf-8"}),
domURL = self.URL || self.webkitURL || self,
url = domURL.createObjectURL(blob);
img.src = url;
}
function copySVGToImgSafari(svg, img) {
// Use this method to convert a string buffer array to a binary string.
// Do so by breaking up large strings into smaller substrings; this is necessary to avoid the
// "maximum call stack size exceeded" exception that can happen when calling 'String.fromCharCode.apply'
// with a very long array.
function buildBinaryString (arrayBuffer) {
var binaryString = "";
const utf8Array = new Uint8Array(arrayBuffer);
const blockSize = 16384;
for (var i = 0; i < utf8Array.length; i = i + blockSize) {
const binarySubString = String.fromCharCode.apply(null, utf8Array.subarray(i, i + blockSize));
binaryString = binaryString + binarySubString;
}
return binaryString;
};
var rules = getCSSRules(document),
source = embedCSSRulesInSVG(rules, svg),
data,
utf8BinaryString;
source = patchSVGSource(source);
// Encode the string as UTF-8 and convert it to a binary string. The UTF-8 encoding is required to
// capture unicode characters correctly.
utf8BinaryString = buildBinaryString(new (TextEncoder || TextEncoderLite)('utf-8').encode(source));
data = "data:image/svg+xml;base64," + btoa(utf8BinaryString);
img.src = data;
}
function patchSVGSource(svgSource) {
var source = '';
//add name spaces.
if (!svgSource.match(/^<svg[^>]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)) {
source = svgSource.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"');
}
if (!svgSource.match(/^<svg[^>]+"http:\/\/www\.w3\.org\/1999\/xlink"/)) {
source = svgSource.replace(/^<svg/, '<svg xmlns:xlink="http://www.w3.org/1999/xlink"');
}
//add xml declaration
return '<?xml version="1.0" standalone="no"?>\r\n' + source;
}
function copySVGToImg(svg, img) {
if (browser.isSafari() || browser.isMobileSafari()) {
copySVGToImgSafari(svg, img);
} else {
copySVGToImgMostBrowsers(svg, img);
}
}
function adaptDestSizeToZoom(destinationCanvas, sources) {
function containsSVGs(source) {
return source.srcImgTagName === 'svg';
}
if (sources.find(containsSVGs) !== undefined) {
if (pixelRatio < 1) {
destinationCanvas.width = destinationCanvas.width * pixelRatio;
destinationCanvas.height = destinationCanvas.height * pixelRatio;
}
}
}
function prepareImagesToBeComposed(sources, destination) {
var result = SUCCESSFULIMAGEPREPARATION;
if (sources.length === 0) {
result = EMPTYARRAYOFIMAGESOURCES; //nothing to do if called without sources
} else {
var minX = sources[0].genLeft;
var minY = sources[0].genTop;
var maxX = sources[0].genRight;
var maxY = sources[0].genBottom;
var i = 0;
for (i = 1; i < sources.length; i++) {
if (minX > sources[i].genLeft) {
minX = sources[i].genLeft;
}
if (minY > sources[i].genTop) {
minY = sources[i].genTop;
}
}
for (i = 1; i < sources.length; i++) {
if (maxX < sources[i].genRight) {
maxX = sources[i].genRight;
}
if (maxY < sources[i].genBottom) {
maxY = sources[i].genBottom;
}
}
if ((maxX - minX <= 0) || (maxY - minY <= 0)) {
result = NEGATIVEIMAGESIZE; //this might occur on hidden images
} else {
destination.width = Math.round(maxX - minX);
destination.height = Math.round(maxY - minY);
for (i = 0; i < sources.length; i++) {
sources[i].xCompOffset = sources[i].genLeft - minX;
sources[i].yCompOffset = sources[i].genTop - minY;
}
adaptDestSizeToZoom(destination, sources);
}
}
return result;
}
function copyImgsToCanvas(sources, destination) {
var prepareImagesResult = prepareImagesToBeComposed(sources, destination);
if (prepareImagesResult === SUCCESSFULIMAGEPREPARATION) {
var destinationCtx = destination.getContext('2d');
for (var i = 0; i < sources.length; i++) {
if (sources[i].successfullyLoaded === true) {
destinationCtx.drawImage(sources[i], sources[i].xCompOffset * pixelRatio, sources[i].yCompOffset * pixelRatio);
}
}
}
return prepareImagesResult;
}
function adnotateDestImgWithBoundingClientRect(srcCanvasOrSvg, destImg) {
destImg.genLeft = srcCanvasOrSvg.getBoundingClientRect().left;
destImg.genTop = srcCanvasOrSvg.getBoundingClientRect().top;
if (srcCanvasOrSvg.tagName === 'CANVAS') {
destImg.genRight = destImg.genLeft + srcCanvasOrSvg.width;
destImg.genBottom = destImg.genTop + srcCanvasOrSvg.height;
}
if (srcCanvasOrSvg.tagName === 'svg') {
destImg.genRight = srcCanvasOrSvg.getBoundingClientRect().right;
destImg.genBottom = srcCanvasOrSvg.getBoundingClientRect().bottom;
}
}
function generateTempImageFromCanvasOrSvg(srcCanvasOrSvg, destImg) {
if (srcCanvasOrSvg.tagName === 'CANVAS') {
copyCanvasToImg(srcCanvasOrSvg, destImg);
}
if (srcCanvasOrSvg.tagName === 'svg') {
copySVGToImg(srcCanvasOrSvg, destImg);
}
destImg.srcImgTagName = srcCanvasOrSvg.tagName;
adnotateDestImgWithBoundingClientRect(srcCanvasOrSvg, destImg);
}
function failureCallback() {
return GENERALFAILURECALLBACKERROR;
}
// used for testing
$.plot.composeImages = composeImages;
function init(plot) {
// used to extend the public API of the plot
plot.composeImages = composeImages;
}
$.plot.plugins.push({
init: init,
name: 'composeImages',
version: '1.0'
});
})(jQuery);

View File

@ -1,202 +0,0 @@
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
crosshair: {
mode: null or "x" or "y" or "xy"
color: color
lineWidth: number
}
Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
crosshair that lets you trace the values on the x axis, "y" enables a
horizontal crosshair and "xy" enables them both. "color" is the color of the
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
the drawn lines (default is 1).
The plugin also adds four public methods:
- setCrosshair( pos )
Set the position of the crosshair. Note that this is cleared if the user
moves the mouse. "pos" is in coordinates of the plot and should be on the
form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
axes), which is coincidentally the same format as what you get from a
"plothover" event. If "pos" is null, the crosshair is cleared.
- clearCrosshair()
Clear the crosshair.
- lockCrosshair(pos)
Cause the crosshair to lock to the current location, no longer updating if
the user moves the mouse. Optionally supply a position (passed on to
setCrosshair()) to move it to.
Example usage:
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
$("#graph").bind( "plothover", function ( evt, position, item ) {
if ( item ) {
// Lock the crosshair to the data point being hovered
myFlot.lockCrosshair({
x: item.datapoint[ 0 ],
y: item.datapoint[ 1 ]
});
} else {
// Return normal crosshair operation
myFlot.unlockCrosshair();
}
});
- unlockCrosshair()
Free the crosshair to move again after locking it.
*/
(function ($) {
var options = {
crosshair: {
mode: null, // one of null, "x", "y" or "xy",
color: "rgba(170, 0, 0, 0.80)",
lineWidth: 1
}
};
function init(plot) {
// position of crosshair in pixels
var crosshair = {x: -1, y: -1, locked: false, highlighted: false};
plot.setCrosshair = function setCrosshair(pos) {
if (!pos) {
crosshair.x = -1;
} else {
var o = plot.p2c(pos);
crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
}
plot.triggerRedrawOverlay();
};
plot.clearCrosshair = plot.setCrosshair; // passes null for pos
plot.lockCrosshair = function lockCrosshair(pos) {
if (pos) {
plot.setCrosshair(pos);
}
crosshair.locked = true;
};
plot.unlockCrosshair = function unlockCrosshair() {
crosshair.locked = false;
crosshair.rect = null;
};
function onMouseOut(e) {
if (crosshair.locked) {
return;
}
if (crosshair.x !== -1) {
crosshair.x = -1;
plot.triggerRedrawOverlay();
}
}
function onMouseMove(e) {
var offset = plot.offset();
if (crosshair.locked) {
var mouseX = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
var mouseY = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
if ((mouseX > crosshair.x - 4) && (mouseX < crosshair.x + 4) && (mouseY > crosshair.y - 4) && (mouseY < crosshair.y + 4)) {
if (!crosshair.highlighted) {
crosshair.highlighted = true;
plot.triggerRedrawOverlay();
}
} else {
if (crosshair.highlighted) {
crosshair.highlighted = false;
plot.triggerRedrawOverlay();
}
}
return;
}
if (plot.getSelection && plot.getSelection()) {
crosshair.x = -1; // hide the crosshair while selecting
return;
}
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
plot.triggerRedrawOverlay();
}
plot.hooks.bindEvents.push(function (plot, eventHolder) {
if (!plot.getOptions().crosshair.mode) {
return;
}
eventHolder.mouseout(onMouseOut);
eventHolder.mousemove(onMouseMove);
});
plot.hooks.drawOverlay.push(function (plot, ctx) {
var c = plot.getOptions().crosshair;
if (!c.mode) {
return;
}
var plotOffset = plot.getPlotOffset();
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
if (crosshair.x !== -1) {
var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;
ctx.strokeStyle = c.color;
ctx.lineWidth = c.lineWidth;
ctx.lineJoin = "round";
ctx.beginPath();
if (c.mode.indexOf("x") !== -1) {
var drawX = Math.floor(crosshair.x) + adj;
ctx.moveTo(drawX, 0);
ctx.lineTo(drawX, plot.height());
}
if (c.mode.indexOf("y") !== -1) {
var drawY = Math.floor(crosshair.y) + adj;
ctx.moveTo(0, drawY);
ctx.lineTo(plot.width(), drawY);
}
if (crosshair.locked) {
if (crosshair.highlighted) ctx.fillStyle = 'orange';
else ctx.fillStyle = c.color;
ctx.fillRect(Math.floor(crosshair.x) + adj - 4, Math.floor(crosshair.y) + adj - 4, 8, 8);
}
ctx.stroke();
}
ctx.restore();
});
plot.hooks.shutdown.push(function (plot, eventHolder) {
eventHolder.unbind("mouseout", onMouseOut);
eventHolder.unbind("mousemove", onMouseMove);
});
}
$.plot.plugins.push({
init: init,
options: options,
name: 'crosshair',
version: '1.0'
});
})(jQuery);

View File

@ -1,604 +0,0 @@
/**
## jquery.flot.drawSeries.js
This plugin is used by flot for drawing lines, plots, bars or area.
### Public methods
*/
(function($) {
"use strict";
function DrawSeries() {
function plotLine(datapoints, xoffset, yoffset, axisx, axisy, ctx) {
var points = datapoints.points,
ps = datapoints.pointsize,
prevx = null,
prevy = null;
var x1 = 0.0,
y1 = 0.0,
x2 = 0.0,
y2 = 0.0,
i = 0;
ctx.beginPath();
for (i = ps; i < points.length; i += ps) {
x1 = points[i - ps];
y1 = points[i - ps + 1];
x2 = points[i];
y2 = points[i + 1];
if (x1 === null || x2 === null) {
continue;
}
// clip with ymin
if (y1 <= y2 && y1 < axisy.min) {
if (y2 < axisy.min) {
// line segment is outside
continue;
}
// compute new intersection point
x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
y1 = axisy.min;
} else if (y2 <= y1 && y2 < axisy.min) {
if (y1 < axisy.min) {
continue;
}
x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
y2 = axisy.min;
}
// clip with ymax
if (y1 >= y2 && y1 > axisy.max) {
if (y2 > axisy.max) {
continue;
}
x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
y1 = axisy.max;
} else if (y2 >= y1 && y2 > axisy.max) {
if (y1 > axisy.max) {
continue;
}
x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
y2 = axisy.max;
}
// clip with xmin
if (x1 <= x2 && x1 < axisx.min) {
if (x2 < axisx.min) {
continue;
}
y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
x1 = axisx.min;
} else if (x2 <= x1 && x2 < axisx.min) {
if (x1 < axisx.min) {
continue;
}
y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
x2 = axisx.min;
}
// clip with xmax
if (x1 >= x2 && x1 > axisx.max) {
if (x2 > axisx.max) {
continue;
}
y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
x1 = axisx.max;
} else if (x2 >= x1 && x2 > axisx.max) {
if (x1 > axisx.max) {
continue;
}
y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
x2 = axisx.max;
}
if (x1 !== prevx || y1 !== prevy) {
ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);
}
prevx = x2;
prevy = y2;
ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);
}
ctx.stroke();
}
function plotLineArea(datapoints, axisx, axisy, fillTowards, ctx) {
var points = datapoints.points,
ps = datapoints.pointsize,
bottom = fillTowards > axisy.min ? Math.min(axisy.max, fillTowards) : axisy.min,
i = 0,
ypos = 1,
areaOpen = false,
segmentStart = 0,
segmentEnd = 0;
// we process each segment in two turns, first forward
// direction to sketch out top, then once we hit the
// end we go backwards to sketch the bottom
while (true) {
if (ps > 0 && i > points.length + ps) {
break;
}
i += ps; // ps is negative if going backwards
var x1 = points[i - ps],
y1 = points[i - ps + ypos],
x2 = points[i],
y2 = points[i + ypos];
if (ps === -2) {
/* going backwards and no value for the bottom provided in the series*/
y1 = y2 = bottom;
}
if (areaOpen) {
if (ps > 0 && x1 != null && x2 == null) {
// at turning point
segmentEnd = i;
ps = -ps;
ypos = 2;
continue;
}
if (ps < 0 && i === segmentStart + ps) {
// done with the reverse sweep
ctx.fill();
areaOpen = false;
ps = -ps;
i = segmentStart = segmentEnd + ps;
continue;
}
}
if (x1 == null || x2 == null) {
continue;
}
// clip x values
// clip with xmin
if (x1 <= x2 && x1 < axisx.min) {
if (x2 < axisx.min) {
continue;
}
y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
x1 = axisx.min;
} else if (x2 <= x1 && x2 < axisx.min) {
if (x1 < axisx.min) {
continue;
}
y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
x2 = axisx.min;
}
// clip with xmax
if (x1 >= x2 && x1 > axisx.max) {
if (x2 > axisx.max) {
continue;
}
y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
x1 = axisx.max;
} else if (x2 >= x1 && x2 > axisx.max) {
if (x1 > axisx.max) {
continue;
}
y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
x2 = axisx.max;
}
if (!areaOpen) {
// open area
ctx.beginPath();
ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));
areaOpen = true;
}
// now first check the case where both is outside
if (y1 >= axisy.max && y2 >= axisy.max) {
ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));
ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));
continue;
} else if (y1 <= axisy.min && y2 <= axisy.min) {
ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));
ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));
continue;
}
// else it's a bit more complicated, there might
// be a flat maxed out rectangle first, then a
// triangular cutout or reverse; to find these
// keep track of the current x values
var x1old = x1,
x2old = x2;
// clip the y values, without shortcutting, we
// go through all cases in turn
// clip with ymin
if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {
x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
y1 = axisy.min;
} else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {
x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
y2 = axisy.min;
}
// clip with ymax
if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {
x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
y1 = axisy.max;
} else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {
x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
y2 = axisy.max;
}
// if the x value was changed we got a rectangle
// to fill
if (x1 !== x1old) {
ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1));
// it goes to (x1, y1), but we fill that below
}
// fill triangular section, this sometimes result
// in redundant points if (x1, y1) hasn't changed
// from previous line to, but we just ignore that
ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1));
ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));
// fill the other rectangle if it's there
if (x2 !== x2old) {
ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));
ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));
}
}
}
/**
- drawSeriesLines(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient)
This function is used for drawing lines or area fill. In case the series has line decimation function
attached, before starting to draw, as an optimization the points will first be decimated.
The series parameter contains the series to be drawn on ctx context. The plotOffset, plotWidth and
plotHeight are the corresponding parameters of flot used to determine the drawing surface.
The function getColorOrGradient is used to compute the fill style of lines and area.
*/
function drawSeriesLines(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient) {
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
ctx.lineJoin = "round";
if (series.lines.dashes && ctx.setLineDash) {
ctx.setLineDash(series.lines.dashes);
}
var datapoints = {
format: series.datapoints.format,
points: series.datapoints.points,
pointsize: series.datapoints.pointsize
};
if (series.decimate) {
datapoints.points = series.decimate(series, series.xaxis.min, series.xaxis.max, plotWidth, series.yaxis.min, series.yaxis.max, plotHeight);
}
var lw = series.lines.lineWidth;
ctx.lineWidth = lw;
ctx.strokeStyle = series.color;
var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight, getColorOrGradient);
if (fillStyle) {
ctx.fillStyle = fillStyle;
plotLineArea(datapoints, series.xaxis, series.yaxis, series.lines.fillTowards || 0, ctx);
}
if (lw > 0) {
plotLine(datapoints, 0, 0, series.xaxis, series.yaxis, ctx);
}
ctx.restore();
}
/**
- drawSeriesPoints(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient)
This function is used for drawing points using a given symbol. In case the series has points decimation
function attached, before starting to draw, as an optimization the points will first be decimated.
The series parameter contains the series to be drawn on ctx context. The plotOffset, plotWidth and
plotHeight are the corresponding parameters of flot used to determine the drawing surface.
The function drawSymbol is used to compute and draw the symbol chosen for the points.
*/
function drawSeriesPoints(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient) {
function drawCircle(ctx, x, y, radius, shadow, fill) {
ctx.moveTo(x + radius, y);
ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);
}
drawCircle.fill = true;
function plotPoints(datapoints, radius, fill, offset, shadow, axisx, axisy, drawSymbolFn) {
var points = datapoints.points,
ps = datapoints.pointsize;
ctx.beginPath();
for (var i = 0; i < points.length; i += ps) {
var x = points[i],
y = points[i + 1];
if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) {
continue;
}
x = axisx.p2c(x);
y = axisy.p2c(y) + offset;
drawSymbolFn(ctx, x, y, radius, shadow, fill);
}
if (drawSymbolFn.fill && !shadow) {
ctx.fill();
}
ctx.stroke();
}
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
var datapoints = {
format: series.datapoints.format,
points: series.datapoints.points,
pointsize: series.datapoints.pointsize
};
if (series.decimatePoints) {
datapoints.points = series.decimatePoints(series, series.xaxis.min, series.xaxis.max, plotWidth, series.yaxis.min, series.yaxis.max, plotHeight);
}
var lw = series.points.lineWidth,
radius = series.points.radius,
symbol = series.points.symbol,
drawSymbolFn;
if (symbol === 'circle') {
drawSymbolFn = drawCircle;
} else if (typeof symbol === 'string' && drawSymbol && drawSymbol[symbol]) {
drawSymbolFn = drawSymbol[symbol];
} else if (typeof drawSymbol === 'function') {
drawSymbolFn = drawSymbol;
}
// If the user sets the line width to 0, we change it to a very
// small value. A line width of 0 seems to force the default of 1.
if (lw === 0) {
lw = 0.0001;
}
ctx.lineWidth = lw;
ctx.fillStyle = getFillStyle(series.points, series.color, null, null, getColorOrGradient);
ctx.strokeStyle = series.color;
plotPoints(datapoints, radius,
true, 0, false,
series.xaxis, series.yaxis, drawSymbolFn);
ctx.restore();
}
function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
var left = x + barLeft,
right = x + barRight,
bottom = b, top = y,
drawLeft, drawRight, drawTop, drawBottom = false,
tmp;
drawLeft = drawRight = drawTop = true;
// in horizontal mode, we start the bar from the left
// instead of from the bottom so it appears to be
// horizontal rather than vertical
if (horizontal) {
drawBottom = drawRight = drawTop = true;
drawLeft = false;
left = b;
right = x;
top = y + barLeft;
bottom = y + barRight;
// account for negative bars
if (right < left) {
tmp = right;
right = left;
left = tmp;
drawLeft = true;
drawRight = false;
}
}
else {
drawLeft = drawRight = drawTop = true;
drawBottom = false;
left = x + barLeft;
right = x + barRight;
bottom = b;
top = y;
// account for negative bars
if (top < bottom) {
tmp = top;
top = bottom;
bottom = tmp;
drawBottom = true;
drawTop = false;
}
}
// clip
if (right < axisx.min || left > axisx.max ||
top < axisy.min || bottom > axisy.max) {
return;
}
if (left < axisx.min) {
left = axisx.min;
drawLeft = false;
}
if (right > axisx.max) {
right = axisx.max;
drawRight = false;
}
if (bottom < axisy.min) {
bottom = axisy.min;
drawBottom = false;
}
if (top > axisy.max) {
top = axisy.max;
drawTop = false;
}
left = axisx.p2c(left);
bottom = axisy.p2c(bottom);
right = axisx.p2c(right);
top = axisy.p2c(top);
// fill the bar
if (fillStyleCallback) {
c.fillStyle = fillStyleCallback(bottom, top);
c.fillRect(left, top, right - left, bottom - top)
}
// draw outline
if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {
c.beginPath();
// FIXME: inline moveTo is buggy with excanvas
c.moveTo(left, bottom);
if (drawLeft) {
c.lineTo(left, top);
} else {
c.moveTo(left, top);
}
if (drawTop) {
c.lineTo(right, top);
} else {
c.moveTo(right, top);
}
if (drawRight) {
c.lineTo(right, bottom);
} else {
c.moveTo(right, bottom);
}
if (drawBottom) {
c.lineTo(left, bottom);
} else {
c.moveTo(left, bottom);
}
c.stroke();
}
}
/**
- drawSeriesBars(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient)
This function is used for drawing series represented as bars. In case the series has decimation
function attached, before starting to draw, as an optimization the points will first be decimated.
The series parameter contains the series to be drawn on ctx context. The plotOffset, plotWidth and
plotHeight are the corresponding parameters of flot used to determine the drawing surface.
The function getColorOrGradient is used to compute the fill style of bars.
*/
function drawSeriesBars(series, ctx, plotOffset, plotWidth, plotHeight, drawSymbol, getColorOrGradient) {
function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
fillTowards = series.bars.fillTowards || 0,
calculatedBottom = fillTowards > axisy.min ? Math.min(axisy.max, fillTowards) : axisy.min;
for (var i = 0; i < points.length; i += ps) {
if (points[i] == null) {
continue;
}
// Use third point as bottom if pointsize is 3
var bottom = ps === 3 ? points[i + 2] : calculatedBottom;
drawBar(points[i], points[i + 1], bottom, barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);
}
}
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
var datapoints = {
format: series.datapoints.format,
points: series.datapoints.points,
pointsize: series.datapoints.pointsize
};
if (series.decimate) {
datapoints.points = series.decimate(series, series.xaxis.min, series.xaxis.max, plotWidth);
}
ctx.lineWidth = series.bars.lineWidth;
ctx.strokeStyle = series.color;
var barLeft;
var barWidth = series.bars.barWidth[0] || series.bars.barWidth;
switch (series.bars.align) {
case "left":
barLeft = 0;
break;
case "right":
barLeft = -barWidth;
break;
default:
barLeft = -barWidth / 2;
}
var fillStyleCallback = series.bars.fill ? function(bottom, top) {
return getFillStyle(series.bars, series.color, bottom, top, getColorOrGradient);
} : null;
plotBars(datapoints, barLeft, barLeft + barWidth, fillStyleCallback, series.xaxis, series.yaxis);
ctx.restore();
}
function getFillStyle(filloptions, seriesColor, bottom, top, getColorOrGradient) {
var fill = filloptions.fill;
if (!fill) {
return null;
}
if (filloptions.fillColor) {
return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor);
}
var c = $.color.parse(seriesColor);
c.a = typeof fill === "number" ? fill : 0.4;
c.normalize();
return c.toString();
}
this.drawSeriesLines = drawSeriesLines;
this.drawSeriesPoints = drawSeriesPoints;
this.drawSeriesBars = drawSeriesBars;
this.drawBar = drawBar;
};
$.plot.drawSeries = new DrawSeries();
})(jQuery);

View File

@ -1,375 +0,0 @@
/* Flot plugin for plotting error bars.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Error bars are used to show standard deviation and other statistical
properties in a plot.
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
This plugin allows you to plot error-bars over points. Set "errorbars" inside
the points series to the axis name over which there will be error values in
your data array (*even* if you do not intend to plot them later, by setting
"show: null" on xerr/yerr).
The plugin supports these options:
series: {
points: {
errorbars: "x" or "y" or "xy",
xerr: {
show: null/false or true,
asymmetric: null/false or true,
upperCap: null or "-" or function,
lowerCap: null or "-" or function,
color: null or color,
radius: null or number
},
yerr: { same options as xerr }
}
}
Each data point array is expected to be of the type:
"x" [ x, y, xerr ]
"y" [ x, y, yerr ]
"xy" [ x, y, xerr, yerr ]
Where xerr becomes xerr_lower,xerr_upper for the asymmetric error case, and
equivalently for yerr. Eg., a datapoint for the "xy" case with symmetric
error-bars on X and asymmetric on Y would be:
[ x, y, xerr, yerr_lower, yerr_upper ]
By default no end caps are drawn. Setting upperCap and/or lowerCap to "-" will
draw a small cap perpendicular to the error bar. They can also be set to a
user-defined drawing function, with (ctx, x, y, radius) as parameters, as eg.
function drawSemiCircle( ctx, x, y, radius ) {
ctx.beginPath();
ctx.arc( x, y, radius, 0, Math.PI, false );
ctx.moveTo( x - radius, y );
ctx.lineTo( x + radius, y );
ctx.stroke();
}
Color and radius both default to the same ones of the points series if not
set. The independent radius parameter on xerr/yerr is useful for the case when
we may want to add error-bars to a line, without showing the interconnecting
points (with radius: 0), and still showing end caps on the error-bars.
shadowSize and lineWidth are derived as well from the points series.
*/
(function ($) {
var options = {
series: {
points: {
errorbars: null, //should be 'x', 'y' or 'xy'
xerr: {err: 'x', show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null},
yerr: {err: 'y', show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null}
}
}
};
function processRawData(plot, series, data, datapoints) {
if (!series.points.errorbars) {
return;
}
// x,y values
var format = [
{ x: true, number: true, required: true },
{ y: true, number: true, required: true }
];
var errors = series.points.errorbars;
// error bars - first X then Y
if (errors === 'x' || errors === 'xy') {
// lower / upper error
if (series.points.xerr.asymmetric) {
format.push({ x: true, number: true, required: true });
format.push({ x: true, number: true, required: true });
} else {
format.push({ x: true, number: true, required: true });
}
}
if (errors === 'y' || errors === 'xy') {
// lower / upper error
if (series.points.yerr.asymmetric) {
format.push({ y: true, number: true, required: true });
format.push({ y: true, number: true, required: true });
} else {
format.push({ y: true, number: true, required: true });
}
}
datapoints.format = format;
}
function parseErrors(series, i) {
var points = series.datapoints.points;
// read errors from points array
var exl = null,
exu = null,
eyl = null,
eyu = null;
var xerr = series.points.xerr,
yerr = series.points.yerr;
var eb = series.points.errorbars;
// error bars - first X
if (eb === 'x' || eb === 'xy') {
if (xerr.asymmetric) {
exl = points[i + 2];
exu = points[i + 3];
if (eb === 'xy') {
if (yerr.asymmetric) {
eyl = points[i + 4];
eyu = points[i + 5];
} else {
eyl = points[i + 4];
}
}
} else {
exl = points[i + 2];
if (eb === 'xy') {
if (yerr.asymmetric) {
eyl = points[i + 3];
eyu = points[i + 4];
} else {
eyl = points[i + 3];
}
}
}
// only Y
} else {
if (eb === 'y') {
if (yerr.asymmetric) {
eyl = points[i + 2];
eyu = points[i + 3];
} else {
eyl = points[i + 2];
}
}
}
// symmetric errors?
if (exu == null) exu = exl;
if (eyu == null) eyu = eyl;
var errRanges = [exl, exu, eyl, eyu];
// nullify if not showing
if (!xerr.show) {
errRanges[0] = null;
errRanges[1] = null;
}
if (!yerr.show) {
errRanges[2] = null;
errRanges[3] = null;
}
return errRanges;
}
function drawSeriesErrors(plot, ctx, s) {
var points = s.datapoints.points,
ps = s.datapoints.pointsize,
ax = [s.xaxis, s.yaxis],
radius = s.points.radius,
err = [s.points.xerr, s.points.yerr],
tmp;
//sanity check, in case some inverted axis hack is applied to flot
var invertX = false;
if (ax[0].p2c(ax[0].max) < ax[0].p2c(ax[0].min)) {
invertX = true;
tmp = err[0].lowerCap;
err[0].lowerCap = err[0].upperCap;
err[0].upperCap = tmp;
}
var invertY = false;
if (ax[1].p2c(ax[1].min) < ax[1].p2c(ax[1].max)) {
invertY = true;
tmp = err[1].lowerCap;
err[1].lowerCap = err[1].upperCap;
err[1].upperCap = tmp;
}
for (var i = 0; i < s.datapoints.points.length; i += ps) {
//parse
var errRanges = parseErrors(s, i);
//cycle xerr & yerr
for (var e = 0; e < err.length; e++) {
var minmax = [ax[e].min, ax[e].max];
//draw this error?
if (errRanges[e * err.length]) {
//data coordinates
var x = points[i],
y = points[i + 1];
//errorbar ranges
var upper = [x, y][e] + errRanges[e * err.length + 1],
lower = [x, y][e] - errRanges[e * err.length];
//points outside of the canvas
if (err[e].err === 'x') {
if (y > ax[1].max || y < ax[1].min || upper < ax[0].min || lower > ax[0].max) {
continue;
}
}
if (err[e].err === 'y') {
if (x > ax[0].max || x < ax[0].min || upper < ax[1].min || lower > ax[1].max) {
continue;
}
}
// prevent errorbars getting out of the canvas
var drawUpper = true,
drawLower = true;
if (upper > minmax[1]) {
drawUpper = false;
upper = minmax[1];
}
if (lower < minmax[0]) {
drawLower = false;
lower = minmax[0];
}
//sanity check, in case some inverted axis hack is applied to flot
if ((err[e].err === 'x' && invertX) || (err[e].err === 'y' && invertY)) {
//swap coordinates
tmp = lower;
lower = upper;
upper = tmp;
tmp = drawLower;
drawLower = drawUpper;
drawUpper = tmp;
tmp = minmax[0];
minmax[0] = minmax[1];
minmax[1] = tmp;
}
// convert to pixels
x = ax[0].p2c(x);
y = ax[1].p2c(y);
upper = ax[e].p2c(upper);
lower = ax[e].p2c(lower);
minmax[0] = ax[e].p2c(minmax[0]);
minmax[1] = ax[e].p2c(minmax[1]);
//same style as points by default
var lw = err[e].lineWidth ? err[e].lineWidth : s.points.lineWidth,
sw = s.points.shadowSize != null ? s.points.shadowSize : s.shadowSize;
//shadow as for points
if (lw > 0 && sw > 0) {
var w = sw / 2;
ctx.lineWidth = w;
ctx.strokeStyle = "rgba(0,0,0,0.1)";
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w + w / 2, minmax);
ctx.strokeStyle = "rgba(0,0,0,0.2)";
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w / 2, minmax);
}
ctx.strokeStyle = err[e].color
? err[e].color
: s.color;
ctx.lineWidth = lw;
//draw it
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax);
}
}
}
}
function drawError(ctx, err, x, y, upper, lower, drawUpper, drawLower, radius, offset, minmax) {
//shadow offset
y += offset;
upper += offset;
lower += offset;
// error bar - avoid plotting over circles
if (err.err === 'x') {
if (upper > x + radius) drawPath(ctx, [[upper, y], [Math.max(x + radius, minmax[0]), y]]);
else drawUpper = false;
if (lower < x - radius) drawPath(ctx, [[Math.min(x - radius, minmax[1]), y], [lower, y]]);
else drawLower = false;
} else {
if (upper < y - radius) drawPath(ctx, [[x, upper], [x, Math.min(y - radius, minmax[0])]]);
else drawUpper = false;
if (lower > y + radius) drawPath(ctx, [[x, Math.max(y + radius, minmax[1])], [x, lower]]);
else drawLower = false;
}
//internal radius value in errorbar, allows to plot radius 0 points and still keep proper sized caps
//this is a way to get errorbars on lines without visible connecting dots
radius = err.radius != null
? err.radius
: radius;
// upper cap
if (drawUpper) {
if (err.upperCap === '-') {
if (err.err === 'x') drawPath(ctx, [[upper, y - radius], [upper, y + radius]]);
else drawPath(ctx, [[x - radius, upper], [x + radius, upper]]);
} else if ($.isFunction(err.upperCap)) {
if (err.err === 'x') err.upperCap(ctx, upper, y, radius);
else err.upperCap(ctx, x, upper, radius);
}
}
// lower cap
if (drawLower) {
if (err.lowerCap === '-') {
if (err.err === 'x') drawPath(ctx, [[lower, y - radius], [lower, y + radius]]);
else drawPath(ctx, [[x - radius, lower], [x + radius, lower]]);
} else if ($.isFunction(err.lowerCap)) {
if (err.err === 'x') err.lowerCap(ctx, lower, y, radius);
else err.lowerCap(ctx, x, lower, radius);
}
}
}
function drawPath(ctx, pts) {
ctx.beginPath();
ctx.moveTo(pts[0][0], pts[0][1]);
for (var p = 1; p < pts.length; p++) {
ctx.lineTo(pts[p][0], pts[p][1]);
}
ctx.stroke();
}
function draw(plot, ctx) {
var plotOffset = plot.getPlotOffset();
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
$.each(plot.getData(), function (i, s) {
if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show)) {
drawSeriesErrors(plot, ctx, s);
}
});
ctx.restore();
}
function init(plot) {
plot.hooks.processRawData.push(processRawData);
plot.hooks.draw.push(draw);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'errorbars',
version: '1.0'
});
})(jQuery);

View File

@ -1,254 +0,0 @@
/* Flot plugin for computing bottoms for filled line and bar charts.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The case: you've got two series that you want to fill the area between. In Flot
terms, you need to use one as the fill bottom of the other. You can specify the
bottom of each data point as the third coordinate manually, or you can use this
plugin to compute it for you.
In order to name the other series, you need to give it an id, like this:
var dataset = [
{ data: [ ... ], id: "foo" } , // use default bottom
{ data: [ ... ], fillBetween: "foo" }, // use first dataset as bottom
];
$.plot($("#placeholder"), dataset, { lines: { show: true, fill: true }});
As a convenience, if the id given is a number that doesn't appear as an id in
the series, it is interpreted as the index in the array instead (so fillBetween:
0 can also mean the first series).
Internally, the plugin modifies the datapoints in each series. For line series,
extra data points might be inserted through interpolation. Note that at points
where the bottom line is not defined (due to a null point or start/end of line),
the current line will show a gap too. The algorithm comes from the
jquery.flot.stack.js plugin, possibly some code could be shared.
*/
(function ($) {
var options = {
series: {
fillBetween: null // or number
}
};
function init(plot) {
function findBottomSeries(s, allseries) {
var i;
for (i = 0; i < allseries.length; ++i) {
if (allseries[ i ].id === s.fillBetween) {
return allseries[ i ];
}
}
if (typeof s.fillBetween === "number") {
if (s.fillBetween < 0 || s.fillBetween >= allseries.length) {
return null;
}
return allseries[ s.fillBetween ];
}
return null;
}
function computeFormat(plot, s, data, datapoints) {
if (s.fillBetween == null) {
return;
}
format = datapoints.format;
var plotHasId = function(id) {
var plotData = plot.getData();
for (i = 0; i < plotData.length; i++) {
if (plotData[i].id === id) {
return true;
}
}
return false;
}
if (!format) {
format = [];
format.push({
x: true,
number: true,
computeRange: s.xaxis.options.autoScale !== 'none',
required: true
});
format.push({
y: true,
number: true,
computeRange: s.yaxis.options.autoScale !== 'none',
required: true
});
if (s.fillBetween !== undefined && s.fillBetween !== '' && plotHasId(s.fillBetween) && s.fillBetween !== s.id) {
format.push({
x: false,
y: true,
number: true,
required: false,
computeRange: s.yaxis.options.autoScale !== 'none',
defaultValue: 0
});
}
datapoints.format = format;
}
}
function computeFillBottoms(plot, s, datapoints) {
if (s.fillBetween == null) {
return;
}
var other = findBottomSeries(s, plot.getData());
if (!other) {
return;
}
var ps = datapoints.pointsize,
points = datapoints.points,
otherps = other.datapoints.pointsize,
otherpoints = other.datapoints.points,
newpoints = [],
px, py, intery, qx, qy, bottom,
withlines = s.lines.show,
withbottom = ps > 2 && datapoints.format[2].y,
withsteps = withlines && s.lines.steps,
fromgap = true,
i = 0,
j = 0,
l, m;
while (true) {
if (i >= points.length) {
break;
}
l = newpoints.length;
if (points[ i ] == null) {
// copy gaps
for (m = 0; m < ps; ++m) {
newpoints.push(points[ i + m ]);
}
i += ps;
} else if (j >= otherpoints.length) {
// for lines, we can't use the rest of the points
if (!withlines) {
for (m = 0; m < ps; ++m) {
newpoints.push(points[ i + m ]);
}
}
i += ps;
} else if (otherpoints[ j ] == null) {
// oops, got a gap
for (m = 0; m < ps; ++m) {
newpoints.push(null);
}
fromgap = true;
j += otherps;
} else {
// cases where we actually got two points
px = points[ i ];
py = points[ i + 1 ];
qx = otherpoints[ j ];
qy = otherpoints[ j + 1 ];
bottom = 0;
if (px === qx) {
for (m = 0; m < ps; ++m) {
newpoints.push(points[ i + m ]);
}
//newpoints[ l + 1 ] += qy;
bottom = qy;
i += ps;
j += otherps;
} else if (px > qx) {
// we got past point below, might need to
// insert interpolated extra point
if (withlines && i > 0 && points[ i - ps ] != null) {
intery = py + (points[ i - ps + 1 ] - py) * (qx - px) / (points[ i - ps ] - px);
newpoints.push(qx);
newpoints.push(intery);
for (m = 2; m < ps; ++m) {
newpoints.push(points[ i + m ]);
}
bottom = qy;
}
j += otherps;
} else {
// px < qx
// if we come from a gap, we just skip this point
if (fromgap && withlines) {
i += ps;
continue;
}
for (m = 0; m < ps; ++m) {
newpoints.push(points[ i + m ]);
}
// we might be able to interpolate a point below,
// this can give us a better y
if (withlines && j > 0 && otherpoints[ j - otherps ] != null) {
bottom = qy + (otherpoints[ j - otherps + 1 ] - qy) * (px - qx) / (otherpoints[ j - otherps ] - qx);
}
//newpoints[l + 1] += bottom;
i += ps;
}
fromgap = false;
if (l !== newpoints.length && withbottom) {
newpoints[ l + 2 ] = bottom;
}
}
// maintain the line steps invariant
if (withsteps && l !== newpoints.length && l > 0 &&
newpoints[ l ] !== null &&
newpoints[ l ] !== newpoints[ l - ps ] &&
newpoints[ l + 1 ] !== newpoints[ l - ps + 1 ]) {
for (m = 0; m < ps; ++m) {
newpoints[ l + ps + m ] = newpoints[ l + m ];
}
newpoints[ l + 1 ] = newpoints[ l - ps + 1 ];
}
}
datapoints.points = newpoints;
}
plot.hooks.processRawData.push(computeFormat);
plot.hooks.processDatapoints.push(computeFillBottoms);
}
$.plot.plugins.push({
init: init,
options: options,
name: "fillbetween",
version: "1.0"
});
})(jQuery);

View File

@ -1,47 +0,0 @@
/* Support for flat 1D data series.
A 1D flat data series is a data series in the form of a regular 1D array. The
main reason for using a flat data series is that it performs better, consumes
less memory and generates less garbage collection than the regular flot format.
Example:
plot.setData([[[0,0], [1,1], [2,2], [3,3]]]); // regular flot format
plot.setData([{flatdata: true, data: [0, 1, 2, 3]}]); // flatdata format
Set series.flatdata to true to enable this plugin.
You can use series.start to specify the starting index of the series (default is 0)
You can use series.step to specify the interval between consecutive indexes of the series (default is 1)
*/
/* global jQuery*/
(function ($) {
'use strict';
function process1DRawData(plot, series, data, datapoints) {
if (series.flatdata === true) {
var start = series.start || 0;
var step = typeof series.step === 'number' ? series.step : 1;
datapoints.pointsize = 2;
for (var i = 0, j = 0; i < data.length; i++, j += 2) {
datapoints.points[j] = start + (i * step);
datapoints.points[j + 1] = data[i];
}
if (datapoints.points !== undefined) {
datapoints.points.length = data.length * 2;
} else {
datapoints.points = [];
}
}
}
$.plot.plugins.push({
init: function(plot) {
plot.hooks.processRawData.push(process1DRawData);
},
name: 'flatdata',
version: '0.0.2'
});
})(jQuery);

View File

@ -1,346 +0,0 @@
/* global jQuery */
/**
## jquery.flot.hover.js
This plugin is used for mouse hover and tap on a point of plot series.
It supports the following options:
```js
grid: {
hoverable: false, //to trigger plothover event on mouse hover or tap on a point
clickable: false //to trigger plotclick event on mouse hover
}
```
It listens to native mouse move event or click, as well as artificial generated
tap and touchevent.
When the mouse is over a point or a tap on a point is performed, that point or
the correscponding bar will be highlighted and a "plothover" event will be generated.
Custom "touchevent" is triggered when any touch interaction is made. Hover plugin
handles this events by unhighlighting all of the previously highlighted points and generates
"plothovercleanup" event to notify any part that is handling plothover (for exemple to cleanup
the tooltip from webcharts).
*/
(function($) {
'use strict';
var options = {
grid: {
hoverable: false,
clickable: false
}
};
var browser = $.plot.browser;
function init(plot) {
plot.hooks.processOptions.push(initHover);
}
function initHover(plot, options) {
var highlights = [];
var eventType = {
click: 'click',
hover: 'hover'
}
var lastMouseMoveEvent = plot.getPlaceholder()[0].lastMouseMoveEvent;
plot.highlight = highlight;
plot.unhighlight = unhighlight;
function bindEvents(plot, eventHolder) {
var o = plot.getOptions();
if (o.grid.hoverable || o.grid.clickable) {
eventHolder[0].addEventListener('touchevent', triggerCleanupEvent, false);
eventHolder[0].addEventListener('tap', tap.generatePlothoverEvent, false);
}
if (options.grid.clickable) {
eventHolder.click(onClick);
}
if (options.grid.hoverable) {
eventHolder.mousemove(onMouseMove);
// Use bind, rather than .mouseleave, because we officially
// still support jQuery 1.2.6, which doesn't define a shortcut
// for mouseenter or mouseleave. This was a bug/oversight that
// was fixed somewhere around 1.3.x. We can return to using
// .mouseleave when we drop support for 1.2.6.
eventHolder.bind("mouseleave", onMouseLeave);
}
}
function shutdown(plot, eventHolder) {
eventHolder[0].removeEventListener('tap', tap.generatePlothoverEvent);
eventHolder[0].removeEventListener('tap', triggerCleanupEvent);
eventHolder.unbind("mousemove", onMouseMove);
eventHolder.unbind("mouseleave", onMouseLeave);
eventHolder.unbind("click", onClick);
highlights = [];
}
function doTriggerClickHoverEvent(event, eventType, searchDistance) {
var series = plot.getData();
if (event !== undefined
&& series.length > 0
&& series[0].xaxis.c2p !== undefined
&& series[0].yaxis.c2p !== undefined) {
var eventToTrigger = "plot" + eventType;
var seriesFlag = eventType + "able";
triggerClickHoverEvent(eventToTrigger, event,
function(i) {
return series[i][seriesFlag] !== false;
}, searchDistance);
}
}
var tap = {
generatePlothoverEvent: function (e) {
var o = plot.getOptions(),
newEvent = new CustomEvent('mouseevent');
//transform from touch event to mouse event format
newEvent.pageX = e.detail.changedTouches[0].pageX;
newEvent.pageY = e.detail.changedTouches[0].pageY;
newEvent.clientX = e.detail.changedTouches[0].clientX;
newEvent.clientY = e.detail.changedTouches[0].clientY;
if (o.grid.hoverable) {
doTriggerClickHoverEvent(newEvent, eventType.hover, 30);
}
return false;
}
};
if (options.grid.hoverable || options.grid.clickable) {
plot.hooks.bindEvents.push(bindEvents);
plot.hooks.shutdown.push(shutdown);
plot.hooks.drawOverlay.push(drawOverlay);
plot.hooks.processRawData.push(processRawData);
}
function onMouseMove(e) {
lastMouseMoveEvent = e;
plot.getPlaceholder()[0].lastMouseMoveEvent = e;
doTriggerClickHoverEvent(e, eventType.hover);
}
function onMouseLeave(e) {
lastMouseMoveEvent = undefined;
plot.getPlaceholder()[0].lastMouseMoveEvent = undefined;
triggerClickHoverEvent("plothover", e,
function(i) {
return false;
});
}
function onClick(e) {
doTriggerClickHoverEvent(e, eventType.click);
}
function triggerCleanupEvent() {
plot.unhighlight();
plot.getPlaceholder().trigger('plothovercleanup');
}
// trigger click or hover event (they send the same parameters
// so we share their code)
function triggerClickHoverEvent(eventname, event, seriesFilter, searchDistance) {
var options = plot.getOptions(),
offset = plot.offset(),
page = browser.getPageXY(event),
canvasX = page.X - offset.left,
canvasY = page.Y - offset.top,
pos = plot.c2p({
left: canvasX,
top: canvasY
}),
distance = searchDistance !== undefined ? searchDistance : options.grid.mouseActiveRadius;
pos.pageX = page.X;
pos.pageY = page.Y;
var item = plot.findNearbyItem(canvasX, canvasY, seriesFilter, distance);
if (item) {
// fill in mouse pos for any listeners out there
item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left, 10);
item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top, 10);
}
if (options.grid.autoHighlight) {
// clear auto-highlights
for (var i = 0; i < highlights.length; ++i) {
var h = highlights[i];
if ((h.auto === eventname &&
!(item && h.series === item.series &&
h.point[0] === item.datapoint[0] &&
h.point[1] === item.datapoint[1])) || !item) {
unhighlight(h.series, h.point);
}
}
if (item) {
highlight(item.series, item.datapoint, eventname);
}
}
plot.getPlaceholder().trigger(eventname, [pos, item]);
}
function highlight(s, point, auto) {
if (typeof s === "number") {
s = plot.getData()[s];
}
if (typeof point === "number") {
var ps = s.datapoints.pointsize;
point = s.datapoints.points.slice(ps * point, ps * (point + 1));
}
var i = indexOfHighlight(s, point);
if (i === -1) {
highlights.push({
series: s,
point: point,
auto: auto
});
plot.triggerRedrawOverlay();
} else if (!auto) {
highlights[i].auto = false;
}
}
function unhighlight(s, point) {
if (s == null && point == null) {
highlights = [];
plot.triggerRedrawOverlay();
return;
}
if (typeof s === "number") {
s = plot.getData()[s];
}
if (typeof point === "number") {
var ps = s.datapoints.pointsize;
point = s.datapoints.points.slice(ps * point, ps * (point + 1));
}
var i = indexOfHighlight(s, point);
if (i !== -1) {
highlights.splice(i, 1);
plot.triggerRedrawOverlay();
}
}
function indexOfHighlight(s, p) {
for (var i = 0; i < highlights.length; ++i) {
var h = highlights[i];
if (h.series === s &&
h.point[0] === p[0] &&
h.point[1] === p[1]) {
return i;
}
}
return -1;
}
function processRawData() {
triggerCleanupEvent();
doTriggerClickHoverEvent(lastMouseMoveEvent, eventType.hover);
}
function drawOverlay(plot, octx, overlay) {
var plotOffset = plot.getPlotOffset(),
i, hi;
octx.save();
octx.translate(plotOffset.left, plotOffset.top);
for (i = 0; i < highlights.length; ++i) {
hi = highlights[i];
if (hi.series.bars.show) drawBarHighlight(hi.series, hi.point, octx);
else drawPointHighlight(hi.series, hi.point, octx, plot);
}
octx.restore();
}
}
function drawPointHighlight(series, point, octx, plot) {
var x = point[0],
y = point[1],
axisx = series.xaxis,
axisy = series.yaxis,
highlightColor = (typeof series.highlightColor === "string") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString();
if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) {
return;
}
var pointRadius = series.points.radius + series.points.lineWidth / 2;
octx.lineWidth = pointRadius;
octx.strokeStyle = highlightColor;
var radius = 1.5 * pointRadius;
x = axisx.p2c(x);
y = axisy.p2c(y);
octx.beginPath();
var symbol = series.points.symbol;
if (symbol === 'circle') {
octx.arc(x, y, radius, 0, 2 * Math.PI, false);
} else if (typeof symbol === 'string' && plot.drawSymbol && plot.drawSymbol[symbol]) {
plot.drawSymbol[symbol](octx, x, y, radius, false);
}
octx.closePath();
octx.stroke();
}
function drawBarHighlight(series, point, octx) {
var highlightColor = (typeof series.highlightColor === "string") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(),
fillStyle = highlightColor,
barLeft;
var barWidth = series.bars.barWidth[0] || series.bars.barWidth;
switch (series.bars.align) {
case "left":
barLeft = 0;
break;
case "right":
barLeft = -barWidth;
break;
default:
barLeft = -barWidth / 2;
}
octx.lineWidth = series.bars.lineWidth;
octx.strokeStyle = highlightColor;
var fillTowards = series.bars.fillTowards || 0,
bottom = fillTowards > series.yaxis.min ? Math.min(series.yaxis.max, fillTowards) : series.yaxis.min;
$.plot.drawSeries.drawBar(point[0], point[1], point[2] || bottom, barLeft, barLeft + barWidth,
function() {
return fillStyle;
}, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'hover',
version: '0.1'
});
})(jQuery);

View File

@ -1,249 +0,0 @@
/* Flot plugin for plotting images.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
(x2, y2) are where you intend the two opposite corners of the image to end up
in the plot. Image must be a fully loaded Javascript image (you can make one
with new Image()). If the image is not complete, it's skipped when plotting.
There are two helpers included for retrieving images. The easiest work the way
that you put in URLs instead of images in the data, like this:
[ "myimage.png", 0, 0, 10, 10 ]
Then call $.plot.image.loadData( data, options, callback ) where data and
options are the same as you pass in to $.plot. This loads the images, replaces
the URLs in the data with the corresponding images and calls "callback" when
all images are loaded (or failed loading). In the callback, you can then call
$.plot with the data set. See the included example.
A more low-level helper, $.plot.image.load(urls, callback) is also included.
Given a list of URLs, it calls callback with an object mapping from URL to
Image object when all images are loaded or have failed loading.
The plugin supports these options:
series: {
images: {
show: boolean
anchor: "corner" or "center"
alpha: [ 0, 1 ]
}
}
They can be specified for a specific series:
$.plot( $("#placeholder"), [{
data: [ ... ],
images: { ... }
])
Note that because the data format is different from usual data points, you
can't use images with anything else in a specific data series.
Setting "anchor" to "center" causes the pixels in the image to be anchored at
the corner pixel centers inside of at the pixel corners, effectively letting
half a pixel stick out to each side in the plot.
A possible future direction could be support for tiling for large images (like
Google Maps).
*/
(function ($) {
var options = {
series: {
images: {
show: false,
alpha: 1,
anchor: "corner" // or "center"
}
}
};
$.plot.image = {};
$.plot.image.loadDataImages = function (series, options, callback) {
var urls = [], points = [];
var defaultShow = options.series.images.show;
$.each(series, function (i, s) {
if (!(defaultShow || s.images.show)) {
return;
}
if (s.data) {
s = s.data;
}
$.each(s, function (i, p) {
if (typeof p[0] === "string") {
urls.push(p[0]);
points.push(p);
}
});
});
$.plot.image.load(urls, function (loadedImages) {
$.each(points, function (i, p) {
var url = p[0];
if (loadedImages[url]) {
p[0] = loadedImages[url];
}
});
callback();
});
}
$.plot.image.load = function (urls, callback) {
var missing = urls.length, loaded = {};
if (missing === 0) {
callback({});
}
$.each(urls, function (i, url) {
var handler = function () {
--missing;
loaded[url] = this;
if (missing === 0) {
callback(loaded);
}
};
$('<img />').load(handler).error(handler).attr('src', url);
});
};
function drawSeries(plot, ctx, series) {
var plotOffset = plot.getPlotOffset();
if (!series.images || !series.images.show) {
return;
}
var points = series.datapoints.points,
ps = series.datapoints.pointsize;
for (var i = 0; i < points.length; i += ps) {
var img = points[i],
x1 = points[i + 1], y1 = points[i + 2],
x2 = points[i + 3], y2 = points[i + 4],
xaxis = series.xaxis, yaxis = series.yaxis,
tmp;
// actually we should check img.complete, but it
// appears to be a somewhat unreliable indicator in
// IE6 (false even after load event)
if (!img || img.width <= 0 || img.height <= 0) {
continue;
}
if (x1 > x2) {
tmp = x2;
x2 = x1;
x1 = tmp;
}
if (y1 > y2) {
tmp = y2;
y2 = y1;
y1 = tmp;
}
// if the anchor is at the center of the pixel, expand the
// image by 1/2 pixel in each direction
if (series.images.anchor === "center") {
tmp = 0.5 * (x2 - x1) / (img.width - 1);
x1 -= tmp;
x2 += tmp;
tmp = 0.5 * (y2 - y1) / (img.height - 1);
y1 -= tmp;
y2 += tmp;
}
// clip
if (x1 === x2 || y1 === y2 ||
x1 >= xaxis.max || x2 <= xaxis.min ||
y1 >= yaxis.max || y2 <= yaxis.min) {
continue;
}
var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height;
if (x1 < xaxis.min) {
sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1);
x1 = xaxis.min;
}
if (x2 > xaxis.max) {
sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1);
x2 = xaxis.max;
}
if (y1 < yaxis.min) {
sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1);
y1 = yaxis.min;
}
if (y2 > yaxis.max) {
sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1);
y2 = yaxis.max;
}
x1 = xaxis.p2c(x1);
x2 = xaxis.p2c(x2);
y1 = yaxis.p2c(y1);
y2 = yaxis.p2c(y2);
// the transformation may have swapped us
if (x1 > x2) {
tmp = x2;
x2 = x1;
x1 = tmp;
}
if (y1 > y2) {
tmp = y2;
y2 = y1;
y1 = tmp;
}
tmp = ctx.globalAlpha;
ctx.globalAlpha *= series.images.alpha;
ctx.drawImage(img,
sx1, sy1, sx2 - sx1, sy2 - sy1,
x1 + plotOffset.left, y1 + plotOffset.top,
x2 - x1, y2 - y1);
ctx.globalAlpha = tmp;
}
}
function processRawData(plot, series, data, datapoints) {
if (!series.images.show) {
return;
}
// format is Image, x1, y1, x2, y2 (opposite corners)
datapoints.format = [
{ required: true },
{ x: true, number: true, required: true },
{ y: true, number: true, required: true },
{ x: true, number: true, required: true },
{ y: true, number: true, required: true }
];
}
function init(plot) {
plot.hooks.processRawData.push(processRawData);
plot.hooks.drawSeries.push(drawSeries);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'image',
version: '1.1'
});
})(jQuery);

File diff suppressed because it is too large Load Diff

View File

@ -1,395 +0,0 @@
/* Flot plugin for drawing legends.
*/
(function($) {
var defaultOptions = {
legend: {
show: false,
labelFormatter: null, // fn: string -> string
container: null, // container (as jQuery object) to put legend in, null means default on top of graph
position: 'ne', // position of default legend container within plot
margin: 5, // distance from grid edge to default legend container within plot
sorted: null // default to no legend sorting
}
};
function insertLegend(plot, options, placeholder, legendEntries) {
// clear before redraw
if (options.legend.container != null) {
$(options.legend.container).html('');
} else {
placeholder.find('.legend').remove();
}
if (!options.legend.show) {
return;
}
// Save the legend entries in legend options
var entries = options.legend.legendEntries = legendEntries,
plotOffset = options.legend.plotOffset = plot.getPlotOffset(),
html = [],
entry, labelHtml, iconHtml,
maxLabelLength = 0,
j = 0,
pos = "",
p = options.legend.position,
m = options.legend.margin,
shape = {
name: '',
label: '',
xPos: '',
yPos: ''
};
html[j++] = '<svg class="legendLayer" style="width:inherit;height:inherit;">';
html[j++] = '<rect class="background" width="100%" height="100%"/>';
html[j++] = svgShapeDefs;
// Generate html for icons and labels from a list of entries
for (var i = 0; i < entries.length; ++i) {
entry = entries[i];
iconHtml = '';
shape.label = entry.label;
shape.xPos = '0em';
shape.yPos = i * 1.5 + 'em';
// area
if (entry.options.lines.show && entry.options.lines.fill) {
shape.name = 'area';
shape.fillColor = entry.color;
iconHtml += getEntryIconHtml(shape);
}
// bars
if (entry.options.bars.show) {
shape.name = 'bar';
shape.fillColor = entry.color;
iconHtml += getEntryIconHtml(shape);
}
// lines
if (entry.options.lines.show && !entry.options.lines.fill) {
shape.name = 'line';
shape.strokeColor = entry.color;
shape.strokeWidth = entry.options.lines.lineWidth;
iconHtml += getEntryIconHtml(shape);
}
// points
if (entry.options.points.show) {
shape.name = entry.options.points.symbol;
shape.strokeColor = entry.color;
shape.fillColor = entry.options.points.fillColor;
shape.strokeWidth = entry.options.points.lineWidth;
iconHtml += getEntryIconHtml(shape);
}
maxLabelLength = maxLabelLength < shape.label.length ? shape.label.length : maxLabelLength;
labelHtml = '<text x="' + shape.xPos + '" y="' + shape.yPos + '" text-anchor="start"><tspan dx="2em" dy="1.2em">' + shape.label + '</tspan></text>'
html[j++] = '<g>' + iconHtml + labelHtml + '</g>';
}
html[j++] = '</svg>';
if (m[0] == null) {
m = [m, m];
}
if (p.charAt(0) === 'n') {
pos += 'top:' + (m[1] + plotOffset.top) + 'px;';
} else if (p.charAt(0) === 's') {
pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';
}
if (p.charAt(1) === 'e') {
pos += 'right:' + (m[0] + plotOffset.right) + 'px;';
} else if (p.charAt(1) === 'w') {
pos += 'left:' + (m[0] + plotOffset.left) + 'px;';
}
var legendEl,
width = 3 + maxLabelLength / 2,
height = entries.length * 1.6;
if (!options.legend.container) {
legendEl = $('<div class="legend" style="position:absolute;' + pos + '">' + html.join('') + '</div>').appendTo(placeholder);
legendEl.css('width', width + 'em');
legendEl.css('height', height + 'em');
legendEl.css('pointerEvents', 'none');
} else {
legendEl = $(html.join('')).appendTo(options.legend.container)[0];
options.legend.container.style.width = width + 'em';
options.legend.container.style.height = height + 'em';
}
}
// Generate html for a shape
function getEntryIconHtml(shape) {
var html = '',
name = shape.name,
x = shape.xPos,
y = shape.yPos,
fill = shape.fillColor,
stroke = shape.strokeColor,
width = shape.strokeWidth;
switch (name) {
case 'circle':
html = '<use xlink:href="#circle" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'diamond':
html = '<use xlink:href="#diamond" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'cross':
html = '<use xlink:href="#cross" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
// 'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'rectangle':
html = '<use xlink:href="#rectangle" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'plus':
html = '<use xlink:href="#plus" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
// 'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'bar':
html = '<use xlink:href="#bars" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
'fill="' + fill + '" ' +
// 'stroke="' + stroke + '" ' +
// 'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'area':
html = '<use xlink:href="#area" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
'fill="' + fill + '" ' +
// 'stroke="' + stroke + '" ' +
// 'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
case 'line':
html = '<use xlink:href="#line" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
// 'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
break;
default:
// default is circle
html = '<use xlink:href="#circle" class="legendIcon" ' +
'x="' + x + '" ' +
'y="' + y + '" ' +
'fill="' + fill + '" ' +
'stroke="' + stroke + '" ' +
'stroke-width="' + width + '" ' +
'width="1.5em" height="1.5em"' +
'/>';
}
return html;
}
// Define svg symbols for shapes
var svgShapeDefs = '' +
'<defs>' +
'<symbol id="line" fill="none" viewBox="-5 -5 25 25">' +
'<polyline points="0,15 5,5 10,10 15,0"/>' +
'</symbol>' +
'<symbol id="area" stroke-width="1" viewBox="-5 -5 25 25">' +
'<polyline points="0,15 5,5 10,10 15,0, 15,15, 0,15"/>' +
'</symbol>' +
'<symbol id="bars" stroke-width="1" viewBox="-5 -5 25 25">' +
'<polyline points="1.5,15.5 1.5,12.5, 4.5,12.5 4.5,15.5 6.5,15.5 6.5,3.5, 9.5,3.5 9.5,15.5 11.5,15.5 11.5,7.5 14.5,7.5 14.5,15.5 1.5,15.5"/>' +
'</symbol>' +
'<symbol id="circle" viewBox="-5 -5 25 25">' +
'<circle cx="0" cy="15" r="2.5"/>' +
'<circle cx="5" cy="5" r="2.5"/>' +
'<circle cx="10" cy="10" r="2.5"/>' +
'<circle cx="15" cy="0" r="2.5"/>' +
'</symbol>' +
'<symbol id="rectangle" viewBox="-5 -5 25 25">' +
'<rect x="-2.1" y="12.9" width="4.2" height="4.2"/>' +
'<rect x="2.9" y="2.9" width="4.2" height="4.2"/>' +
'<rect x="7.9" y="7.9" width="4.2" height="4.2"/>' +
'<rect x="12.9" y="-2.1" width="4.2" height="4.2"/>' +
'</symbol>' +
'<symbol id="diamond" viewBox="-5 -5 25 25">' +
'<path d="M-3,15 L0,12 L3,15, L0,18 Z"/>' +
'<path d="M2,5 L5,2 L8,5, L5,8 Z"/>' +
'<path d="M7,10 L10,7 L13,10, L10,13 Z"/>' +
'<path d="M12,0 L15,-3 L18,0, L15,3 Z"/>' +
'</symbol>' +
'<symbol id="cross" fill="none" viewBox="-5 -5 25 25">' +
'<path d="M-2.1,12.9 L2.1,17.1, M2.1,12.9 L-2.1,17.1 Z"/>' +
'<path d="M2.9,2.9 L7.1,7.1 M7.1,2.9 L2.9,7.1 Z"/>' +
'<path d="M7.9,7.9 L12.1,12.1 M12.1,7.9 L7.9,12.1 Z"/>' +
'<path d="M12.9,-2.1 L17.1,2.1 M17.1,-2.1 L12.9,2.1 Z"/>' +
'</symbol>' +
'<symbol id="plus" fill="none" viewBox="-5 -5 25 25">' +
'<path d="M0,12 L0,18, M-3,15 L3,15 Z"/>' +
'<path d="M5,2 L5,8 M2,5 L8,5 Z"/>' +
'<path d="M10,7 L10,13 M7,10 L13,10 Z"/>' +
'<path d="M15,-3 L15,3 M12,0 L18,0 Z"/>' +
'</symbol>' +
'</defs>';
// Generate a list of legend entries in their final order
function getLegendEntries(series, labelFormatter, sorted) {
var lf = labelFormatter,
legendEntries = series.map(function(s, i) {
return {
label: (lf ? lf(s.label, s) : s.label) || 'Plot ' + (i + 1),
color: s.color,
options: {
lines: s.lines,
points: s.points,
bars: s.bars
}
};
});
// Sort the legend using either the default or a custom comparator
if (sorted) {
if ($.isFunction(sorted)) {
legendEntries.sort(sorted);
} else if (sorted === 'reverse') {
legendEntries.reverse();
} else {
var ascending = (sorted !== 'descending');
legendEntries.sort(function(a, b) {
return a.label === b.label
? 0
: ((a.label < b.label) !== ascending ? 1 : -1 // Logical XOR
);
});
}
}
return legendEntries;
}
// return false if opts1 same as opts2
function checkOptions(opts1, opts2) {
for (var prop in opts1) {
if (opts1.hasOwnProperty(prop)) {
if (opts1[prop] !== opts2[prop]) {
return true;
}
}
}
return false;
}
// Compare two lists of legend entries
function shouldRedraw(oldEntries, newEntries) {
if (!oldEntries || !newEntries) {
return true;
}
if (oldEntries.length !== newEntries.length) {
return true;
}
var i, newEntry, oldEntry, newOpts, oldOpts;
for (i = 0; i < newEntries.length; i++) {
newEntry = newEntries[i];
oldEntry = oldEntries[i];
if (newEntry.label !== oldEntry.label) {
return true;
}
if (newEntry.color !== oldEntry.color) {
return true;
}
// check for changes in lines options
newOpts = newEntry.options.lines;
oldOpts = oldEntry.options.lines;
if (checkOptions(newOpts, oldOpts)) {
return true;
}
// check for changes in points options
newOpts = newEntry.options.points;
oldOpts = oldEntry.options.points;
if (checkOptions(newOpts, oldOpts)) {
return true;
}
// check for changes in bars options
newOpts = newEntry.options.bars;
oldOpts = oldEntry.options.bars;
if (checkOptions(newOpts, oldOpts)) {
return true;
}
}
return false;
}
function init(plot) {
plot.hooks.setupGrid.push(function (plot) {
var options = plot.getOptions();
var series = plot.getData(),
labelFormatter = options.legend.labelFormatter,
oldEntries = options.legend.legendEntries,
oldPlotOffset = options.legend.plotOffset,
newEntries = getLegendEntries(series, labelFormatter, options.legend.sorted),
newPlotOffset = plot.getPlotOffset();
if (shouldRedraw(oldEntries, newEntries) ||
checkOptions(oldPlotOffset, newPlotOffset)) {
insertLegend(plot, options, plot.getPlaceholder(), newEntries);
}
});
}
$.plot.plugins.push({
init: init,
options: defaultOptions,
name: 'legend',
version: '1.0'
});
})(jQuery);

View File

@ -1,296 +0,0 @@
/* Pretty handling of log axes.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Copyright (c) 2015 Ciprian Ceteras cipix2000@gmail.com.
Copyright (c) 2017 Raluca Portase
Licensed under the MIT license.
Set axis.mode to "log" to enable.
*/
/* global jQuery*/
/**
## jquery.flot.logaxis
This plugin is used to create logarithmic axis. This includes tick generation,
formatters and transformers to and from logarithmic representation.
### Methods and hooks
*/
(function ($) {
'use strict';
var options = {
xaxis: {}
};
/*tick generators and formatters*/
var PREFERRED_LOG_TICK_VALUES = computePreferedLogTickValues(Number.MAX_VALUE, 10),
EXTENDED_LOG_TICK_VALUES = computePreferedLogTickValues(Number.MAX_VALUE, 4);
function computePreferedLogTickValues(endLimit, rangeStep) {
var log10End = Math.floor(Math.log(endLimit) * Math.LOG10E) - 1,
log10Start = -log10End,
val, range, vals = [];
for (var power = log10Start; power <= log10End; power++) {
range = Math.pow(10, power);
for (var mult = 1; mult < 9; mult += rangeStep) {
val = range * mult;
vals.push(val);
}
}
return vals;
}
/**
- logTickGenerator(plot, axis, noTicks)
Generates logarithmic ticks, depending on axis range.
In case the number of ticks that can be generated is less than the expected noTicks/4,
a linear tick generation is used.
*/
var logTickGenerator = function (plot, axis, noTicks) {
var ticks = [],
minIdx = -1,
maxIdx = -1,
surface = plot.getCanvas(),
logTickValues = PREFERRED_LOG_TICK_VALUES,
min = clampAxis(axis, plot),
max = axis.max;
if (!noTicks) {
noTicks = 0.3 * Math.sqrt(axis.direction === "x" ? surface.width : surface.height);
}
PREFERRED_LOG_TICK_VALUES.some(function (val, i) {
if (val >= min) {
minIdx = i;
return true;
} else {
return false;
}
});
PREFERRED_LOG_TICK_VALUES.some(function (val, i) {
if (val >= max) {
maxIdx = i;
return true;
} else {
return false;
}
});
if (maxIdx === -1) {
maxIdx = PREFERRED_LOG_TICK_VALUES.length - 1;
}
if (maxIdx - minIdx <= noTicks / 4 && logTickValues.length !== EXTENDED_LOG_TICK_VALUES.length) {
//try with multiple of 5 for tick values
logTickValues = EXTENDED_LOG_TICK_VALUES;
minIdx *= 2;
maxIdx *= 2;
}
var lastDisplayed = null,
inverseNoTicks = 1 / noTicks,
tickValue, pixelCoord, tick;
// Count the number of tick values would appear, if we can get at least
// nTicks / 4 accept them.
if (maxIdx - minIdx >= noTicks / 4) {
for (var idx = maxIdx; idx >= minIdx; idx--) {
tickValue = logTickValues[idx];
pixelCoord = (Math.log(tickValue) - Math.log(min)) / (Math.log(max) - Math.log(min));
tick = tickValue;
if (lastDisplayed === null) {
lastDisplayed = {
pixelCoord: pixelCoord,
idealPixelCoord: pixelCoord
};
} else {
if (Math.abs(pixelCoord - lastDisplayed.pixelCoord) >= inverseNoTicks) {
lastDisplayed = {
pixelCoord: pixelCoord,
idealPixelCoord: lastDisplayed.idealPixelCoord - inverseNoTicks
};
} else {
tick = null;
}
}
if (tick) {
ticks.push(tick);
}
}
// Since we went in backwards order.
ticks.reverse();
} else {
var tickSize = plot.computeTickSize(min, max, noTicks),
customAxis = {min: min, max: max, tickSize: tickSize};
ticks = $.plot.linearTickGenerator(customAxis);
}
return ticks;
};
var clampAxis = function (axis, plot) {
var min = axis.min,
max = axis.max;
if (min <= 0) {
//for empty graph if axis.min is not strictly positive make it 0.1
if (axis.datamin === null) {
min = axis.min = 0.1;
} else {
min = processAxisOffset(plot, axis);
}
if (max < min) {
axis.max = axis.datamax !== null ? axis.datamax : axis.options.max;
axis.options.offset.below = 0;
axis.options.offset.above = 0;
}
}
return min;
}
/**
- logTickFormatter(value, axis, precision)
This is the corresponding tickFormatter of the logaxis.
For a number greater that 10^6 or smaller than 10^(-3), this will be drawn
with e representation
*/
var logTickFormatter = function (value, axis, precision) {
var tenExponent = value > 0 ? Math.floor(Math.log(value) / Math.LN10) : 0;
if (precision) {
if ((tenExponent >= -4) && (tenExponent <= 7)) {
return $.plot.defaultTickFormatter(value, axis, precision);
} else {
return $.plot.expRepTickFormatter(value, axis, precision);
}
}
if ((tenExponent >= -4) && (tenExponent <= 7)) {
//if we have float numbers, return a limited length string(ex: 0.0009 is represented as 0.000900001)
var formattedValue = tenExponent < 0 ? value.toFixed(-tenExponent) : value.toFixed(tenExponent + 2);
if (formattedValue.indexOf('.') !== -1) {
var lastZero = formattedValue.lastIndexOf('0');
while (lastZero === formattedValue.length - 1) {
formattedValue = formattedValue.slice(0, -1);
lastZero = formattedValue.lastIndexOf('0');
}
//delete the dot if is last
if (formattedValue.indexOf('.') === formattedValue.length - 1) {
formattedValue = formattedValue.slice(0, -1);
}
}
return formattedValue;
} else {
return $.plot.expRepTickFormatter(value, axis);
}
};
/*logaxis caracteristic functions*/
var logTransform = function (v) {
if (v < PREFERRED_LOG_TICK_VALUES[0]) {
v = PREFERRED_LOG_TICK_VALUES[0];
}
return Math.log(v);
};
var logInverseTransform = function (v) {
return Math.exp(v);
};
var invertedTransform = function (v) {
return -v;
}
var invertedLogTransform = function (v) {
return -logTransform(v);
}
var invertedLogInverseTransform = function (v) {
return logInverseTransform(-v);
}
/**
- setDataminRange(plot, axis)
It is used for clamping the starting point of a logarithmic axis.
This will set the axis datamin range to 0.1 or to the first datapoint greater then 0.
The function is usefull since the logarithmic representation can not show
values less than or equal to 0.
*/
function setDataminRange(plot, axis) {
if (axis.options.mode === 'log' && axis.datamin <= 0) {
if (axis.datamin === null) {
axis.datamin = 0.1;
} else {
axis.datamin = processAxisOffset(plot, axis);
}
}
}
function processAxisOffset(plot, axis) {
var series = plot.getData(),
range = series
.filter(function(series) {
return series.xaxis === axis || series.yaxis === axis;
})
.map(function(series) {
return plot.computeRangeForDataSeries(series, null, isValid);
}),
min = axis.direction === 'x' ? Math.min(0.1, range[0].xmin) : Math.min(0.1, range[0].ymin);
axis.min = min;
return min;
}
function isValid(a) {
return a > 0;
}
function init(plot) {
plot.hooks.processOptions.push(function (plot) {
$.each(plot.getAxes(), function (axisName, axis) {
var opts = axis.options;
if (opts.mode === 'log') {
axis.tickGenerator = function (axis) {
var noTicks = 11;
return logTickGenerator(plot, axis, noTicks);
};
if (typeof axis.options.tickFormatter !== 'function') {
axis.options.tickFormatter = logTickFormatter;
}
axis.options.transform = opts.inverted ? invertedLogTransform : logTransform;
axis.options.inverseTransform = opts.inverted ? invertedLogInverseTransform : logInverseTransform;
axis.options.autoScaleMargin = 0;
plot.hooks.setRange.push(setDataminRange);
} else if (opts.inverted) {
axis.options.transform = invertedTransform;
axis.options.inverseTransform = invertedTransform;
}
});
});
}
$.plot.plugins.push({
init: init,
options: options,
name: 'log',
version: '0.1'
});
$.plot.logTicksGenerator = logTickGenerator;
$.plot.logTickFormatter = logTickFormatter;
})(jQuery);

View File

@ -1,781 +0,0 @@
/* Flot plugin for adding the ability to pan and zoom the plot.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Copyright (c) 2016 Ciprian Ceteras.
Copyright (c) 2017 Raluca Portase.
Licensed under the MIT license.
*/
/**
## jquery.flot.navigate.js
This flot plugin is used for adding the ability to pan and zoom the plot.
A higher level overview is available at [interactions](interactions.md) documentation.
The default behaviour is scrollwheel up/down to zoom in, drag
to pan. The plugin defines plot.zoom({ center }), plot.zoomOut() and
plot.pan( offset ) so you easily can add custom controls. It also fires
"plotpan" and "plotzoom" events, useful for synchronizing plots.
The plugin supports these options:
```js
zoom: {
interactive: false,
active: false,
amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out)
}
pan: {
interactive: false,
active: false,
cursor: "move", // CSS mouse cursor value used when dragging, e.g. "pointer"
frameRate: 60,
mode: "smart" // enable smart pan mode
}
xaxis: {
axisZoom: true, //zoom axis when mouse over it is allowed
plotZoom: true, //zoom axis is allowed for plot zoom
axisPan: true, //pan axis when mouse over it is allowed
plotPan: true //pan axis is allowed for plot pan
}
yaxis: {
axisZoom: true, //zoom axis when mouse over it is allowed
plotZoom: true, //zoom axis is allowed for plot zoom
axisPan: true, //pan axis when mouse over it is allowed
plotPan: true //pan axis is allowed for plot pan
}
```
**interactive** enables the built-in drag/click behaviour. If you enable
interactive for pan, then you'll have a basic plot that supports moving
around; the same for zoom.
**active** is true after a touch tap on plot. This enables plot navigation.
Once activated, zoom and pan cannot be deactivated. When the plot becomes active,
"plotactivated" event is triggered.
**amount** specifies the default amount to zoom in (so 1.5 = 150%) relative to
the current viewport.
**cursor** is a standard CSS mouse cursor string used for visual feedback to the
user when dragging.
**frameRate** specifies the maximum number of times per second the plot will
update itself while the user is panning around on it (set to null to disable
intermediate pans, the plot will then not update until the mouse button is
released).
**mode** a string specifies the pan mode for mouse interaction. Accepted values:
'manual': no pan hint or direction snapping;
'smart': The graph shows pan hint bar and the pan movement will snap
to one direction when the drag direction is close to it;
'smartLock'. The graph shows pan hint bar and the pan movement will always
snap to a direction that the drag diorection started with.
Example API usage:
```js
plot = $.plot(...);
// zoom default amount in on the pixel ( 10, 20 )
plot.zoom({ center: { left: 10, top: 20 } });
// zoom out again
plot.zoomOut({ center: { left: 10, top: 20 } });
// zoom 200% in on the pixel (10, 20)
plot.zoom({ amount: 2, center: { left: 10, top: 20 } });
// pan 100 pixels to the left (changing x-range in a positive way) and 20 down
plot.pan({ left: -100, top: 20 })
```
Here, "center" specifies where the center of the zooming should happen. Note
that this is defined in pixel space, not the space of the data points (you can
use the p2c helpers on the axes in Flot to help you convert between these).
**amount** is the amount to zoom the viewport relative to the current range, so
1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is 70% (zoom out). You
can set the default in the options.
*/
/* eslint-enable */
(function($) {
'use strict';
var options = {
zoom: {
interactive: false,
active: false,
amount: 1.5 // how much to zoom relative to current position, 2 = 200% (zoom in), 0.5 = 50% (zoom out)
},
pan: {
interactive: false,
active: false,
cursor: "move",
frameRate: 60,
mode: 'smart'
},
xaxis: {
axisZoom: true, //zoom axis when mouse over it is allowed
plotZoom: true, //zoom axis is allowed for plot zoom
axisPan: true, //pan axis when mouse over it is allowed
plotPan: true //pan axis is allowed for plot pan
},
yaxis: {
axisZoom: true,
plotZoom: true,
axisPan: true,
plotPan: true
}
};
var saturated = $.plot.saturated;
var browser = $.plot.browser;
var SNAPPING_CONSTANT = $.plot.uiConstants.SNAPPING_CONSTANT;
var PANHINT_LENGTH_CONSTANT = $.plot.uiConstants.PANHINT_LENGTH_CONSTANT;
function init(plot) {
plot.hooks.processOptions.push(initNevigation);
}
function initNevigation(plot, options) {
var panAxes = null;
var canDrag = false;
var useManualPan = options.pan.mode === 'manual',
smartPanLock = options.pan.mode === 'smartLock',
useSmartPan = smartPanLock || options.pan.mode === 'smart';
function onZoomClick(e, zoomOut, amount) {
var page = browser.getPageXY(e);
var c = plot.offset();
c.left = page.X - c.left;
c.top = page.Y - c.top;
var ec = plot.getPlaceholder().offset();
ec.left = page.X - ec.left;
ec.top = page.Y - ec.top;
var axes = plot.getXAxes().concat(plot.getYAxes()).filter(function (axis) {
var box = axis.box;
if (box !== undefined) {
return (ec.left > box.left) && (ec.left < box.left + box.width) &&
(ec.top > box.top) && (ec.top < box.top + box.height);
}
});
if (axes.length === 0) {
axes = undefined;
}
if (zoomOut) {
plot.zoomOut({
center: c,
axes: axes,
amount: amount
});
} else {
plot.zoom({
center: c,
axes: axes,
amount: amount
});
}
}
var prevCursor = 'default',
panHint = null,
panTimeout = null,
plotState,
prevDragPosition = { x: 0, y: 0 },
isPanAction = false;
function onMouseWheel(e, delta) {
var maxAbsoluteDeltaOnMac = 1,
isMacScroll = Math.abs(e.originalEvent.deltaY) <= maxAbsoluteDeltaOnMac,
defaultNonMacScrollAmount = null,
macMagicRatio = 50,
amount = isMacScroll ? 1 + Math.abs(e.originalEvent.deltaY) / macMagicRatio : defaultNonMacScrollAmount;
if (isPanAction) {
onDragEnd(e);
}
if (plot.getOptions().zoom.active) {
e.preventDefault();
onZoomClick(e, delta < 0, amount);
return false;
}
}
plot.navigationState = function(startPageX, startPageY) {
var axes = this.getAxes();
var result = {};
Object.keys(axes).forEach(function(axisName) {
var axis = axes[axisName];
result[axisName] = {
navigationOffset: { below: axis.options.offset.below || 0,
above: axis.options.offset.above || 0},
axisMin: axis.min,
axisMax: axis.max,
diagMode: false
}
});
result.startPageX = startPageX || 0;
result.startPageY = startPageY || 0;
return result;
}
function onMouseDown(e) {
canDrag = true;
}
function onMouseUp(e) {
canDrag = false;
}
function isLeftMouseButtonPressed(e) {
return e.button === 0;
}
function onDragStart(e) {
if (!canDrag || !isLeftMouseButtonPressed(e)) {
return false;
}
isPanAction = true;
var page = browser.getPageXY(e);
var ec = plot.getPlaceholder().offset();
ec.left = page.X - ec.left;
ec.top = page.Y - ec.top;
panAxes = plot.getXAxes().concat(plot.getYAxes()).filter(function (axis) {
var box = axis.box;
if (box !== undefined) {
return (ec.left > box.left) && (ec.left < box.left + box.width) &&
(ec.top > box.top) && (ec.top < box.top + box.height);
}
});
if (panAxes.length === 0) {
panAxes = undefined;
}
var c = plot.getPlaceholder().css('cursor');
if (c) {
prevCursor = c;
}
plot.getPlaceholder().css('cursor', plot.getOptions().pan.cursor);
if (useSmartPan) {
plotState = plot.navigationState(page.X, page.Y);
} else if (useManualPan) {
prevDragPosition.x = page.X;
prevDragPosition.y = page.Y;
}
}
function onDrag(e) {
var page = browser.getPageXY(e);
var frameRate = plot.getOptions().pan.frameRate;
if (frameRate === -1) {
if (useSmartPan) {
plot.smartPan({
x: plotState.startPageX - page.X,
y: plotState.startPageY - page.Y
}, plotState, panAxes, false, smartPanLock);
} else if (useManualPan) {
plot.pan({
left: prevDragPosition.x - page.X,
top: prevDragPosition.y - page.Y,
axes: panAxes
});
prevDragPosition.x = page.X;
prevDragPosition.y = page.Y;
}
return;
}
if (panTimeout || !frameRate) return;
panTimeout = setTimeout(function() {
if (useSmartPan) {
plot.smartPan({
x: plotState.startPageX - page.X,
y: plotState.startPageY - page.Y
}, plotState, panAxes, false, smartPanLock);
} else if (useManualPan) {
plot.pan({
left: prevDragPosition.x - page.X,
top: prevDragPosition.y - page.Y,
axes: panAxes
});
prevDragPosition.x = page.X;
prevDragPosition.y = page.Y;
}
panTimeout = null;
}, 1 / frameRate * 1000);
}
function onDragEnd(e) {
if (panTimeout) {
clearTimeout(panTimeout);
panTimeout = null;
}
isPanAction = false;
var page = browser.getPageXY(e);
plot.getPlaceholder().css('cursor', prevCursor);
if (useSmartPan) {
plot.smartPan({
x: plotState.startPageX - page.X,
y: plotState.startPageY - page.Y
}, plotState, panAxes, false, smartPanLock);
plot.smartPan.end();
} else if (useManualPan) {
plot.pan({
left: prevDragPosition.x - page.X,
top: prevDragPosition.y - page.Y,
axes: panAxes
});
prevDragPosition.x = 0;
prevDragPosition.y = 0;
}
}
function onDblClick(e) {
plot.activate();
var axes = plot.getTouchedAxis(e.clientX, e.clientY),
event;
if (axes[0]) {
event = new $.Event('re-center', { detail: {
axisTouched: axes[0]
}});
} else {
event = new $.Event('re-center', {detail: e});
}
plot.getPlaceholder().trigger(event);
}
function onClick(e) {
plot.activate();
if (isPanAction) {
onDragEnd(e);
}
return false;
}
plot.activate = function() {
var o = plot.getOptions();
if (!o.pan.active || !o.zoom.active) {
o.pan.active = true;
o.zoom.active = true;
plot.getPlaceholder().trigger("plotactivated", [plot]);
}
}
function bindEvents(plot, eventHolder) {
var o = plot.getOptions();
if (o.zoom.interactive) {
eventHolder.mousewheel(onMouseWheel);
}
if (o.pan.interactive) {
plot.addEventHandler("dragstart", onDragStart, eventHolder, 0);
plot.addEventHandler("drag", onDrag, eventHolder, 0);
plot.addEventHandler("dragend", onDragEnd, eventHolder, 0);
eventHolder.bind("mousedown", onMouseDown);
eventHolder.bind("mouseup", onMouseUp);
}
eventHolder.dblclick(onDblClick);
eventHolder.click(onClick);
}
plot.zoomOut = function(args) {
if (!args) {
args = {};
}
if (!args.amount) {
args.amount = plot.getOptions().zoom.amount;
}
args.amount = 1 / args.amount;
plot.zoom(args);
};
plot.zoom = function(args) {
if (!args) {
args = {};
}
var c = args.center,
amount = args.amount || plot.getOptions().zoom.amount,
w = plot.width(),
h = plot.height(),
axes = args.axes || plot.getAxes();
if (!c) {
c = {
left: w / 2,
top: h / 2
};
}
var xf = c.left / w,
yf = c.top / h,
minmax = {
x: {
min: c.left - xf * w / amount,
max: c.left + (1 - xf) * w / amount
},
y: {
min: c.top - yf * h / amount,
max: c.top + (1 - yf) * h / amount
}
};
for (var key in axes) {
if (!axes.hasOwnProperty(key)) {
continue;
}
var axis = axes[key],
opts = axis.options,
min = minmax[axis.direction].min,
max = minmax[axis.direction].max,
navigationOffset = axis.options.offset;
//skip axis without axisZoom when zooming only on certain axis or axis without plotZoom for zoom on entire plot
if ((!opts.axisZoom && args.axes) || (!args.axes && !opts.plotZoom)) {
continue;
}
min = $.plot.saturated.saturate(axis.c2p(min));
max = $.plot.saturated.saturate(axis.c2p(max));
if (min > max) {
// make sure min < max
var tmp = min;
min = max;
max = tmp;
}
var offsetBelow = $.plot.saturated.saturate(navigationOffset.below - (axis.min - min));
var offsetAbove = $.plot.saturated.saturate(navigationOffset.above - (axis.max - max));
opts.offset = { below: offsetBelow, above: offsetAbove };
};
plot.setupGrid(true);
plot.draw();
if (!args.preventEvent) {
plot.getPlaceholder().trigger("plotzoom", [plot, args]);
}
};
plot.pan = function(args) {
var delta = {
x: +args.left,
y: +args.top
};
if (isNaN(delta.x)) delta.x = 0;
if (isNaN(delta.y)) delta.y = 0;
$.each(args.axes || plot.getAxes(), function(_, axis) {
var opts = axis.options,
d = delta[axis.direction];
//skip axis without axisPan when panning only on certain axis or axis without plotPan for pan the entire plot
if ((!opts.axisPan && args.axes) || (!opts.plotPan && !args.axes)) {
return;
}
if (d !== 0) {
var navigationOffsetBelow = saturated.saturate(axis.c2p(axis.p2c(axis.min) + d) - axis.c2p(axis.p2c(axis.min))),
navigationOffsetAbove = saturated.saturate(axis.c2p(axis.p2c(axis.max) + d) - axis.c2p(axis.p2c(axis.max)));
if (!isFinite(navigationOffsetBelow)) {
navigationOffsetBelow = 0;
}
if (!isFinite(navigationOffsetAbove)) {
navigationOffsetAbove = 0;
}
opts.offset = {
below: saturated.saturate(navigationOffsetBelow + (opts.offset.below || 0)),
above: saturated.saturate(navigationOffsetAbove + (opts.offset.above || 0))
};
}
});
plot.setupGrid(true);
plot.draw();
if (!args.preventEvent) {
plot.getPlaceholder().trigger("plotpan", [plot, args]);
}
};
plot.recenter = function(args) {
$.each(args.axes || plot.getAxes(), function(_, axis) {
if (args.axes) {
if (this.direction === 'x') {
axis.options.offset = { below: 0 };
} else if (this.direction === 'y') {
axis.options.offset = { above: 0 };
}
} else {
axis.options.offset = { below: 0, above: 0 };
}
});
plot.setupGrid(true);
plot.draw();
};
var shouldSnap = function(delta) {
return (Math.abs(delta.y) < SNAPPING_CONSTANT && Math.abs(delta.x) >= SNAPPING_CONSTANT) ||
(Math.abs(delta.x) < SNAPPING_CONSTANT && Math.abs(delta.y) >= SNAPPING_CONSTANT);
}
// adjust delta so the pan action is constrained on the vertical or horizontal direction
// it the movements in the other direction are small
var adjustDeltaToSnap = function(delta) {
if (Math.abs(delta.x) < SNAPPING_CONSTANT && Math.abs(delta.y) >= SNAPPING_CONSTANT) {
return {x: 0, y: delta.y};
}
if (Math.abs(delta.y) < SNAPPING_CONSTANT && Math.abs(delta.x) >= SNAPPING_CONSTANT) {
return {x: delta.x, y: 0};
}
return delta;
}
var lockedDirection = null;
var lockDeltaDirection = function(delta) {
if (!lockedDirection && Math.max(Math.abs(delta.x), Math.abs(delta.y)) >= SNAPPING_CONSTANT) {
lockedDirection = Math.abs(delta.x) < Math.abs(delta.y) ? 'y' : 'x';
}
switch (lockedDirection) {
case 'x':
return { x: delta.x, y: 0 };
case 'y':
return { x: 0, y: delta.y };
default:
return { x: 0, y: 0 };
}
}
var isDiagonalMode = function(delta) {
if (Math.abs(delta.x) > 0 && Math.abs(delta.y) > 0) {
return true;
}
return false;
}
var restoreAxisOffset = function(axes, initialState, delta) {
var axis;
Object.keys(axes).forEach(function(axisName) {
axis = axes[axisName];
if (delta[axis.direction] === 0) {
axis.options.offset.below = initialState[axisName].navigationOffset.below;
axis.options.offset.above = initialState[axisName].navigationOffset.above;
}
});
}
var prevDelta = { x: 0, y: 0 };
plot.smartPan = function(delta, initialState, panAxes, preventEvent, smartLock) {
var snap = smartLock ? true : shouldSnap(delta),
axes = plot.getAxes(),
opts;
delta = smartLock ? lockDeltaDirection(delta) : adjustDeltaToSnap(delta);
if (isDiagonalMode(delta)) {
initialState.diagMode = true;
}
if (snap && initialState.diagMode === true) {
initialState.diagMode = false;
restoreAxisOffset(axes, initialState, delta);
}
if (snap) {
panHint = {
start: {
x: initialState.startPageX - plot.offset().left + plot.getPlotOffset().left,
y: initialState.startPageY - plot.offset().top + plot.getPlotOffset().top
},
end: {
x: initialState.startPageX - delta.x - plot.offset().left + plot.getPlotOffset().left,
y: initialState.startPageY - delta.y - plot.offset().top + plot.getPlotOffset().top
}
}
} else {
panHint = {
start: {
x: initialState.startPageX - plot.offset().left + plot.getPlotOffset().left,
y: initialState.startPageY - plot.offset().top + plot.getPlotOffset().top
},
end: false
}
}
if (isNaN(delta.x)) delta.x = 0;
if (isNaN(delta.y)) delta.y = 0;
if (panAxes) {
axes = panAxes;
}
var axis, axisMin, axisMax, p, d;
Object.keys(axes).forEach(function(axisName) {
axis = axes[axisName];
axisMin = axis.min;
axisMax = axis.max;
opts = axis.options;
d = delta[axis.direction];
p = prevDelta[axis.direction];
//skip axis without axisPan when panning only on certain axis or axis without plotPan for pan the entire plot
if ((!opts.axisPan && panAxes) || (!panAxes && !opts.plotPan)) {
return;
}
if (d !== 0) {
var navigationOffsetBelow = saturated.saturate(axis.c2p(axis.p2c(axisMin) - (p - d)) - axis.c2p(axis.p2c(axisMin))),
navigationOffsetAbove = saturated.saturate(axis.c2p(axis.p2c(axisMax) - (p - d)) - axis.c2p(axis.p2c(axisMax)));
if (!isFinite(navigationOffsetBelow)) {
navigationOffsetBelow = 0;
}
if (!isFinite(navigationOffsetAbove)) {
navigationOffsetAbove = 0;
}
axis.options.offset.below = saturated.saturate(navigationOffsetBelow + (axis.options.offset.below || 0));
axis.options.offset.above = saturated.saturate(navigationOffsetAbove + (axis.options.offset.above || 0));
}
});
prevDelta = delta;
plot.setupGrid(true);
plot.draw();
if (!preventEvent) {
plot.getPlaceholder().trigger("plotpan", [plot, delta, panAxes, initialState]);
}
};
plot.smartPan.end = function() {
panHint = null;
lockedDirection = null;
prevDelta = { x: 0, y: 0 };
plot.triggerRedrawOverlay();
}
function shutdown(plot, eventHolder) {
eventHolder.unbind("mousewheel", onMouseWheel);
eventHolder.unbind("mousedown", onMouseDown);
eventHolder.unbind("mouseup", onMouseUp);
eventHolder.unbind("dragstart", onDragStart);
eventHolder.unbind("drag", onDrag);
eventHolder.unbind("dragend", onDragEnd);
eventHolder.unbind("dblclick", onDblClick);
eventHolder.unbind("click", onClick);
if (panTimeout) clearTimeout(panTimeout);
}
function drawOverlay(plot, ctx) {
if (panHint) {
ctx.strokeStyle = 'rgba(96, 160, 208, 0.7)';
ctx.lineWidth = 2;
ctx.lineJoin = "round";
var startx = Math.round(panHint.start.x),
starty = Math.round(panHint.start.y),
endx, endy;
if (panAxes) {
if (panAxes[0].direction === 'x') {
endy = Math.round(panHint.start.y);
endx = Math.round(panHint.end.x);
} else if (panAxes[0].direction === 'y') {
endx = Math.round(panHint.start.x);
endy = Math.round(panHint.end.y);
}
} else {
endx = Math.round(panHint.end.x);
endy = Math.round(panHint.end.y);
}
ctx.beginPath();
if (panHint.end === false) {
ctx.moveTo(startx, starty - PANHINT_LENGTH_CONSTANT);
ctx.lineTo(startx, starty + PANHINT_LENGTH_CONSTANT);
ctx.moveTo(startx + PANHINT_LENGTH_CONSTANT, starty);
ctx.lineTo(startx - PANHINT_LENGTH_CONSTANT, starty);
} else {
var dirX = starty === endy;
ctx.moveTo(startx - (dirX ? 0 : PANHINT_LENGTH_CONSTANT), starty - (dirX ? PANHINT_LENGTH_CONSTANT : 0));
ctx.lineTo(startx + (dirX ? 0 : PANHINT_LENGTH_CONSTANT), starty + (dirX ? PANHINT_LENGTH_CONSTANT : 0));
ctx.moveTo(startx, starty);
ctx.lineTo(endx, endy);
ctx.moveTo(endx - (dirX ? 0 : PANHINT_LENGTH_CONSTANT), endy - (dirX ? PANHINT_LENGTH_CONSTANT : 0));
ctx.lineTo(endx + (dirX ? 0 : PANHINT_LENGTH_CONSTANT), endy + (dirX ? PANHINT_LENGTH_CONSTANT : 0));
}
ctx.stroke();
}
}
plot.getTouchedAxis = function(touchPointX, touchPointY) {
var ec = plot.getPlaceholder().offset();
ec.left = touchPointX - ec.left;
ec.top = touchPointY - ec.top;
var axis = plot.getXAxes().concat(plot.getYAxes()).filter(function (axis) {
var box = axis.box;
if (box !== undefined) {
return (ec.left > box.left) && (ec.left < box.left + box.width) &&
(ec.top > box.top) && (ec.top < box.top + box.height);
}
});
return axis;
}
plot.hooks.drawOverlay.push(drawOverlay);
plot.hooks.bindEvents.push(bindEvents);
plot.hooks.shutdown.push(shutdown);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'navigate',
version: '1.3'
});
})(jQuery);

View File

@ -1,786 +0,0 @@
/* Flot plugin for rendering pie charts.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin assumes that each series has a single data value, and that each
value is a positive integer or zero. Negative numbers don't make sense for a
pie chart, and have unpredictable results. The values do NOT need to be
passed in as percentages; the plugin will calculate the total and per-slice
percentages internally.
* Created by Brian Medendorp
* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
The plugin supports these options:
series: {
pie: {
show: true/false
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
offset: {
top: integer value to move the pie up or down
left: integer value to move the pie left or right, or 'auto'
},
stroke: {
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
width: integer pixel width of the stroke
},
label: {
show: true/false, or 'auto'
formatter: a user-defined function that modifies the text/style of the label text
radius: 0-1 for percentage of fullsize, or a specified pixel length
background: {
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
opacity: 0-1
},
threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
},
combine: {
threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
label: any text value of what the combined slice should be labeled
}
highlight: {
opacity: 0-1
}
}
}
More detail and specific examples can be found in the included HTML file.
*/
(function($) {
// Maximum redraw attempts when fitting labels within the plot
var REDRAW_ATTEMPTS = 10;
// Factor by which to shrink the pie when fitting labels within the plot
var REDRAW_SHRINK = 0.95;
function init(plot) {
var canvas = null,
target = null,
options = null,
maxRadius = null,
centerLeft = null,
centerTop = null,
processed = false,
ctx = null;
// interactive variables
var highlights = [];
// add hook to determine if pie plugin in enabled, and then perform necessary operations
plot.hooks.processOptions.push(function(plot, options) {
if (options.series.pie.show) {
options.grid.show = false;
// set labels.show
if (options.series.pie.label.show === "auto") {
if (options.legend.show) {
options.series.pie.label.show = false;
} else {
options.series.pie.label.show = true;
}
}
// set radius
if (options.series.pie.radius === "auto") {
if (options.series.pie.label.show) {
options.series.pie.radius = 3 / 4;
} else {
options.series.pie.radius = 1;
}
}
// ensure sane tilt
if (options.series.pie.tilt > 1) {
options.series.pie.tilt = 1;
} else if (options.series.pie.tilt < 0) {
options.series.pie.tilt = 0;
}
}
});
plot.hooks.bindEvents.push(function(plot, eventHolder) {
var options = plot.getOptions();
if (options.series.pie.show) {
if (options.grid.hoverable) {
eventHolder.unbind("mousemove").mousemove(onMouseMove);
}
if (options.grid.clickable) {
eventHolder.unbind("click").click(onClick);
}
}
});
plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
var options = plot.getOptions();
if (options.series.pie.show) {
processDatapoints(plot, series, data, datapoints);
}
});
plot.hooks.drawOverlay.push(function(plot, octx) {
var options = plot.getOptions();
if (options.series.pie.show) {
drawOverlay(plot, octx);
}
});
plot.hooks.draw.push(function(plot, newCtx) {
var options = plot.getOptions();
if (options.series.pie.show) {
draw(plot, newCtx);
}
});
function processDatapoints(plot, series, datapoints) {
if (!processed) {
processed = true;
canvas = plot.getCanvas();
target = $(canvas).parent();
options = plot.getOptions();
plot.setData(combine(plot.getData()));
}
}
function combine(data) {
var total = 0,
combined = 0,
numCombined = 0,
color = options.series.pie.combine.color,
newdata = [],
i,
value;
// Fix up the raw data from Flot, ensuring the data is numeric
for (i = 0; i < data.length; ++i) {
value = data[i].data;
// If the data is an array, we'll assume that it's a standard
// Flot x-y pair, and are concerned only with the second value.
// Note how we use the original array, rather than creating a
// new one; this is more efficient and preserves any extra data
// that the user may have stored in higher indexes.
if ($.isArray(value) && value.length === 1) {
value = value[0];
}
if ($.isArray(value)) {
// Equivalent to $.isNumeric() but compatible with jQuery < 1.7
if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
value[1] = +value[1];
} else {
value[1] = 0;
}
} else if (!isNaN(parseFloat(value)) && isFinite(value)) {
value = [1, +value];
} else {
value = [1, 0];
}
data[i].data = [value];
}
// Sum up all the slices, so we can calculate percentages for each
for (i = 0; i < data.length; ++i) {
total += data[i].data[0][1];
}
// Count the number of slices with percentages below the combine
// threshold; if it turns out to be just one, we won't combine.
for (i = 0; i < data.length; ++i) {
value = data[i].data[0][1];
if (value / total <= options.series.pie.combine.threshold) {
combined += value;
numCombined++;
if (!color) {
color = data[i].color;
}
}
}
for (i = 0; i < data.length; ++i) {
value = data[i].data[0][1];
if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
newdata.push(
$.extend(data[i], { /* extend to allow keeping all other original data values
and using them e.g. in labelFormatter. */
data: [[1, value]],
color: data[i].color,
label: data[i].label,
angle: value * Math.PI * 2 / total,
percent: value / (total / 100)
})
);
}
}
if (numCombined > 1) {
newdata.push({
data: [[1, combined]],
color: color,
label: options.series.pie.combine.label,
angle: combined * Math.PI * 2 / total,
percent: combined / (total / 100)
});
}
return newdata;
}
function draw(plot, newCtx) {
if (!target) {
return; // if no series were passed
}
var canvasWidth = plot.getPlaceholder().width(),
canvasHeight = plot.getPlaceholder().height(),
legendWidth = target.children().filter(".legend").children().width() || 0;
ctx = newCtx;
// WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
// When combining smaller slices into an 'other' slice, we need to
// add a new series. Since Flot gives plugins no way to modify the
// list of series, the pie plugin uses a hack where the first call
// to processDatapoints results in a call to setData with the new
// list of series, then subsequent processDatapoints do nothing.
// The plugin-global 'processed' flag is used to control this hack;
// it starts out false, and is set to true after the first call to
// processDatapoints.
// Unfortunately this turns future setData calls into no-ops; they
// call processDatapoints, the flag is true, and nothing happens.
// To fix this we'll set the flag back to false here in draw, when
// all series have been processed, so the next sequence of calls to
// processDatapoints once again starts out with a slice-combine.
// This is really a hack; in 0.9 we need to give plugins a proper
// way to modify series before any processing begins.
processed = false;
// calculate maximum radius and center point
maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
centerTop = canvasHeight / 2 + options.series.pie.offset.top;
centerLeft = canvasWidth / 2;
if (options.series.pie.offset.left === "auto") {
if (options.legend.position.match("w")) {
centerLeft += legendWidth / 2;
} else {
centerLeft -= legendWidth / 2;
}
if (centerLeft < maxRadius) {
centerLeft = maxRadius;
} else if (centerLeft > canvasWidth - maxRadius) {
centerLeft = canvasWidth - maxRadius;
}
} else {
centerLeft += options.series.pie.offset.left;
}
var slices = plot.getData(),
attempts = 0;
// Keep shrinking the pie's radius until drawPie returns true,
// indicating that all the labels fit, or we try too many times.
do {
if (attempts > 0) {
maxRadius *= REDRAW_SHRINK;
}
attempts += 1;
clear();
if (options.series.pie.tilt <= 0.8) {
drawShadow();
}
} while (!drawPie() && attempts < REDRAW_ATTEMPTS)
if (attempts >= REDRAW_ATTEMPTS) {
clear();
target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
}
if (plot.setSeries && plot.insertLegend) {
plot.setSeries(slices);
plot.insertLegend();
}
// we're actually done at this point, just defining internal functions at this point
function clear() {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
target.children().filter(".pieLabel, .pieLabelBackground").remove();
}
function drawShadow() {
var shadowLeft = options.series.pie.shadow.left;
var shadowTop = options.series.pie.shadow.top;
var edge = 10;
var alpha = options.series.pie.shadow.alpha;
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
return; // shadow would be outside canvas, so don't draw it
}
ctx.save();
ctx.translate(shadowLeft, shadowTop);
ctx.globalAlpha = alpha;
ctx.fillStyle = "#000";
// center and rotate to starting position
ctx.translate(centerLeft, centerTop);
ctx.scale(1, options.series.pie.tilt);
//radius -= edge;
for (var i = 1; i <= edge; i++) {
ctx.beginPath();
ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
ctx.fill();
radius -= i;
}
ctx.restore();
}
function drawPie() {
var startAngle = Math.PI * options.series.pie.startAngle;
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
var i;
// center and rotate to starting position
ctx.save();
ctx.translate(centerLeft, centerTop);
ctx.scale(1, options.series.pie.tilt);
//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
// draw slices
ctx.save();
var currentAngle = startAngle;
for (i = 0; i < slices.length; ++i) {
slices[i].startAngle = currentAngle;
drawSlice(slices[i].angle, slices[i].color, true);
}
ctx.restore();
// draw slice outlines
if (options.series.pie.stroke.width > 0) {
ctx.save();
ctx.lineWidth = options.series.pie.stroke.width;
currentAngle = startAngle;
for (i = 0; i < slices.length; ++i) {
drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
}
ctx.restore();
}
// draw donut hole
drawDonutHole(ctx);
ctx.restore();
// Draw the labels, returning true if they fit within the plot
if (options.series.pie.label.show) {
return drawLabels();
} else return true;
function drawSlice(angle, color, fill) {
if (angle <= 0 || isNaN(angle)) {
return;
}
if (fill) {
ctx.fillStyle = color;
} else {
ctx.strokeStyle = color;
ctx.lineJoin = "round";
}
ctx.beginPath();
if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
ctx.moveTo(0, 0); // Center of the pie
}
//ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
ctx.arc(0, 0, radius, currentAngle, currentAngle + angle / 2, false);
ctx.arc(0, 0, radius, currentAngle + angle / 2, currentAngle + angle, false);
ctx.closePath();
//ctx.rotate(angle); // This doesn't work properly in Opera
currentAngle += angle;
if (fill) {
ctx.fill();
} else {
ctx.stroke();
}
}
function drawLabels() {
var currentAngle = startAngle;
var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
for (var i = 0; i < slices.length; ++i) {
if (slices[i].percent >= options.series.pie.label.threshold * 100) {
if (!drawLabel(slices[i], currentAngle, i)) {
return false;
}
}
currentAngle += slices[i].angle;
}
return true;
function drawLabel(slice, startAngle, index) {
if (slice.data[0][1] === 0) {
return true;
}
// format label text
var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
if (lf) {
text = lf(slice.label, slice);
} else {
text = slice.label;
}
if (plf) {
text = plf(text, slice);
}
var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
target.append(html);
var label = target.children("#pieLabel" + index);
var labelTop = (y - label.height() / 2);
var labelLeft = (x - label.width() / 2);
label.css("top", labelTop);
label.css("left", labelLeft);
// check to make sure that the label is not outside the canvas
if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
return false;
}
if (options.series.pie.label.background.opacity !== 0) {
// put in the transparent background separately to avoid blended labels and label boxes
var c = options.series.pie.label.background.color;
if (c == null) {
c = slice.color;
}
var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
$("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
.css("opacity", options.series.pie.label.background.opacity)
.insertBefore(label);
}
return true;
} // end individual label function
} // end drawLabels function
} // end drawPie function
} // end draw function
// Placed here because it needs to be accessed from multiple locations
function drawDonutHole(layer) {
if (options.series.pie.innerRadius > 0) {
// subtract the center
layer.save();
var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
layer.beginPath();
layer.fillStyle = options.series.pie.stroke.color;
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
layer.fill();
layer.closePath();
layer.restore();
// add inner stroke
layer.save();
layer.beginPath();
layer.strokeStyle = options.series.pie.stroke.color;
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
layer.stroke();
layer.closePath();
layer.restore();
// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
}
}
//-- Additional Interactive related functions --
function isPointInPoly(poly, pt) {
for (var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) ||
(poly[j][1] <= pt[1] && pt[1] < poly[i][1])) &&
(pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) &&
(c = !c);
}
return c;
}
function findNearbySlice(mouseX, mouseY) {
var slices = plot.getData(),
options = plot.getOptions(),
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
x, y;
for (var i = 0; i < slices.length; ++i) {
var s = slices[i];
if (s.pie.show) {
ctx.save();
ctx.beginPath();
ctx.moveTo(0, 0); // Center of the pie
//ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
ctx.closePath();
x = mouseX - centerLeft;
y = mouseY - centerTop;
if (ctx.isPointInPath) {
if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
ctx.restore();
return {
datapoint: [s.percent, s.data],
dataIndex: 0,
series: s,
seriesIndex: i
};
}
} else {
// excanvas for IE doesn;t support isPointInPath, this is a workaround.
var p1X = radius * Math.cos(s.startAngle),
p1Y = radius * Math.sin(s.startAngle),
p2X = radius * Math.cos(s.startAngle + s.angle / 4),
p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
p3X = radius * Math.cos(s.startAngle + s.angle / 2),
p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
p5X = radius * Math.cos(s.startAngle + s.angle),
p5Y = radius * Math.sin(s.startAngle + s.angle),
arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
arrPoint = [x, y];
// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
if (isPointInPoly(arrPoly, arrPoint)) {
ctx.restore();
return {
datapoint: [s.percent, s.data],
dataIndex: 0,
series: s,
seriesIndex: i
};
}
}
ctx.restore();
}
}
return null;
}
function onMouseMove(e) {
triggerClickHoverEvent("plothover", e);
}
function onClick(e) {
triggerClickHoverEvent("plotclick", e);
}
// trigger click or hover event (they send the same parameters so we share their code)
function triggerClickHoverEvent(eventname, e) {
var offset = plot.offset();
var canvasX = parseInt(e.pageX - offset.left);
var canvasY = parseInt(e.pageY - offset.top);
var item = findNearbySlice(canvasX, canvasY);
if (options.grid.autoHighlight) {
// clear auto-highlights
for (var i = 0; i < highlights.length; ++i) {
var h = highlights[i];
if (h.auto === eventname && !(item && h.series === item.series)) {
unhighlight(h.series);
}
}
}
// highlight the slice
if (item) {
highlight(item.series, eventname);
}
// trigger any hover bind events
var pos = { pageX: e.pageX, pageY: e.pageY };
target.trigger(eventname, [pos, item]);
}
function highlight(s, auto) {
//if (typeof s == "number") {
// s = series[s];
//}
var i = indexOfHighlight(s);
if (i === -1) {
highlights.push({ series: s, auto: auto });
plot.triggerRedrawOverlay();
} else if (!auto) {
highlights[i].auto = false;
}
}
function unhighlight(s) {
if (s == null) {
highlights = [];
plot.triggerRedrawOverlay();
}
//if (typeof s == "number") {
// s = series[s];
//}
var i = indexOfHighlight(s);
if (i !== -1) {
highlights.splice(i, 1);
plot.triggerRedrawOverlay();
}
}
function indexOfHighlight(s) {
for (var i = 0; i < highlights.length; ++i) {
var h = highlights[i];
if (h.series === s) {
return i;
}
}
return -1;
}
function drawOverlay(plot, octx) {
var options = plot.getOptions();
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
octx.save();
octx.translate(centerLeft, centerTop);
octx.scale(1, options.series.pie.tilt);
for (var i = 0; i < highlights.length; ++i) {
drawHighlight(highlights[i].series);
}
drawDonutHole(octx);
octx.restore();
function drawHighlight(series) {
if (series.angle <= 0 || isNaN(series.angle)) {
return;
}
//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
octx.beginPath();
if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
octx.moveTo(0, 0); // Center of the pie
}
octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
octx.closePath();
octx.fill();
}
}
} // end init (plugin body)
// define pie specific options and their default values
var options = {
series: {
pie: {
show: false,
radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
innerRadius: 0, /* for donut */
startAngle: 3 / 2,
tilt: 1,
shadow: {
left: 5, // shadow left offset
top: 15, // shadow top offset
alpha: 0.02 // shadow alpha
},
offset: {
top: 0,
left: "auto"
},
stroke: {
color: "#fff",
width: 1
},
label: {
show: "auto",
formatter: function(label, slice) {
return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
}, // formatter function
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
background: {
color: null,
opacity: 0
},
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
},
combine: {
threshold: -1, // percentage at which to combine little slices into one larger slice
color: null, // color to give the new slice (auto-generated if null)
label: "Other" // label to give the new slice
},
highlight: {
//color: "#fff", // will add this functionality once parseColor is available
opacity: 0.5
}
}
}
};
$.plot.plugins.push({
init: init,
options: options,
name: "pie",
version: "1.1"
});
})(jQuery);

View File

@ -1,60 +0,0 @@
/* eslint-disable */
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
It works by listening for changes on the placeholder div (through the jQuery
resize event plugin) - if the size changes, it will redraw the plot.
There are no options. If you need to disable the plugin for some plots, you
can just fix the size of their placeholders.
*/
/* Inline dependency:
* jQuery resize event - v1.1 - 3/14/2010
* http://benalman.com/projects/jquery-resize-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,e,t){"$:nomunge";var i=[],n=$.resize=$.extend($.resize,{}),a,r=false,s="setTimeout",u="resize",m=u+"-special-event",o="pendingDelay",l="activeDelay",f="throttleWindow";n[o]=200;n[l]=20;n[f]=true;$.event.special[u]={setup:function(){if(!n[f]&&this[s]){return false}var e=$(this);i.push(this);e.data(m,{w:e.width(),h:e.height()});if(i.length===1){a=t;h()}},teardown:function(){if(!n[f]&&this[s]){return false}var e=$(this);for(var t=i.length-1;t>=0;t--){if(i[t]==this){i.splice(t,1);break}}e.removeData(m);if(!i.length){if(r){cancelAnimationFrame(a)}else{clearTimeout(a)}a=null}},add:function(e){if(!n[f]&&this[s]){return false}var i;function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s.h=a!==t?a:r.height();i.apply(this,arguments)}if($.isFunction(e)){i=e;return a}else{i=e.handler;e.handler=a}}};function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$(i[s]);if(l[0]==e||l.is(":visible")){var f=l.width(),c=l.height(),d=l.data(m);if(d&&(f!==d.w||c!==d.h)){l.trigger(u,[d.w=f,d.h=c]);r=t||true}}else{d=l.data(m);d.w=0;d.h=0}}if(a!==null){if(r&&(t==null||t-r<1e3)){a=e.requestAnimationFrame(h)}else{a=setTimeout(h,n[o]);r=false}}}if(!e.requestAnimationFrame){e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},n[l])}}()}if(!e.cancelAnimationFrame){e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}()}})(jQuery,this);
/* eslint-enable */
(function ($) {
var options = { }; // no options
function init(plot) {
function onResize() {
var placeholder = plot.getPlaceholder();
// somebody might have hidden us and we can't plot
// when we don't have the dimensions
if (placeholder.width() === 0 || placeholder.height() === 0) return;
plot.resize();
plot.setupGrid();
plot.draw();
}
function bindEvents(plot, eventHolder) {
plot.getPlaceholder().resize(onResize);
}
function shutdown(plot, eventHolder) {
plot.getPlaceholder().unbind("resize", onResize);
}
plot.hooks.bindEvents.push(bindEvents);
plot.hooks.shutdown.push(shutdown);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'resize',
version: '1.0'
});
})(jQuery);

View File

@ -1,43 +0,0 @@
(function ($) {
'use strict';
var saturated = {
saturate: function (a) {
if (a === Infinity) {
return Number.MAX_VALUE;
}
if (a === -Infinity) {
return -Number.MAX_VALUE;
}
return a;
},
delta: function(min, max, noTicks) {
return ((max - min) / noTicks) === Infinity ? (max / noTicks - min / noTicks) : (max - min) / noTicks
},
multiply: function (a, b) {
return saturated.saturate(a * b);
},
// returns c * bInt * a. Beahves properly in the case where c is negative
// and bInt * a is bigger that Number.MAX_VALUE (Infinity)
multiplyAdd: function (a, bInt, c) {
if (isFinite(a * bInt)) {
return saturated.saturate(a * bInt + c);
} else {
var result = c;
for (var i = 0; i < bInt; i++) {
result += a;
}
return saturated.saturate(result);
}
},
// round to nearby lower multiple of base
floorInBase: function(n, base) {
return base * Math.floor(n / base);
}
};
$.plot.saturated = saturated;
})(jQuery);

View File

@ -1,504 +0,0 @@
/* Flot plugin for selecting regions of a plot.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
selection: {
mode: null or "x" or "y" or "xy" or "smart",
color: color,
shape: "round" or "miter" or "bevel",
minSize: number of pixels
}
Selection support is enabled by setting the mode to one of "x", "y" or "xy".
In "x" mode, the user will only be able to specify the x range, similarly for
"y" mode. For "xy", the selection becomes a rectangle where both ranges can be
specified. "color" is color of the selection (if you need to change the color
later on, you can get to it with plot.getOptions().selection.color). "shape"
is the shape of the corners of the selection.
"minSize" is the minimum size a selection can be in pixels. This value can
be customized to determine the smallest size a selection can be and still
have the selection rectangle be displayed. When customizing this value, the
fact that it refers to pixels, not axis units must be taken into account.
Thus, for example, if there is a bar graph in time mode with BarWidth set to 1
minute, setting "minSize" to 1 will not make the minimum selection size 1
minute, but rather 1 pixel. Note also that setting "minSize" to 0 will prevent
"plotunselected" events from being fired when the user clicks the mouse without
dragging.
When selection support is enabled, a "plotselected" event will be emitted on
the DOM element you passed into the plot function. The event handler gets a
parameter with the ranges selected on the axes, like this:
placeholder.bind( "plotselected", function( event, ranges ) {
alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to)
// similar for yaxis - with multiple axes, the extra ones are in
// x2axis, x3axis, ...
});
The "plotselected" event is only fired when the user has finished making the
selection. A "plotselecting" event is fired during the process with the same
parameters as the "plotselected" event, in case you want to know what's
happening while it's happening,
A "plotunselected" event with no arguments is emitted when the user clicks the
mouse to remove the selection. As stated above, setting "minSize" to 0 will
destroy this behavior.
The plugin allso adds the following methods to the plot object:
- setSelection( ranges, preventEvent )
Set the selection rectangle. The passed in ranges is on the same form as
returned in the "plotselected" event. If the selection mode is "x", you
should put in either an xaxis range, if the mode is "y" you need to put in
an yaxis range and both xaxis and yaxis if the selection mode is "xy", like
this:
setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });
setSelection will trigger the "plotselected" event when called. If you don't
want that to happen, e.g. if you're inside a "plotselected" handler, pass
true as the second parameter. If you are using multiple axes, you can
specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of
xaxis, the plugin picks the first one it sees.
- clearSelection( preventEvent )
Clear the selection rectangle. Pass in true to avoid getting a
"plotunselected" event.
- getSelection()
Returns the current selection in the same format as the "plotselected"
event. If there's currently no selection, the function returns null.
*/
(function ($) {
function init(plot) {
var selection = {
first: {x: -1, y: -1},
second: {x: -1, y: -1},
show: false,
currentMode: 'xy',
active: false
};
var SNAPPING_CONSTANT = $.plot.uiConstants.SNAPPING_CONSTANT;
// FIXME: The drag handling implemented here should be
// abstracted out, there's some similar code from a library in
// the navigation plugin, this should be massaged a bit to fit
// the Flot cases here better and reused. Doing this would
// make this plugin much slimmer.
var savedhandlers = {};
var mouseUpHandler = null;
function onMouseMove(e) {
if (selection.active) {
updateSelection(e);
plot.getPlaceholder().trigger("plotselecting", [ getSelection() ]);
}
}
function onMouseDown(e) {
// only accept left-click
if (e.which !== 1) return;
// cancel out any text selections
document.body.focus();
// prevent text selection and drag in old-school browsers
if (document.onselectstart !== undefined && savedhandlers.onselectstart == null) {
savedhandlers.onselectstart = document.onselectstart;
document.onselectstart = function () { return false; };
}
if (document.ondrag !== undefined && savedhandlers.ondrag == null) {
savedhandlers.ondrag = document.ondrag;
document.ondrag = function () { return false; };
}
setSelectionPos(selection.first, e);
selection.active = true;
// this is a bit silly, but we have to use a closure to be
// able to whack the same handler again
mouseUpHandler = function (e) { onMouseUp(e); };
$(document).one("mouseup", mouseUpHandler);
}
function onMouseUp(e) {
mouseUpHandler = null;
// revert drag stuff for old-school browsers
if (document.onselectstart !== undefined) {
document.onselectstart = savedhandlers.onselectstart;
}
if (document.ondrag !== undefined) {
document.ondrag = savedhandlers.ondrag;
}
// no more dragging
selection.active = false;
updateSelection(e);
if (selectionIsSane()) {
triggerSelectedEvent();
} else {
// this counts as a clear
plot.getPlaceholder().trigger("plotunselected", [ ]);
plot.getPlaceholder().trigger("plotselecting", [ null ]);
}
return false;
}
function getSelection() {
if (!selectionIsSane()) return null;
if (!selection.show) return null;
var r = {},
c1 = {x: selection.first.x, y: selection.first.y},
c2 = {x: selection.second.x, y: selection.second.y};
if (selectionDirection(plot) === 'x') {
c1.y = 0;
c2.y = plot.height();
}
if (selectionDirection(plot) === 'y') {
c1.x = 0;
c2.x = plot.width();
}
$.each(plot.getAxes(), function (name, axis) {
if (axis.used) {
var p1 = axis.c2p(c1[axis.direction]), p2 = axis.c2p(c2[axis.direction]);
r[name] = { from: Math.min(p1, p2), to: Math.max(p1, p2) };
}
});
return r;
}
function triggerSelectedEvent() {
var r = getSelection();
plot.getPlaceholder().trigger("plotselected", [ r ]);
// backwards-compat stuff, to be removed in future
if (r.xaxis && r.yaxis) {
plot.getPlaceholder().trigger("selected", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]);
}
}
function clamp(min, value, max) {
return value < min ? min : (value > max ? max : value);
}
function selectionDirection(plot) {
var o = plot.getOptions();
if (o.selection.mode === 'smart') {
return selection.currentMode;
} else {
return o.selection.mode;
}
}
function updateMode(pos) {
if (selection.first) {
var delta = {
x: pos.x - selection.first.x,
y: pos.y - selection.first.y
};
if (Math.abs(delta.x) < SNAPPING_CONSTANT) {
selection.currentMode = 'y';
} else if (Math.abs(delta.y) < SNAPPING_CONSTANT) {
selection.currentMode = 'x';
} else {
selection.currentMode = 'xy';
}
}
}
function setSelectionPos(pos, e) {
var offset = plot.getPlaceholder().offset();
var plotOffset = plot.getPlotOffset();
pos.x = clamp(0, e.pageX - offset.left - plotOffset.left, plot.width());
pos.y = clamp(0, e.pageY - offset.top - plotOffset.top, plot.height());
if (pos !== selection.first) updateMode(pos);
if (selectionDirection(plot) === "y") {
pos.x = pos === selection.first ? 0 : plot.width();
}
if (selectionDirection(plot) === "x") {
pos.y = pos === selection.first ? 0 : plot.height();
}
}
function updateSelection(pos) {
if (pos.pageX == null) return;
setSelectionPos(selection.second, pos);
if (selectionIsSane()) {
selection.show = true;
plot.triggerRedrawOverlay();
} else clearSelection(true);
}
function clearSelection(preventEvent) {
if (selection.show) {
selection.show = false;
selection.currentMode = '';
plot.triggerRedrawOverlay();
if (!preventEvent) {
plot.getPlaceholder().trigger("plotunselected", [ ]);
}
}
}
// function taken from markings support in Flot
function extractRange(ranges, coord) {
var axis, from, to, key, axes = plot.getAxes();
for (var k in axes) {
axis = axes[k];
if (axis.direction === coord) {
key = coord + axis.n + "axis";
if (!ranges[key] && axis.n === 1) {
// support x1axis as xaxis
key = coord + "axis";
}
if (ranges[key]) {
from = ranges[key].from;
to = ranges[key].to;
break;
}
}
}
// backwards-compat stuff - to be removed in future
if (!ranges[key]) {
axis = coord === "x" ? plot.getXAxes()[0] : plot.getYAxes()[0];
from = ranges[coord + "1"];
to = ranges[coord + "2"];
}
// auto-reverse as an added bonus
if (from != null && to != null && from > to) {
var tmp = from;
from = to;
to = tmp;
}
return { from: from, to: to, axis: axis };
}
function setSelection(ranges, preventEvent) {
var range;
if (selectionDirection(plot) === "y") {
selection.first.x = 0;
selection.second.x = plot.width();
} else {
range = extractRange(ranges, "x");
selection.first.x = range.axis.p2c(range.from);
selection.second.x = range.axis.p2c(range.to);
}
if (selectionDirection(plot) === "x") {
selection.first.y = 0;
selection.second.y = plot.height();
} else {
range = extractRange(ranges, "y");
selection.first.y = range.axis.p2c(range.from);
selection.second.y = range.axis.p2c(range.to);
}
selection.show = true;
plot.triggerRedrawOverlay();
if (!preventEvent && selectionIsSane()) {
triggerSelectedEvent();
}
}
function selectionIsSane() {
var minSize = plot.getOptions().selection.minSize;
return Math.abs(selection.second.x - selection.first.x) >= minSize &&
Math.abs(selection.second.y - selection.first.y) >= minSize;
}
plot.clearSelection = clearSelection;
plot.setSelection = setSelection;
plot.getSelection = getSelection;
plot.hooks.bindEvents.push(function(plot, eventHolder) {
var o = plot.getOptions();
if (o.selection.mode != null) {
eventHolder.mousemove(onMouseMove);
eventHolder.mousedown(onMouseDown);
}
});
function drawSelectionDecorations(ctx, x, y, w, h, oX, oY, mode) {
var spacing = 3;
var fullEarWidth = 15;
var earWidth = Math.max(0, Math.min(fullEarWidth, w / 2 - 2, h / 2 - 2));
ctx.fillStyle = '#ffffff';
if (mode === 'xy') {
ctx.beginPath();
ctx.moveTo(x, y + earWidth);
ctx.lineTo(x - 3, y + earWidth);
ctx.lineTo(x - 3, y - 3);
ctx.lineTo(x + earWidth, y - 3);
ctx.lineTo(x + earWidth, y);
ctx.lineTo(x, y);
ctx.closePath();
ctx.moveTo(x, y + h - earWidth);
ctx.lineTo(x - 3, y + h - earWidth);
ctx.lineTo(x - 3, y + h + 3);
ctx.lineTo(x + earWidth, y + h + 3);
ctx.lineTo(x + earWidth, y + h);
ctx.lineTo(x, y + h);
ctx.closePath();
ctx.moveTo(x + w, y + earWidth);
ctx.lineTo(x + w + 3, y + earWidth);
ctx.lineTo(x + w + 3, y - 3);
ctx.lineTo(x + w - earWidth, y - 3);
ctx.lineTo(x + w - earWidth, y);
ctx.lineTo(x + w, y);
ctx.closePath();
ctx.moveTo(x + w, y + h - earWidth);
ctx.lineTo(x + w + 3, y + h - earWidth);
ctx.lineTo(x + w + 3, y + h + 3);
ctx.lineTo(x + w - earWidth, y + h + 3);
ctx.lineTo(x + w - earWidth, y + h);
ctx.lineTo(x + w, y + h);
ctx.closePath();
ctx.stroke();
ctx.fill();
}
x = oX;
y = oY;
if (mode === 'x') {
ctx.beginPath();
ctx.moveTo(x, y + fullEarWidth);
ctx.lineTo(x, y - fullEarWidth);
ctx.lineTo(x - spacing, y - fullEarWidth);
ctx.lineTo(x - spacing, y + fullEarWidth);
ctx.closePath();
ctx.moveTo(x + w, y + fullEarWidth);
ctx.lineTo(x + w, y - fullEarWidth);
ctx.lineTo(x + w + spacing, y - fullEarWidth);
ctx.lineTo(x + w + spacing, y + fullEarWidth);
ctx.closePath();
ctx.stroke();
ctx.fill();
}
if (mode === 'y') {
ctx.beginPath();
ctx.moveTo(x - fullEarWidth, y);
ctx.lineTo(x + fullEarWidth, y);
ctx.lineTo(x + fullEarWidth, y - spacing);
ctx.lineTo(x - fullEarWidth, y - spacing);
ctx.closePath();
ctx.moveTo(x - fullEarWidth, y + h);
ctx.lineTo(x + fullEarWidth, y + h);
ctx.lineTo(x + fullEarWidth, y + h + spacing);
ctx.lineTo(x - fullEarWidth, y + h + spacing);
ctx.closePath();
ctx.stroke();
ctx.fill();
}
}
plot.hooks.drawOverlay.push(function (plot, ctx) {
// draw selection
if (selection.show && selectionIsSane()) {
var plotOffset = plot.getPlotOffset();
var o = plot.getOptions();
ctx.save();
ctx.translate(plotOffset.left, plotOffset.top);
var c = $.color.parse(o.selection.color);
ctx.strokeStyle = c.scale('a', 1).toString();
ctx.lineWidth = 1;
ctx.lineJoin = o.selection.shape;
ctx.fillStyle = c.scale('a', 0.4).toString();
var x = Math.min(selection.first.x, selection.second.x) + 0.5,
oX = x,
y = Math.min(selection.first.y, selection.second.y) + 0.5,
oY = y,
w = Math.abs(selection.second.x - selection.first.x) - 1,
h = Math.abs(selection.second.y - selection.first.y) - 1;
if (selectionDirection(plot) === 'x') {
h += y;
y = 0;
}
if (selectionDirection(plot) === 'y') {
w += x;
x = 0;
}
ctx.fillRect(0, 0, plot.width(), plot.height());
ctx.clearRect(x, y, w, h);
drawSelectionDecorations(ctx, x, y, w, h, oX, oY, selectionDirection(plot));
ctx.restore();
}
});
plot.hooks.shutdown.push(function (plot, eventHolder) {
eventHolder.unbind("mousemove", onMouseMove);
eventHolder.unbind("mousedown", onMouseDown);
if (mouseUpHandler) {
$(document).unbind("mouseup", mouseUpHandler);
}
});
}
$.plot.plugins.push({
init: init,
options: {
selection: {
mode: null, // one of null, "x", "y" or "xy"
color: "#888888",
shape: "round", // one of "round", "miter", or "bevel"
minSize: 5 // minimum number of pixels
}
},
name: 'selection',
version: '1.1'
});
})(jQuery);

View File

@ -1,220 +0,0 @@
/* Flot plugin for stacking data sets rather than overlaying them.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin assumes the data is sorted on x (or y if stacking horizontally).
For line charts, it is assumed that if a line has an undefined gap (from a
null point), then the line above it should have the same gap - insert zeros
instead of "null" if you want another behaviour. This also holds for the start
and end of the chart. Note that stacking a mix of positive and negative values
in most instances doesn't make sense (so it looks weird).
Two or more series are stacked when their "stack" attribute is set to the same
key (which can be any number or string or just "true"). To specify the default
stack, you can set the stack option like this:
series: {
stack: null/false, true, or a key (number/string)
}
You can also specify it for a single series, like this:
$.plot( $("#placeholder"), [{
data: [ ... ],
stack: true
}])
The stacking order is determined by the order of the data series in the array
(later series end up on top of the previous).
Internally, the plugin modifies the datapoints in each series, adding an
offset to the y value. For line series, extra data points are inserted through
interpolation. If there's a second y value, it's also adjusted (e.g for bar
charts or filled areas).
*/
(function ($) {
var options = {
series: { stack: null } // or number/string
};
function init(plot) {
function findMatchingSeries(s, allseries) {
var res = null;
for (var i = 0; i < allseries.length; ++i) {
if (s === allseries[i]) break;
if (allseries[i].stack === s.stack) {
res = allseries[i];
}
}
return res;
}
function addBottomPoints (s, datapoints) {
var formattedPoints = [];
for (var i = 0; i < datapoints.points.length; i += 2) {
formattedPoints.push(datapoints.points[i]);
formattedPoints.push(datapoints.points[i + 1]);
formattedPoints.push(0);
}
datapoints.format.push({
x: false,
y: true,
number: true,
required: false,
computeRange: s.yaxis.options.autoScale !== 'none',
defaultValue: 0
});
datapoints.points = formattedPoints;
datapoints.pointsize = 3;
}
function stackData(plot, s, datapoints) {
if (s.stack == null || s.stack === false) return;
var needsBottom = s.bars.show || (s.lines.show && s.lines.fill);
var hasBottom = datapoints.pointsize > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y);
// Series data is missing bottom points - need to format
if (needsBottom && !hasBottom) {
addBottomPoints(s, datapoints);
}
var other = findMatchingSeries(s, plot.getData());
if (!other) return;
var ps = datapoints.pointsize,
points = datapoints.points,
otherps = other.datapoints.pointsize,
otherpoints = other.datapoints.points,
newpoints = [],
px, py, intery, qx, qy, bottom,
withlines = s.lines.show,
horizontal = s.bars.horizontal,
withsteps = withlines && s.lines.steps,
fromgap = true,
keyOffset = horizontal ? 1 : 0,
accumulateOffset = horizontal ? 0 : 1,
i = 0, j = 0, l, m;
while (true) {
if (i >= points.length) break;
l = newpoints.length;
if (points[i] == null) {
// copy gaps
for (m = 0; m < ps; ++m) {
newpoints.push(points[i + m]);
}
i += ps;
} else if (j >= otherpoints.length) {
// for lines, we can't use the rest of the points
if (!withlines) {
for (m = 0; m < ps; ++m) {
newpoints.push(points[i + m]);
}
}
i += ps;
} else if (otherpoints[j] == null) {
// oops, got a gap
for (m = 0; m < ps; ++m) {
newpoints.push(null);
}
fromgap = true;
j += otherps;
} else {
// cases where we actually got two points
px = points[i + keyOffset];
py = points[i + accumulateOffset];
qx = otherpoints[j + keyOffset];
qy = otherpoints[j + accumulateOffset];
bottom = 0;
if (px === qx) {
for (m = 0; m < ps; ++m) {
newpoints.push(points[i + m]);
}
newpoints[l + accumulateOffset] += qy;
bottom = qy;
i += ps;
j += otherps;
} else if (px > qx) {
// we got past point below, might need to
// insert interpolated extra point
if (withlines && i > 0 && points[i - ps] != null) {
intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);
newpoints.push(qx);
newpoints.push(intery + qy);
for (m = 2; m < ps; ++m) {
newpoints.push(points[i + m]);
}
bottom = qy;
}
j += otherps;
} else { // px < qx
if (fromgap && withlines) {
// if we come from a gap, we just skip this point
i += ps;
continue;
}
for (m = 0; m < ps; ++m) {
newpoints.push(points[i + m]);
}
// we might be able to interpolate a point below,
// this can give us a better y
if (withlines && j > 0 && otherpoints[j - otherps] != null) {
bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);
}
newpoints[l + accumulateOffset] += bottom;
i += ps;
}
fromgap = false;
if (l !== newpoints.length && needsBottom) {
newpoints[l + 2] += bottom;
}
}
// maintain the line steps invariant
if (withsteps && l !== newpoints.length && l > 0 &&
newpoints[l] !== null &&
newpoints[l] !== newpoints[l - ps] &&
newpoints[l + 1] !== newpoints[l - ps + 1]) {
for (m = 0; m < ps; ++m) {
newpoints[l + ps + m] = newpoints[l + m];
}
newpoints[l + 1] = newpoints[l - ps + 1];
}
}
datapoints.points = newpoints;
}
plot.hooks.processDatapoints.push(stackData);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'stack',
version: '1.2'
});
})(jQuery);

View File

@ -1,98 +0,0 @@
/* Flot plugin that adds some extra symbols for plotting points.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The symbols are accessed as strings through the standard symbol options:
series: {
points: {
symbol: "square" // or "diamond", "triangle", "cross", "plus", "ellipse", "rectangle"
}
}
*/
(function ($) {
// we normalize the area of each symbol so it is approximately the
// same as a circle of the given radius
var square = function (ctx, x, y, radius, shadow) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2;
ctx.rect(x - size, y - size, size + size, size + size);
},
rectangle = function (ctx, x, y, radius, shadow) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2;
ctx.rect(x - size, y - size, size + size, size + size);
},
diamond = function (ctx, x, y, radius, shadow) {
// pi * r^2 = 2s^2 => s = r * sqrt(pi/2)
var size = radius * Math.sqrt(Math.PI / 2);
ctx.moveTo(x - size, y);
ctx.lineTo(x, y - size);
ctx.lineTo(x + size, y);
ctx.lineTo(x, y + size);
ctx.lineTo(x - size, y);
ctx.lineTo(x, y - size);
},
triangle = function (ctx, x, y, radius, shadow) {
// pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3))
var size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3));
var height = size * Math.sin(Math.PI / 3);
ctx.moveTo(x - size / 2, y + height / 2);
ctx.lineTo(x + size / 2, y + height / 2);
if (!shadow) {
ctx.lineTo(x, y - height / 2);
ctx.lineTo(x - size / 2, y + height / 2);
ctx.lineTo(x + size / 2, y + height / 2);
}
},
cross = function (ctx, x, y, radius, shadow) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2;
ctx.moveTo(x - size, y - size);
ctx.lineTo(x + size, y + size);
ctx.moveTo(x - size, y + size);
ctx.lineTo(x + size, y - size);
},
ellipse = function(ctx, x, y, radius, shadow, fill) {
if (!shadow) {
ctx.moveTo(x + radius, y);
ctx.arc(x, y, radius, 0, Math.PI * 2, false);
}
},
plus = function (ctx, x, y, radius, shadow) {
var size = radius * Math.sqrt(Math.PI / 2);
ctx.moveTo(x - size, y);
ctx.lineTo(x + size, y);
ctx.moveTo(x, y + size);
ctx.lineTo(x, y - size);
},
handlers = {
square: square,
rectangle: rectangle,
diamond: diamond,
triangle: triangle,
cross: cross,
ellipse: ellipse,
plus: plus
};
square.fill = true;
rectangle.fill = true;
diamond.fill = true;
triangle.fill = true;
ellipse.fill = true;
function init(plot) {
plot.drawSymbol = handlers;
}
$.plot.plugins.push({
init: init,
name: 'symbols',
version: '1.0'
});
})(jQuery);

View File

@ -1,143 +0,0 @@
/* Flot plugin for thresholding data.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin supports these options:
series: {
threshold: {
below: number
color: colorspec
}
}
It can also be applied to a single series, like this:
$.plot( $("#placeholder"), [{
data: [ ... ],
threshold: { ... }
}])
An array can be passed for multiple thresholding, like this:
threshold: [{
below: number1
color: color1
},{
below: number2
color: color2
}]
These multiple threshold objects can be passed in any order since they are
sorted by the processing function.
The data points below "below" are drawn with the specified color. This makes
it easy to mark points below 0, e.g. for budget data.
Internally, the plugin works by splitting the data into two series, above and
below the threshold. The extra series below the threshold will have its label
cleared and the special "originSeries" attribute set to the original series.
You may need to check for this in hover events.
*/
(function ($) {
var options = {
series: { threshold: null } // or { below: number, color: color spec}
};
function init(plot) {
function thresholdData(plot, s, datapoints, below, color) {
var ps = datapoints.pointsize, i, x, y, p, prevp,
thresholded = $.extend({}, s); // note: shallow copy
thresholded.datapoints = { points: [], pointsize: ps, format: datapoints.format };
thresholded.label = null;
thresholded.color = color;
thresholded.threshold = null;
thresholded.originSeries = s;
thresholded.data = [];
var origpoints = datapoints.points,
addCrossingPoints = s.lines.show;
var threspoints = [];
var newpoints = [];
var m;
for (i = 0; i < origpoints.length; i += ps) {
x = origpoints[i];
y = origpoints[i + 1];
prevp = p;
if (y < below) p = threspoints;
else p = newpoints;
if (addCrossingPoints && prevp !== p &&
x !== null && i > 0 &&
origpoints[i - ps] != null) {
var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]);
prevp.push(interx);
prevp.push(below);
for (m = 2; m < ps; ++m) {
prevp.push(origpoints[i + m]);
}
p.push(null); // start new segment
p.push(null);
for (m = 2; m < ps; ++m) {
p.push(origpoints[i + m]);
}
p.push(interx);
p.push(below);
for (m = 2; m < ps; ++m) {
p.push(origpoints[i + m]);
}
}
p.push(x);
p.push(y);
for (m = 2; m < ps; ++m) {
p.push(origpoints[i + m]);
}
}
datapoints.points = newpoints;
thresholded.datapoints.points = threspoints;
if (thresholded.datapoints.points.length > 0) {
var origIndex = $.inArray(s, plot.getData());
// Insert newly-generated series right after original one (to prevent it from becoming top-most)
plot.getData().splice(origIndex + 1, 0, thresholded);
}
// FIXME: there are probably some edge cases left in bars
}
function processThresholds(plot, s, datapoints) {
if (!s.threshold) return;
if (s.threshold instanceof Array) {
s.threshold.sort(function(a, b) {
return a.below - b.below;
});
$(s.threshold).each(function(i, th) {
thresholdData(plot, s, datapoints, th.below, th.color);
});
} else {
thresholdData(plot, s, datapoints, s.threshold.below, s.threshold.color);
}
}
plot.hooks.processDatapoints.push(processThresholds);
}
$.plot.plugins.push({
init: init,
options: options,
name: 'threshold',
version: '1.2'
});
})(jQuery);

View File

@ -1,460 +0,0 @@
/* Pretty handling of time axes.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
Set axis.mode to "time" to enable. See the section "Time series data" in
API.txt for details.
*/
(function($) {
'use strict';
var options = {
xaxis: {
timezone: null, // "browser" for local to the client or timezone for timezone-js
timeformat: null, // format string to use
twelveHourClock: false, // 12 or 24 time in time mode
monthNames: null, // list of names of months
timeBase: 'seconds' // are the values in milliseconds or seconds
},
yaxis: {
timeBase: 'seconds'
}
};
var floorInBase = $.plot.saturated.floorInBase;
// Returns a string with the date d formatted according to fmt.
// A subset of the Open Group's strftime format is supported.
function formatDate(d, fmt, monthNames, dayNames) {
if (typeof d.strftime === "function") {
return d.strftime(fmt);
}
var leftPad = function(n, pad) {
n = "" + n;
pad = "" + (pad == null ? "0" : pad);
return n.length == 1 ? pad + n : n;
};
var r = [];
var escape = false;
var hours = d.getHours();
var isAM = hours < 12;
if (!monthNames) {
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
}
if (!dayNames) {
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
}
var hours12;
if (hours > 12) {
hours12 = hours - 12;
} else if (hours == 0) {
hours12 = 12;
} else {
hours12 = hours;
}
for (var i = 0; i < fmt.length; ++i) {
var c = fmt.charAt(i);
if (escape) {
switch (c) {
case 'a': c = "" + dayNames[d.getDay()]; break;
case 'b': c = "" + monthNames[d.getMonth()]; break;
case 'd': c = leftPad(d.getDate()); break;
case 'e': c = leftPad(d.getDate(), " "); break;
case 'h': // For back-compat with 0.7; remove in 1.0
case 'H': c = leftPad(hours); break;
case 'I': c = leftPad(hours12); break;
case 'l': c = leftPad(hours12, " "); break;
case 'm': c = leftPad(d.getMonth() + 1); break;
case 'M': c = leftPad(d.getMinutes()); break;
// quarters not in Open Group's strftime specification
case 'q':
c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
case 'S': c = leftPad(d.getSeconds()); break;
case 'y': c = leftPad(d.getFullYear() % 100); break;
case 'Y': c = "" + d.getFullYear(); break;
case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
case 'w': c = "" + d.getDay(); break;
}
r.push(c);
escape = false;
} else {
if (c == "%") {
escape = true;
} else {
r.push(c);
}
}
}
return r.join("");
}
// To have a consistent view of time-based data independent of which time
// zone the client happens to be in we need a date-like object independent
// of time zones. This is done through a wrapper that only calls the UTC
// versions of the accessor methods.
function makeUtcWrapper(d) {
function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
sourceObj[sourceMethod] = function() {
return targetObj[targetMethod].apply(targetObj, arguments);
};
}
var utc = {
date: d
};
// support strftime, if found
if (d.strftime !== undefined) {
addProxyMethod(utc, "strftime", d, "strftime");
}
addProxyMethod(utc, "getTime", d, "getTime");
addProxyMethod(utc, "setTime", d, "setTime");
var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];
for (var p = 0; p < props.length; p++) {
addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
}
return utc;
}
// select time zone strategy. This returns a date-like object tied to the
// desired timezone
function dateGenerator(ts, opts) {
var maxDateValue = 8640000000000000;
if (opts && opts.timeBase === 'seconds') {
ts *= 1000;
}
if (ts > maxDateValue) {
ts = maxDateValue;
} else if (ts < -maxDateValue) {
ts = -maxDateValue;
}
if (opts.timezone === "browser") {
return new Date(ts);
} else if (!opts.timezone || opts.timezone === "utc") {
return makeUtcWrapper(new Date(ts));
} else if (typeof timezoneJS !== "undefined" && typeof timezoneJS.Date !== "undefined") {
var d = new timezoneJS.Date();
// timezone-js is fickle, so be sure to set the time zone before
// setting the time.
d.setTimezone(opts.timezone);
d.setTime(ts);
return d;
} else {
return makeUtcWrapper(new Date(ts));
}
}
// map of app. size of time units in milliseconds
var timeUnitSizeSeconds = {
"millisecond": 0.001,
"second": 1,
"minute": 60,
"hour": 60 * 60,
"day": 24 * 60 * 60,
"month": 30 * 24 * 60 * 60,
"quarter": 3 * 30 * 24 * 60 * 60,
"year": 365.2425 * 24 * 60 * 60
};
var timeUnitSizeMilliseconds = {
"millisecond": 1,
"second": 1000,
"minute": 60 * 1000,
"hour": 60 * 60 * 1000,
"day": 24 * 60 * 60 * 1000,
"month": 30 * 24 * 60 * 60 * 1000,
"quarter": 3 * 30 * 24 * 60 * 60 * 1000,
"year": 365.2425 * 24 * 60 * 60 * 1000
};
// the allowed tick sizes, after 1 year we use
// an integer algorithm
var baseSpec = [
[1, "millisecond"], [2, "millisecond"], [5, "millisecond"], [10, "millisecond"],
[25, "millisecond"], [50, "millisecond"], [100, "millisecond"], [250, "millisecond"], [500, "millisecond"],
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
[30, "second"],
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
[30, "minute"],
[1, "hour"], [2, "hour"], [4, "hour"],
[8, "hour"], [12, "hour"],
[1, "day"], [2, "day"], [3, "day"],
[0.25, "month"], [0.5, "month"], [1, "month"],
[2, "month"]
];
// we don't know which variant(s) we'll need yet, but generating both is
// cheap
var specMonths = baseSpec.concat([[3, "month"], [6, "month"],
[1, "year"]]);
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"],
[1, "year"]]);
function dateTickGenerator(axis) {
var opts = axis.options,
ticks = [],
d = dateGenerator(axis.min, opts),
minSize = 0;
// make quarter use a possibility if quarters are
// mentioned in either of these options
var spec = (opts.tickSize && opts.tickSize[1] ===
"quarter") ||
(opts.minTickSize && opts.minTickSize[1] ===
"quarter") ? specQuarters : specMonths;
var timeUnitSize = opts.timeBase === 'seconds' ? timeUnitSizeSeconds : timeUnitSizeMilliseconds;
if (opts.minTickSize !== null && opts.minTickSize !== undefined) {
if (typeof opts.tickSize === "number") {
minSize = opts.tickSize;
} else {
minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
}
}
for (var i = 0; i < spec.length - 1; ++i) {
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]] +
spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2 &&
spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
break;
}
}
var size = spec[i][0];
var unit = spec[i][1];
// special-case the possibility of several years
if (unit === "year") {
// if given a minTickSize in years, just use it,
// ensuring that it's an integer
if (opts.minTickSize !== null && opts.minTickSize !== undefined && opts.minTickSize[1] === "year") {
size = Math.floor(opts.minTickSize[0]);
} else {
var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));
var norm = (axis.delta / timeUnitSize.year) / magn;
if (norm < 1.5) {
size = 1;
} else if (norm < 3) {
size = 2;
} else if (norm < 7.5) {
size = 5;
} else {
size = 10;
}
size *= magn;
}
// minimum size for years is 1
if (size < 1) {
size = 1;
}
}
axis.tickSize = opts.tickSize || [size, unit];
var tickSize = axis.tickSize[0];
unit = axis.tickSize[1];
var step = tickSize * timeUnitSize[unit];
if (unit === "millisecond") {
d.setMilliseconds(floorInBase(d.getMilliseconds(), tickSize));
} else if (unit === "second") {
d.setSeconds(floorInBase(d.getSeconds(), tickSize));
} else if (unit === "minute") {
d.setMinutes(floorInBase(d.getMinutes(), tickSize));
} else if (unit === "hour") {
d.setHours(floorInBase(d.getHours(), tickSize));
} else if (unit === "month") {
d.setMonth(floorInBase(d.getMonth(), tickSize));
} else if (unit === "quarter") {
d.setMonth(3 * floorInBase(d.getMonth() / 3,
tickSize));
} else if (unit === "year") {
d.setFullYear(floorInBase(d.getFullYear(), tickSize));
}
// reset smaller components
if (step >= timeUnitSize.second) {
d.setMilliseconds(0);
}
if (step >= timeUnitSize.minute) {
d.setSeconds(0);
}
if (step >= timeUnitSize.hour) {
d.setMinutes(0);
}
if (step >= timeUnitSize.day) {
d.setHours(0);
}
if (step >= timeUnitSize.day * 4) {
d.setDate(1);
}
if (step >= timeUnitSize.month * 2) {
d.setMonth(floorInBase(d.getMonth(), 3));
}
if (step >= timeUnitSize.quarter * 2) {
d.setMonth(floorInBase(d.getMonth(), 6));
}
if (step >= timeUnitSize.year) {
d.setMonth(0);
}
var carry = 0;
var v = Number.NaN;
var v1000;
var prev;
do {
prev = v;
v1000 = d.getTime();
if (opts && opts.timeBase === 'seconds') {
v = v1000 / 1000;
} else {
v = v1000;
}
ticks.push(v);
if (unit === "month" || unit === "quarter") {
if (tickSize < 1) {
// a bit complicated - we'll divide the
// month/quarter up but we need to take
// care of fractions so we don't end up in
// the middle of a day
d.setDate(1);
var start = d.getTime();
d.setMonth(d.getMonth() +
(unit === "quarter" ? 3 : 1));
var end = d.getTime();
d.setTime((v + carry * timeUnitSize.hour + (end - start) * tickSize));
carry = d.getHours();
d.setHours(0);
} else {
d.setMonth(d.getMonth() +
tickSize * (unit === "quarter" ? 3 : 1));
}
} else if (unit === "year") {
d.setFullYear(d.getFullYear() + tickSize);
} else {
if (opts.timeBase === 'seconds') {
d.setTime((v + step) * 1000);
} else {
d.setTime(v + step);
}
}
} while (v < axis.max && v !== prev);
return ticks;
};
function init(plot) {
plot.hooks.processOptions.push(function (plot) {
$.each(plot.getAxes(), function(axisName, axis) {
var opts = axis.options;
if (opts.mode === "time") {
axis.tickGenerator = dateTickGenerator;
axis.tickFormatter = function (v, axis) {
var d = dateGenerator(v, axis.options);
// first check global format
if (opts.timeformat != null) {
return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);
}
// possibly use quarters if quarters are mentioned in
// any of these places
var useQuarters = (axis.options.tickSize &&
axis.options.tickSize[1] == "quarter") ||
(axis.options.minTickSize &&
axis.options.minTickSize[1] == "quarter");
var timeUnitSize = opts.timeBase === 'seconds' ? timeUnitSizeSeconds : timeUnitSizeMilliseconds;
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
var span = axis.max - axis.min;
var suffix = (opts.twelveHourClock) ? " %p" : "";
var hourCode = (opts.twelveHourClock) ? "%I" : "%H";
var fmt;
if (t < timeUnitSize.minute) {
fmt = hourCode + ":%M:%S" + suffix;
} else if (t < timeUnitSize.day) {
if (span < 2 * timeUnitSize.day) {
fmt = hourCode + ":%M" + suffix;
} else {
fmt = "%b %d " + hourCode + ":%M" + suffix;
}
} else if (t < timeUnitSize.month) {
fmt = "%b %d";
} else if ((useQuarters && t < timeUnitSize.quarter) ||
(!useQuarters && t < timeUnitSize.year)) {
if (span < timeUnitSize.year) {
fmt = "%b";
} else {
fmt = "%b %Y";
}
} else if (useQuarters && t < timeUnitSize.year) {
if (span < timeUnitSize.year) {
fmt = "Q%q";
} else {
fmt = "Q%q %Y";
}
} else {
fmt = "%Y";
}
var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);
return rt;
};
}
});
});
}
$.plot.plugins.push({
init: init,
options: options,
name: 'time',
version: '1.0'
});
// Time-axis support used to be in Flot core, which exposed the
// formatDate function on the plot object. Various plugins depend
// on the function, so we need to re-expose it here.
$.plot.formatDate = formatDate;
$.plot.dateGenerator = dateGenerator;
$.plot.dateTickGenerator = dateTickGenerator;
$.plot.makeUtcWrapper = makeUtcWrapper;
})(jQuery);

View File

@ -1,322 +0,0 @@
/* global jQuery */
(function($) {
'use strict';
var options = {
pan: {
enableTouch: false
}
};
function init(plot) {
plot.hooks.processOptions.push(initTouchNavigation);
}
function initTouchNavigation(plot, options) {
var gestureState = {
twoTouches: false,
currentTapStart: { x: 0, y: 0 },
currentTapEnd: { x: 0, y: 0 },
prevTap: { x: 0, y: 0 },
currentTap: { x: 0, y: 0 },
interceptedLongTap: false,
allowEventPropagation: false,
prevTapTime: null,
tapStartTime: null,
longTapTriggerId: null
},
maxDistanceBetweenTaps = 20,
maxIntervalBetweenTaps = 500,
maxLongTapDistance = 20,
minLongTapDuration = 1500,
pressedTapDuration = 125,
mainEventHolder;
function interpretGestures(e) {
var o = plot.getOptions();
if (!o.pan.active && !o.zoom.active) {
return;
}
updateOnMultipleTouches(e);
mainEventHolder.dispatchEvent(new CustomEvent('touchevent', { detail: e }));
if (isPinchEvent(e)) {
executeAction(e, 'pinch');
} else {
executeAction(e, 'pan');
if (!wasPinchEvent(e)) {
if (isDoubleTap(e)) {
executeAction(e, 'doubleTap');
}
executeAction(e, 'tap');
executeAction(e, 'longTap');
}
}
}
function executeAction(e, gesture) {
switch (gesture) {
case 'pan':
pan[e.type](e);
break;
case 'pinch':
pinch[e.type](e);
break;
case 'doubleTap':
doubleTap.onDoubleTap(e);
break;
case 'longTap':
longTap[e.type](e);
break;
case 'tap':
tap[e.type](e);
break;
default:
break;
}
}
function bindEvents(plot, eventHolder) {
mainEventHolder = eventHolder[0];
eventHolder[0].addEventListener('touchstart', interpretGestures, false);
eventHolder[0].addEventListener('touchmove', interpretGestures, false);
eventHolder[0].addEventListener('touchend', interpretGestures, false);
}
function shutdown(plot, eventHolder) {
eventHolder[0].removeEventListener('touchstart', interpretGestures);
eventHolder[0].removeEventListener('touchmove', interpretGestures);
eventHolder[0].removeEventListener('touchend', interpretGestures);
if (gestureState.longTapTriggerId) {
clearTimeout(gestureState.longTapTriggerId);
gestureState.longTapTriggerId = null;
}
}
var pan = {
touchstart: function(e) {
updatePrevForDoubleTap();
updateCurrentForDoubleTap(e);
updateStateForLongTapStart(e);
mainEventHolder.dispatchEvent(new CustomEvent('panstart', { detail: e }));
},
touchmove: function(e) {
preventEventPropagation(e);
updateCurrentForDoubleTap(e);
updateStateForLongTapEnd(e);
if (!gestureState.allowEventPropagation) {
mainEventHolder.dispatchEvent(new CustomEvent('pandrag', { detail: e }));
}
},
touchend: function(e) {
preventEventPropagation(e);
if (wasPinchEvent(e)) {
mainEventHolder.dispatchEvent(new CustomEvent('pinchend', { detail: e }));
mainEventHolder.dispatchEvent(new CustomEvent('panstart', { detail: e }));
} else if (noTouchActive(e)) {
mainEventHolder.dispatchEvent(new CustomEvent('panend', { detail: e }));
}
}
};
var pinch = {
touchstart: function(e) {
mainEventHolder.dispatchEvent(new CustomEvent('pinchstart', { detail: e }));
},
touchmove: function(e) {
preventEventPropagation(e);
gestureState.twoTouches = isPinchEvent(e);
if (!gestureState.allowEventPropagation) {
mainEventHolder.dispatchEvent(new CustomEvent('pinchdrag', { detail: e }));
}
},
touchend: function(e) {
preventEventPropagation(e);
}
};
var doubleTap = {
onDoubleTap: function(e) {
preventEventPropagation(e);
mainEventHolder.dispatchEvent(new CustomEvent('doubletap', { detail: e }));
}
};
var longTap = {
touchstart: function(e) {
longTap.waitForLongTap(e);
},
touchmove: function(e) {
},
touchend: function(e) {
if (gestureState.longTapTriggerId) {
clearTimeout(gestureState.longTapTriggerId);
gestureState.longTapTriggerId = null;
}
},
isLongTap: function(e) {
var currentTime = new Date().getTime(),
tapDuration = currentTime - gestureState.tapStartTime;
if (tapDuration >= minLongTapDuration && !gestureState.interceptedLongTap) {
if (distance(gestureState.currentTapStart.x, gestureState.currentTapStart.y, gestureState.currentTapEnd.x, gestureState.currentTapEnd.y) < maxLongTapDistance) {
gestureState.interceptedLongTap = true;
return true;
}
}
return false;
},
waitForLongTap: function(e) {
var longTapTrigger = function() {
if (longTap.isLongTap(e)) {
mainEventHolder.dispatchEvent(new CustomEvent('longtap', { detail: e }));
}
gestureState.longTapTriggerId = null;
};
if (!gestureState.longTapTriggerId) {
gestureState.longTapTriggerId = setTimeout(longTapTrigger, minLongTapDuration);
}
}
};
var tap = {
touchstart: function(e) {
gestureState.tapStartTime = new Date().getTime();
},
touchmove: function(e) {
},
touchend: function(e) {
if (tap.isTap(e)) {
mainEventHolder.dispatchEvent(new CustomEvent('tap', { detail: e }));
preventEventPropagation(e);
}
},
isTap: function(e) {
var currentTime = new Date().getTime(),
tapDuration = currentTime - gestureState.tapStartTime;
if (tapDuration <= pressedTapDuration) {
if (distance(gestureState.currentTapStart.x, gestureState.currentTapStart.y, gestureState.currentTapEnd.x, gestureState.currentTapEnd.y) < maxLongTapDistance) {
return true;
}
}
return false;
}
};
if (options.pan.enableTouch === true) {
plot.hooks.bindEvents.push(bindEvents);
plot.hooks.shutdown.push(shutdown);
};
function updatePrevForDoubleTap() {
gestureState.prevTap = {
x: gestureState.currentTap.x,
y: gestureState.currentTap.y
};
};
function updateCurrentForDoubleTap(e) {
gestureState.currentTap = {
x: e.touches[0].pageX,
y: e.touches[0].pageY
};
}
function updateStateForLongTapStart(e) {
gestureState.tapStartTime = new Date().getTime();
gestureState.interceptedLongTap = false;
gestureState.currentTapStart = {
x: e.touches[0].pageX,
y: e.touches[0].pageY
};
gestureState.currentTapEnd = {
x: e.touches[0].pageX,
y: e.touches[0].pageY
};
};
function updateStateForLongTapEnd(e) {
gestureState.currentTapEnd = {
x: e.touches[0].pageX,
y: e.touches[0].pageY
};
};
function isDoubleTap(e) {
var currentTime = new Date().getTime(),
intervalBetweenTaps = currentTime - gestureState.prevTapTime;
if (intervalBetweenTaps >= 0 && intervalBetweenTaps < maxIntervalBetweenTaps) {
if (distance(gestureState.prevTap.x, gestureState.prevTap.y, gestureState.currentTap.x, gestureState.currentTap.y) < maxDistanceBetweenTaps) {
e.firstTouch = gestureState.prevTap;
e.secondTouch = gestureState.currentTap;
return true;
}
}
gestureState.prevTapTime = currentTime;
return false;
}
function preventEventPropagation(e) {
if (!gestureState.allowEventPropagation) {
e.preventDefault();
e.stopPropagation();
}
}
function distance(x1, y1, x2, y2) {
return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
function noTouchActive(e) {
return (e.touches && e.touches.length === 0);
}
function wasPinchEvent(e) {
return (gestureState.twoTouches && e.touches.length === 1);
}
function updateOnMultipleTouches(e) {
if (e.touches.length >= 3) {
gestureState.allowEventPropagation = true;
} else {
gestureState.allowEventPropagation = false;
}
}
function isPinchEvent(e) {
if (e.touches && e.touches.length >= 2) {
if (e.touches[0].target === plot.getEventHolder() &&
e.touches[1].target === plot.getEventHolder()) {
return true;
}
}
return false;
}
}
$.plot.plugins.push({
init: init,
options: options,
name: 'navigateTouch',
version: '0.3'
});
})(jQuery);

View File

@ -1,340 +0,0 @@
/* global jQuery */
(function($) {
'use strict';
var options = {
pan: {
enableTouch: false,
touchMode: 'manual'
}
};
var ZOOM_DISTANCE_MARGIN = $.plot.uiConstants.ZOOM_DISTANCE_MARGIN;
function init(plot) {
plot.hooks.processOptions.push(initTouchNavigation);
}
function initTouchNavigation(plot, options) {
var gestureState = {
zoomEnable: false,
prevDistance: null,
prevTapTime: 0,
prevPanPosition: { x: 0, y: 0 },
prevTapPosition: { x: 0, y: 0 }
},
navigationState = {
prevTouchedAxis: 'none',
currentTouchedAxis: 'none',
touchedAxis: null,
navigationConstraint: 'unconstrained',
initialState: null,
},
useManualPan = options.pan.touchMode === 'manual',
smartPanLock = options.pan.touchMode === 'smartLock',
useSmartPan = smartPanLock || options.pan.touchMode === 'smart',
pan, pinch, doubleTap;
function bindEvents(plot, eventHolder) {
var o = plot.getOptions();
if (o.pan.interactive) {
eventHolder[0].addEventListener('panstart', pan.start, false);
eventHolder[0].addEventListener('pandrag', pan.drag, false);
eventHolder[0].addEventListener('panend', pan.end, false);
eventHolder[0].addEventListener('pinchstart', pinch.start, false);
eventHolder[0].addEventListener('pinchdrag', pinch.drag, false);
eventHolder[0].addEventListener('pinchend', pinch.end, false);
eventHolder[0].addEventListener('doubletap', doubleTap.recenterPlot, false);
}
}
function shutdown(plot, eventHolder) {
eventHolder[0].removeEventListener('panstart', pan.start);
eventHolder[0].removeEventListener('pandrag', pan.drag);
eventHolder[0].removeEventListener('panend', pan.end);
eventHolder[0].removeEventListener('pinchstart', pinch.start);
eventHolder[0].removeEventListener('pinchdrag', pinch.drag);
eventHolder[0].removeEventListener('pinchend', pinch.end);
eventHolder[0].removeEventListener('doubletap', doubleTap.recenterPlot);
}
pan = {
start: function(e) {
presetNavigationState(e, 'pan', gestureState);
updateData(e, 'pan', gestureState, navigationState);
if (useSmartPan) {
var point = getPoint(e, 'pan');
navigationState.initialState = plot.navigationState(point.x, point.y);
}
},
drag: function(e) {
presetNavigationState(e, 'pan', gestureState);
if (useSmartPan) {
var point = getPoint(e, 'pan');
plot.smartPan({
x: navigationState.initialState.startPageX - point.x,
y: navigationState.initialState.startPageY - point.y
}, navigationState.initialState, navigationState.touchedAxis, false, smartPanLock);
} else if (useManualPan) {
plot.pan({
left: -delta(e, 'pan', gestureState).x,
top: -delta(e, 'pan', gestureState).y,
axes: navigationState.touchedAxis
});
updatePrevPanPosition(e, 'pan', gestureState, navigationState);
}
},
end: function(e) {
presetNavigationState(e, 'pan', gestureState);
if (useSmartPan) {
plot.smartPan.end();
}
if (wasPinchEvent(e, gestureState)) {
updateprevPanPosition(e, 'pan', gestureState, navigationState);
}
}
};
var pinchDragTimeout;
pinch = {
start: function(e) {
if (pinchDragTimeout) {
clearTimeout(pinchDragTimeout);
pinchDragTimeout = null;
}
presetNavigationState(e, 'pinch', gestureState);
setPrevDistance(e, gestureState);
updateData(e, 'pinch', gestureState, navigationState);
},
drag: function(e) {
if (pinchDragTimeout) {
return;
}
pinchDragTimeout = setTimeout(function() {
presetNavigationState(e, 'pinch', gestureState);
plot.pan({
left: -delta(e, 'pinch', gestureState).x,
top: -delta(e, 'pinch', gestureState).y,
axes: navigationState.touchedAxis
});
updatePrevPanPosition(e, 'pinch', gestureState, navigationState);
var dist = pinchDistance(e);
if (gestureState.zoomEnable || Math.abs(dist - gestureState.prevDistance) > ZOOM_DISTANCE_MARGIN) {
zoomPlot(plot, e, gestureState, navigationState);
//activate zoom mode
gestureState.zoomEnable = true;
}
pinchDragTimeout = null;
}, 1000 / 60);
},
end: function(e) {
if (pinchDragTimeout) {
clearTimeout(pinchDragTimeout);
pinchDragTimeout = null;
}
presetNavigationState(e, 'pinch', gestureState);
gestureState.prevDistance = null;
}
};
doubleTap = {
recenterPlot: function(e) {
if (e && e.detail && e.detail.type === 'touchmove') {
// do not recenter during touch moving;
return;
}
recenterPlotOnDoubleTap(plot, e, gestureState, navigationState);
}
};
if (options.pan.enableTouch === true) {
plot.hooks.bindEvents.push(bindEvents);
plot.hooks.shutdown.push(shutdown);
}
function presetNavigationState(e, gesture, gestureState) {
navigationState.touchedAxis = getAxis(plot, e, gesture, navigationState);
if (noAxisTouched(navigationState)) {
navigationState.navigationConstraint = 'unconstrained';
} else {
navigationState.navigationConstraint = 'axisConstrained';
}
}
}
$.plot.plugins.push({
init: init,
options: options,
name: 'navigateTouch',
version: '0.3'
});
function recenterPlotOnDoubleTap(plot, e, gestureState, navigationState) {
checkAxesForDoubleTap(plot, e, navigationState);
if ((navigationState.currentTouchedAxis === 'x' && navigationState.prevTouchedAxis === 'x') ||
(navigationState.currentTouchedAxis === 'y' && navigationState.prevTouchedAxis === 'y') ||
(navigationState.currentTouchedAxis === 'none' && navigationState.prevTouchedAxis === 'none')) {
plot.recenter({ axes: navigationState.touchedAxis });
}
}
function checkAxesForDoubleTap(plot, e, navigationState) {
var axis = plot.getTouchedAxis(e.detail.firstTouch.x, e.detail.firstTouch.y);
if (axis[0] !== undefined) {
navigationState.prevTouchedAxis = axis[0].direction;
}
axis = plot.getTouchedAxis(e.detail.secondTouch.x, e.detail.secondTouch.y);
if (axis[0] !== undefined) {
navigationState.touchedAxis = axis;
navigationState.currentTouchedAxis = axis[0].direction;
}
if (noAxisTouched(navigationState)) {
navigationState.touchedAxis = null;
navigationState.prevTouchedAxis = 'none';
navigationState.currentTouchedAxis = 'none';
}
}
function zoomPlot(plot, e, gestureState, navigationState) {
var offset = plot.offset(),
center = {
left: 0,
top: 0
},
zoomAmount = pinchDistance(e) / gestureState.prevDistance,
dist = pinchDistance(e);
center.left = getPoint(e, 'pinch').x - offset.left;
center.top = getPoint(e, 'pinch').y - offset.top;
// send the computed touched axis to the zoom function so that it only zooms on that one
plot.zoom({
center: center,
amount: zoomAmount,
axes: navigationState.touchedAxis
});
gestureState.prevDistance = dist;
}
function wasPinchEvent(e, gestureState) {
return (gestureState.zoomEnable && e.detail.touches.length === 1);
}
function getAxis(plot, e, gesture, navigationState) {
if (e.type === 'pinchstart') {
var axisTouch1 = plot.getTouchedAxis(e.detail.touches[0].pageX, e.detail.touches[0].pageY);
var axisTouch2 = plot.getTouchedAxis(e.detail.touches[1].pageX, e.detail.touches[1].pageY);
if (axisTouch1.length === axisTouch2.length && axisTouch1.toString() === axisTouch2.toString()) {
return axisTouch1;
}
} else if (e.type === 'panstart') {
return plot.getTouchedAxis(e.detail.touches[0].pageX, e.detail.touches[0].pageY);
} else if (e.type === 'pinchend') {
//update axis since instead on pinch, a pan event is made
return plot.getTouchedAxis(e.detail.touches[0].pageX, e.detail.touches[0].pageY);
} else {
return navigationState.touchedAxis;
}
}
function noAxisTouched(navigationState) {
return (!navigationState.touchedAxis || navigationState.touchedAxis.length === 0);
}
function setPrevDistance(e, gestureState) {
gestureState.prevDistance = pinchDistance(e);
}
function updateData(e, gesture, gestureState, navigationState) {
var axisDir,
point = getPoint(e, gesture);
switch (navigationState.navigationConstraint) {
case 'unconstrained':
navigationState.touchedAxis = null;
gestureState.prevTapPosition = {
x: gestureState.prevPanPosition.x,
y: gestureState.prevPanPosition.y
};
gestureState.prevPanPosition = {
x: point.x,
y: point.y
};
break;
case 'axisConstrained':
axisDir = navigationState.touchedAxis[0].direction;
navigationState.currentTouchedAxis = axisDir;
gestureState.prevTapPosition[axisDir] = gestureState.prevPanPosition[axisDir];
gestureState.prevPanPosition[axisDir] = point[axisDir];
break;
default:
break;
}
}
function distance(x1, y1, x2, y2) {
return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
function pinchDistance(e) {
var t1 = e.detail.touches[0],
t2 = e.detail.touches[1];
return distance(t1.pageX, t1.pageY, t2.pageX, t2.pageY);
}
function updatePrevPanPosition(e, gesture, gestureState, navigationState) {
var point = getPoint(e, gesture);
switch (navigationState.navigationConstraint) {
case 'unconstrained':
gestureState.prevPanPosition.x = point.x;
gestureState.prevPanPosition.y = point.y;
break;
case 'axisConstrained':
gestureState.prevPanPosition[navigationState.currentTouchedAxis] =
point[navigationState.currentTouchedAxis];
break;
default:
break;
}
}
function delta(e, gesture, gestureState) {
var point = getPoint(e, gesture);
return {
x: point.x - gestureState.prevPanPosition.x,
y: point.y - gestureState.prevPanPosition.y
}
}
function getPoint(e, gesture) {
if (gesture === 'pinch') {
return {
x: (e.detail.touches[0].pageX + e.detail.touches[1].pageX) / 2,
y: (e.detail.touches[0].pageY + e.detail.touches[1].pageY) / 2
}
} else {
return {
x: e.detail.touches[0].pageX,
y: e.detail.touches[0].pageY
}
}
}
})(jQuery);

View File

@ -1,10 +0,0 @@
(function ($) {
'use strict';
$.plot.uiConstants = {
SNAPPING_CONSTANT: 20,
PANHINT_LENGTH_CONSTANT: 10,
MINOR_TICKS_COUNT_CONSTANT: 4,
TICK_LENGTH_CONSTANT: 10,
ZOOM_DISTANCE_MARGIN: 25
};
})(jQuery);

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +0,0 @@
// Source: https://github.com/jquery/jquery-mousewheel/blob/a06ef4e1a127795606642c55e22d4f2945edc061/jquery.mousewheel.js
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function($) {
var types = ['DOMMouseScroll', 'mousewheel'];
if ($.event.fixHooks) {
for ( var i=types.length; i; ) {
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
setup: function() {
if ( this.addEventListener ) {
for ( var i=types.length; i; ) {
this.addEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i=types.length; i; ) {
this.removeEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
});
function handler(event) {
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
// Old school scrollwheel delta
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
// Gecko
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaY = 0;
deltaX = -1*delta;
}
// Webkit
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery);

View File

@ -1,151 +0,0 @@
# random,1310720,google_dense_hash_map,45621248,0.344362020493
# random,2621440,glib_hash_table,109867008,1.01163601875
# random,2621440,stl_unordered_map,130715648,1.73484396935
# random,2621440,boost_unordered_map,108380160,1.11585187912
# random,2621440,google_sparse_hash_map,37015552,1.76031804085
# random,2621440,google_dense_hash_map,79175680,0.504401922226
# random,5242880,glib_hash_table,210530304,1.86031603813
# random,5242880,stl_unordered_map,250298368,3.81597208977
# random,5242880,boost_unordered_map,192184320,2.63760495186
# random,5242880,google_sparse_hash_map,62066688,3.93570995331
# random,5242880,google_dense_hash_map,146284544,1.22620105743
# random,10485760,glib_hash_table,411856896,4.16937494278
# random,10485760,stl_unordered_map,490430464,7.91806197166
# random,10485760,boost_unordered_map,359251968,7.52085900307
# random,10485760,google_sparse_hash_map,111902720,8.11318516731
# random,10485760,google_dense_hash_map,280502272,2.32930994034
# random,20971520,glib_hash_table,814510080,8.32456207275
# random,20971520,stl_unordered_map,971583488,16.1606841087
# random,20971520,boost_unordered_map,692441088,24.5845990181
# random,20971520,google_sparse_hash_map,211435520,16.2772600651
# random,20971520,google_dense_hash_map,548937728,4.85360789299
# random,41943040,glib_hash_table,1619816448,90.6313672066
import sys, json
lines = [ line.strip() for line in sys.stdin if line.strip() ]
by_benchtype = {}
benches = {}
programs = {}
for line in lines:
benchtype, type, nkeys, program, value = line.split(',')
nkeys = int(nkeys)
programs[program] = 1
if (type == 'time'):
by_benchtype.setdefault("%s-runtime" % benchtype, {}).setdefault(program, []).append([nkeys, float(value)])
else:
by_benchtype.setdefault("%s-memory" % benchtype, {}).setdefault(program, []).append([nkeys, int(value)])
benches[benchtype] = 1
proper_names = {
'std::unordered_map': 'std::unordered_map (1 thread)',
'spp::sparse_hash_map': 'sparsepp (1 thread, use_spp_alloc)',
'absl::flat_hash_map': 'absl::flat_hash_map (1 thread)',
'phmap::flat_hash_map': 'phmap::flat_hash_map',
'phmap::parallel_flat_hash_map': 'phmap::parallel_flat_hash_map (1 thread)',
'phmap::parallel_flat_hash_map_mt': 'phmap::parallel_flat_hash_map (8 thread)',
'absl::parallel_flat_hash_map': 'absl::parallel_flat_hash_map (1 thread)',
'absl::parallel_flat_hash_map_mt': 'absl::parallel_flat_hash_map (8 threads)',
'phmap::parallel_flat_hash_map_4': 'phmap::parallel_flat_hash_map (N=4, 8 threads)',
'phmap::parallel_flat_hash_map_5': 'phmap::parallel_flat_hash_map (N=5, 8 threads)',
'phmap::parallel_flat_hash_map_6': 'phmap::parallel_flat_hash_map (N=6, 8 threads)'
}
proper_color = {
'std::unordered_map': 0,
'spp::sparse_hash_map': 0,
'absl::flat_hash_map': 1,
'phmap::flat_hash_map': 1,
'phmap::parallel_flat_hash_map': 2,
'phmap::parallel_flat_hash_map_mt': 2,
'absl::parallel_flat_hash_map': 3,
'absl::parallel_flat_hash_map_mt': 3,
'phmap::parallel_flat_hash_map_4': 3,
'phmap::parallel_flat_hash_map_5': 4,
'phmap::parallel_flat_hash_map_6': 5
}
bench_titles = {
'lookup': 'Random Lookup',
'sequential' : 'Sequential Insert',
'random' : 'Random Insert',
'delete' : 'Deletion',
'sequentialstring' : 'Sequential String Insert',
'randomstring' : 'Random String Insert',
'deletestring' : 'String Deletion'
}
# do them in the desired order to make the legend not overlap the chart data
# too much
program_slugs = [
'std::unordered_map',
'sparsepp',
'absl::flat_hash_map',
'phmap::flat_hash_map',
'absl::parallel_flat_hash_map',
'phmap::parallel_flat_hash_map',
'phmap::parallel_flat_hash_map_mt',
'absl::parallel_flat_hash_map_mt',
'phmap::parallel_flat_hash_map_4',
'phmap::parallel_flat_hash_map_5',
'phmap::parallel_flat_hash_map_6'
]
chart_data = {}
for i, (benchtype, programs) in enumerate(by_benchtype.items()):
chart_data[benchtype] = []
k = programs.keys()
k.sort()
for program in k:
data = programs.get(program, [])
chart_data[benchtype].append({
'label': proper_names[program],
'color': proper_color[program],
'data': [],
})
for k, (nkeys, value) in enumerate(data):
chart_data[benchtype][-1]['data'].append([nkeys, value])
html_chart_data = 'chart_data = ' + json.dumps(chart_data)
## print chart_data['delete-runtime']
html_plot_spec = ''
for b in benches.keys():
html_plot_spec += """
$.plot($("#{0}-runtime"), chart_data['{0}-runtime'], runtime_settings);
$.plot($("#{0}-memory"), chart_data['{0}-memory'], memory_settings);""".format(b)
html_div_spec = ''
first = 1
for b in benches.keys():
if 1:
first = 0
html_div_spec += """
<div class="table-title">{1} (integers): Memory Usage</div>
<div class="chart" id="{0}-memory"></div>
<div class="xaxis-title">number of entries in hash table</div>
""".format(b, bench_titles[b])
html_div_spec += """
<div class="table-title">{1} (integers): Execution Time </div>
<div class="chart" id="{0}-runtime"></div>
<div class="xaxis-title">number of entries in hash table</div>
""".format(b, bench_titles[b])
html_template = file('charts-template.html', 'r').read()
html_template = html_template.replace('__CHART_DATA_GOES_HERE__', html_chart_data)
html_template = html_template.replace('__PLOT_SPEC_GOES_HERE__', html_plot_spec)
html_template = html_template.replace('__PLOT_DIV_SPEC_GOES_HERE__', html_div_spec)
file('charts.html', 'w').write(html_template)

View File

@ -1,97 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/xenial64"
# sudo apt-get update
# sudo apt-get install -y build-essential
# sudo apt-get install -y cmake
# sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
# sudo apt-get install -y libboost1.55-dev
# wget https://github.com/bazelbuild/bazel/releases/download/0.22.0/bazel-0.22.0-installer-linux-x86_64.sh
# chmod +x ./bazel-0.22.0-installer-linux-x86_64.sh
# ./bazel-0.22.0-installer-linux-x86_64.sh
# ./bazel-bin/hashtable_benchmarks --benchmark_format=json > benchmark-results.json
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
# Display the VirtualBox GUI when booting the machine
vb.gui = false
# Customize the amount of memory on the VM:
vb.memory = "16384"
end
#
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y ninja-build
sudo apt-get install -y pkg-config zip zlib1g-dev unzip python python-pip
# for folly
sudo apt-get install -y libboost-all-dev libevent-dev libdouble-conversion-dev \
libgoogle-glog-dev libgflags-dev libiberty-dev liblz4-dev liblzma-dev \
libsnappy-dev zlib1g-dev binutils-dev libjemalloc-dev libssl-dev pkg-config
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get install -y python3 python3-pip
sudo apt-get update
sudo apt-get install -y gcc-8 g++-8
python3 -m pip install --upgrade pip
python3 -m pip install perf
cd /vagrant
git clone --recurse-submodules https://github.com/greg7mdp/map_benchmark.git
./map_benchmark/tools/build.sh
sudo apt install -y ruby-full
SHELL
end

View File

@ -1,320 +0,0 @@
random,memory,0,phmap::flat_hash_map,15740928
random,memory,240967,phmap::flat_hash_map,11272192
random,memory,458751,phmap::flat_hash_map,11272192
random,memory,458752,phmap::flat_hash_map,29138944
random,memory,493930,phmap::flat_hash_map,20205568
random,memory,678845,phmap::flat_hash_map,19087360
random,memory,917503,phmap::flat_hash_map,19087360
random,memory,917504,phmap::flat_hash_map,54812672
random,memory,930488,phmap::flat_hash_map,36945920
random,memory,1835007,phmap::flat_hash_map,36945920
random,memory,1835008,phmap::flat_hash_map,108392448
random,memory,1860950,phmap::flat_hash_map,72667136
random,memory,3670015,phmap::flat_hash_map,72667136
random,memory,3670016,phmap::flat_hash_map,215556096
random,memory,3681610,phmap::flat_hash_map,144109568
random,memory,7340031,phmap::flat_hash_map,144109568
random,memory,7340032,phmap::flat_hash_map,429883392
random,memory,7348393,phmap::flat_hash_map,286994432
random,time,10000000,phmap::flat_hash_map,0.917000
random,memory,10000174,phmap::flat_hash_map,286994432
random,memory,14680063,phmap::flat_hash_map,286994432
random,memory,14680064,phmap::flat_hash_map,858537984
random,memory,14680512,phmap::flat_hash_map,572764160
random,time,20000000,phmap::flat_hash_map,2.199000
random,memory,20013320,phmap::flat_hash_map,572764160
random,memory,29360127,phmap::flat_hash_map,572764160
random,memory,29360128,phmap::flat_hash_map,1715859456
random,memory,29369210,phmap::flat_hash_map,1144307712
random,time,30000000,phmap::flat_hash_map,3.818000
random,memory,30002294,phmap::flat_hash_map,1144307712
random,time,40000000,phmap::flat_hash_map,5.070000
random,memory,40010797,phmap::flat_hash_map,1144307712
random,time,50000000,phmap::flat_hash_map,6.323000
random,memory,50009729,phmap::flat_hash_map,1144307712
random,memory,58720255,phmap::flat_hash_map,1144307712
random,memory,58720256,phmap::flat_hash_map,3430486016
random,memory,58721491,phmap::flat_hash_map,2287403008
random,time,60000000,phmap::flat_hash_map,8.700000
random,memory,60002661,phmap::flat_hash_map,2287403008
random,time,70000000,phmap::flat_hash_map,10.155000
random,memory,70010887,phmap::flat_hash_map,2287403008
random,time,80000000,phmap::flat_hash_map,11.589000
random,memory,80002681,phmap::flat_hash_map,2287403008
random,time,90000000,phmap::flat_hash_map,13.020000
random,memory,90012468,phmap::flat_hash_map,2287403008
random,time,100000000,phmap::flat_hash_map,14.407000
random,memory,0,phmap::parallel_flat_hash_map,6688768
random,memory,228584,phmap::parallel_flat_hash_map,6688768
random,memory,228585,phmap::parallel_flat_hash_map,8372224
random,memory,230683,phmap::parallel_flat_hash_map,8372224
random,memory,230684,phmap::parallel_flat_hash_map,11190272
random,memory,257042,phmap::parallel_flat_hash_map,11190272
random,memory,257105,phmap::parallel_flat_hash_map,11751424
random,memory,456008,phmap::parallel_flat_hash_map,11751424
random,memory,456009,phmap::parallel_flat_hash_map,13996032
random,memory,456819,phmap::parallel_flat_hash_map,13582336
random,memory,458740,phmap::parallel_flat_hash_map,13582336
random,memory,458741,phmap::parallel_flat_hash_map,15847424
random,memory,459266,phmap::parallel_flat_hash_map,15847424
random,memory,459267,phmap::parallel_flat_hash_map,17518592
random,memory,465267,phmap::parallel_flat_hash_map,17518592
random,memory,465268,phmap::parallel_flat_hash_map,21155840
random,memory,494937,phmap::parallel_flat_hash_map,20598784
random,memory,911236,phmap::parallel_flat_hash_map,20598784
random,memory,911237,phmap::parallel_flat_hash_map,22835200
random,memory,913145,phmap::parallel_flat_hash_map,22835200
random,memory,913146,phmap::parallel_flat_hash_map,25067520
random,memory,914338,phmap::parallel_flat_hash_map,25067520
random,memory,914339,phmap::parallel_flat_hash_map,27303936
random,memory,916480,phmap::parallel_flat_hash_map,27303936
random,memory,916481,phmap::parallel_flat_hash_map,29536256
random,memory,916523,phmap::parallel_flat_hash_map,29536256
random,memory,916524,phmap::parallel_flat_hash_map,30650368
random,memory,917790,phmap::parallel_flat_hash_map,30650368
random,memory,917791,phmap::parallel_flat_hash_map,32882688
random,memory,918474,phmap::parallel_flat_hash_map,32882688
random,memory,918475,phmap::parallel_flat_hash_map,35115008
random,memory,924420,phmap::parallel_flat_hash_map,35115008
random,memory,924421,phmap::parallel_flat_hash_map,37355520
random,memory,937279,phmap::parallel_flat_hash_map,37355520
random,memory,937319,phmap::parallel_flat_hash_map,38465536
random,memory,1826595,phmap::parallel_flat_hash_map,38465536
random,memory,1826596,phmap::parallel_flat_hash_map,42934272
random,memory,1827102,phmap::parallel_flat_hash_map,42934272
random,memory,1827103,phmap::parallel_flat_hash_map,45170688
random,memory,1828265,phmap::parallel_flat_hash_map,45170688
random,memory,1828266,phmap::parallel_flat_hash_map,47398912
random,memory,1831166,phmap::parallel_flat_hash_map,47398912
random,memory,1831167,phmap::parallel_flat_hash_map,49631232
random,memory,1831515,phmap::parallel_flat_hash_map,49631232
random,memory,1831516,phmap::parallel_flat_hash_map,51867648
random,memory,1833264,phmap::parallel_flat_hash_map,51867648
random,memory,1833265,phmap::parallel_flat_hash_map,54099968
random,memory,1833345,phmap::parallel_flat_hash_map,54099968
random,memory,1833346,phmap::parallel_flat_hash_map,56332288
random,memory,1835078,phmap::parallel_flat_hash_map,56332288
random,memory,1835079,phmap::parallel_flat_hash_map,58572800
random,memory,1836213,phmap::parallel_flat_hash_map,58572800
random,memory,1836214,phmap::parallel_flat_hash_map,60801024
random,memory,1836364,phmap::parallel_flat_hash_map,60801024
random,memory,1836365,phmap::parallel_flat_hash_map,63033344
random,memory,1836849,phmap::parallel_flat_hash_map,63033344
random,memory,1836850,phmap::parallel_flat_hash_map,65265664
random,memory,1838065,phmap::parallel_flat_hash_map,65265664
random,memory,1838066,phmap::parallel_flat_hash_map,67502080
random,memory,1839241,phmap::parallel_flat_hash_map,67502080
random,memory,1839242,phmap::parallel_flat_hash_map,69734400
random,memory,1839771,phmap::parallel_flat_hash_map,69734400
random,memory,1839772,phmap::parallel_flat_hash_map,71962624
random,memory,1844031,phmap::parallel_flat_hash_map,71962624
random,memory,1844032,phmap::parallel_flat_hash_map,74194944
random,memory,1844165,phmap::parallel_flat_hash_map,74194944
random,memory,1844166,phmap::parallel_flat_hash_map,76423168
random,memory,1849529,phmap::parallel_flat_hash_map,74186752
random,memory,3656347,phmap::parallel_flat_hash_map,74186752
random,memory,3656348,phmap::parallel_flat_hash_map,83120128
random,memory,3658236,phmap::parallel_flat_hash_map,83120128
random,memory,3658237,phmap::parallel_flat_hash_map,87592960
random,memory,3660832,phmap::parallel_flat_hash_map,87592960
random,memory,3660833,phmap::parallel_flat_hash_map,92061696
random,memory,3663897,phmap::parallel_flat_hash_map,92061696
random,memory,3663898,phmap::parallel_flat_hash_map,96526336
random,memory,3668004,phmap::parallel_flat_hash_map,96526336
random,memory,3668005,phmap::parallel_flat_hash_map,100990976
random,memory,3668781,phmap::parallel_flat_hash_map,100990976
random,memory,3668782,phmap::parallel_flat_hash_map,105459712
random,memory,3669316,phmap::parallel_flat_hash_map,100990976
random,memory,3669736,phmap::parallel_flat_hash_map,100990976
random,memory,3669737,phmap::parallel_flat_hash_map,109928448
random,memory,3670780,phmap::parallel_flat_hash_map,109928448
random,memory,3670781,phmap::parallel_flat_hash_map,114388992
random,memory,3671735,phmap::parallel_flat_hash_map,114388992
random,memory,3671736,phmap::parallel_flat_hash_map,118853632
random,memory,3672742,phmap::parallel_flat_hash_map,118853632
random,memory,3672743,phmap::parallel_flat_hash_map,123322368
random,memory,3672841,phmap::parallel_flat_hash_map,123322368
random,memory,3672842,phmap::parallel_flat_hash_map,127787008
random,memory,3674661,phmap::parallel_flat_hash_map,127787008
random,memory,3674662,phmap::parallel_flat_hash_map,132259840
random,memory,3675918,phmap::parallel_flat_hash_map,132259840
random,memory,3675919,phmap::parallel_flat_hash_map,136724480
random,memory,3676502,phmap::parallel_flat_hash_map,136724480
random,memory,3676503,phmap::parallel_flat_hash_map,141180928
random,memory,3676556,phmap::parallel_flat_hash_map,141180928
random,memory,3676557,phmap::parallel_flat_hash_map,145645568
random,memory,3679943,phmap::parallel_flat_hash_map,141176832
random,memory,3682847,phmap::parallel_flat_hash_map,141176832
random,memory,3682848,phmap::parallel_flat_hash_map,150106112
random,memory,3701420,phmap::parallel_flat_hash_map,145637376
random,memory,7323550,phmap::parallel_flat_hash_map,145637376
random,memory,7323551,phmap::parallel_flat_hash_map,163500032
random,memory,7325955,phmap::parallel_flat_hash_map,154566656
random,memory,7326781,phmap::parallel_flat_hash_map,154566656
random,memory,7326782,phmap::parallel_flat_hash_map,172433408
random,memory,7327471,phmap::parallel_flat_hash_map,172433408
random,memory,7327472,phmap::parallel_flat_hash_map,181362688
random,memory,7328548,phmap::parallel_flat_hash_map,181362688
random,memory,7328549,phmap::parallel_flat_hash_map,190300160
random,memory,7331571,phmap::parallel_flat_hash_map,190300160
random,memory,7331572,phmap::parallel_flat_hash_map,199229440
random,memory,7333270,phmap::parallel_flat_hash_map,199229440
random,memory,7333271,phmap::parallel_flat_hash_map,208154624
random,memory,7336330,phmap::parallel_flat_hash_map,208154624
random,memory,7336331,phmap::parallel_flat_hash_map,217083904
random,memory,7338941,phmap::parallel_flat_hash_map,217083904
random,memory,7338942,phmap::parallel_flat_hash_map,226021376
random,memory,7339987,phmap::parallel_flat_hash_map,226021376
random,memory,7339988,phmap::parallel_flat_hash_map,234950656
random,memory,7340192,phmap::parallel_flat_hash_map,234950656
random,memory,7340193,phmap::parallel_flat_hash_map,243879936
random,memory,7340212,phmap::parallel_flat_hash_map,243879936
random,memory,7340213,phmap::parallel_flat_hash_map,252805120
random,memory,7340756,phmap::parallel_flat_hash_map,252805120
random,memory,7340757,phmap::parallel_flat_hash_map,261734400
random,memory,7353138,phmap::parallel_flat_hash_map,261734400
random,memory,7353139,phmap::parallel_flat_hash_map,270659584
random,memory,7355638,phmap::parallel_flat_hash_map,270659584
random,memory,7355639,phmap::parallel_flat_hash_map,279592960
random,memory,7358552,phmap::parallel_flat_hash_map,279592960
random,memory,7358553,phmap::parallel_flat_hash_map,288522240
random,memory,7363002,phmap::parallel_flat_hash_map,279584768
random,memory,7364175,phmap::parallel_flat_hash_map,279584768
random,memory,7364176,phmap::parallel_flat_hash_map,297451520
random,memory,7379232,phmap::parallel_flat_hash_map,288518144
random,time,10000000,phmap::parallel_flat_hash_map,1.115000
random,memory,10001837,phmap::parallel_flat_hash_map,288518144
random,memory,14641981,phmap::parallel_flat_hash_map,288518144
random,memory,14641982,phmap::parallel_flat_hash_map,324243456
random,memory,14649536,phmap::parallel_flat_hash_map,306380800
random,memory,14658094,phmap::parallel_flat_hash_map,306380800
random,memory,14658095,phmap::parallel_flat_hash_map,342106112
random,memory,14663598,phmap::parallel_flat_hash_map,342106112
random,memory,14663599,phmap::parallel_flat_hash_map,359968768
random,memory,14667323,phmap::parallel_flat_hash_map,359968768
random,memory,14667324,phmap::parallel_flat_hash_map,377835520
random,memory,14668425,phmap::parallel_flat_hash_map,377835520
random,memory,14668426,phmap::parallel_flat_hash_map,395694080
random,memory,14669145,phmap::parallel_flat_hash_map,395694080
random,memory,14669146,phmap::parallel_flat_hash_map,413560832
random,memory,14669916,phmap::parallel_flat_hash_map,395698176
random,memory,14673506,phmap::parallel_flat_hash_map,395698176
random,memory,14673507,phmap::parallel_flat_hash_map,431423488
random,memory,14676201,phmap::parallel_flat_hash_map,431423488
random,memory,14676202,phmap::parallel_flat_hash_map,449286144
random,memory,14681323,phmap::parallel_flat_hash_map,449286144
random,memory,14681324,phmap::parallel_flat_hash_map,467152896
random,memory,14684771,phmap::parallel_flat_hash_map,449286144
random,memory,14686498,phmap::parallel_flat_hash_map,449286144
random,memory,14686499,phmap::parallel_flat_hash_map,485011456
random,memory,14691299,phmap::parallel_flat_hash_map,485011456
random,memory,14691300,phmap::parallel_flat_hash_map,502865920
random,memory,14694531,phmap::parallel_flat_hash_map,502865920
random,memory,14694532,phmap::parallel_flat_hash_map,520728576
random,memory,14696324,phmap::parallel_flat_hash_map,520728576
random,memory,14696325,phmap::parallel_flat_hash_map,538587136
random,memory,14701255,phmap::parallel_flat_hash_map,538587136
random,memory,14701256,phmap::parallel_flat_hash_map,556445696
random,memory,14702651,phmap::parallel_flat_hash_map,538578944
random,memory,14704639,phmap::parallel_flat_hash_map,538578944
random,memory,14704640,phmap::parallel_flat_hash_map,574300160
random,memory,14707748,phmap::parallel_flat_hash_map,574300160
random,memory,14707749,phmap::parallel_flat_hash_map,592158720
random,memory,14711651,phmap::parallel_flat_hash_map,574296064
random,time,20000000,phmap::parallel_flat_hash_map,2.484000
random,memory,20006564,phmap::parallel_flat_hash_map,574296064
random,memory,29321443,phmap::parallel_flat_hash_map,574296064
random,memory,29321444,phmap::parallel_flat_hash_map,645742592
random,memory,29322576,phmap::parallel_flat_hash_map,645742592
random,memory,29322577,phmap::parallel_flat_hash_map,681463808
random,memory,29331685,phmap::parallel_flat_hash_map,645742592
random,memory,29333141,phmap::parallel_flat_hash_map,645742592
random,memory,29333142,phmap::parallel_flat_hash_map,717189120
random,memory,29336447,phmap::parallel_flat_hash_map,717189120
random,memory,29336448,phmap::parallel_flat_hash_map,752910336
random,memory,29345055,phmap::parallel_flat_hash_map,717185024
random,memory,29352413,phmap::parallel_flat_hash_map,717185024
random,memory,29352414,phmap::parallel_flat_hash_map,788627456
random,memory,29357051,phmap::parallel_flat_hash_map,752902144
random,memory,29357141,phmap::parallel_flat_hash_map,752902144
random,memory,29357142,phmap::parallel_flat_hash_map,824348672
random,memory,29359481,phmap::parallel_flat_hash_map,824348672
random,memory,29359482,phmap::parallel_flat_hash_map,860069888
random,memory,29362077,phmap::parallel_flat_hash_map,860069888
random,memory,29362078,phmap::parallel_flat_hash_map,895795200
random,memory,29366120,phmap::parallel_flat_hash_map,895795200
random,memory,29366121,phmap::parallel_flat_hash_map,931512320
random,memory,29368098,phmap::parallel_flat_hash_map,931512320
random,memory,29368099,phmap::parallel_flat_hash_map,967229440
random,memory,29368978,phmap::parallel_flat_hash_map,931508224
random,memory,29373953,phmap::parallel_flat_hash_map,931508224
random,memory,29373954,phmap::parallel_flat_hash_map,1002954752
random,memory,29376083,phmap::parallel_flat_hash_map,1002954752
random,memory,29376084,phmap::parallel_flat_hash_map,1038680064
random,memory,29378406,phmap::parallel_flat_hash_map,1002950656
random,memory,29378970,phmap::parallel_flat_hash_map,1002950656
random,memory,29378971,phmap::parallel_flat_hash_map,1074397184
random,memory,29380083,phmap::parallel_flat_hash_map,1074397184
random,memory,29380084,phmap::parallel_flat_hash_map,1110122496
random,memory,29381250,phmap::parallel_flat_hash_map,1110122496
random,memory,29381251,phmap::parallel_flat_hash_map,1145839616
random,memory,29384576,phmap::parallel_flat_hash_map,1110110208
random,memory,29391514,phmap::parallel_flat_hash_map,1110110208
random,memory,29391515,phmap::parallel_flat_hash_map,1181556736
random,memory,29398827,phmap::parallel_flat_hash_map,1145835520
random,time,30000000,phmap::parallel_flat_hash_map,4.197000
random,memory,30003726,phmap::parallel_flat_hash_map,1145835520
random,time,40000000,phmap::parallel_flat_hash_map,5.407000
random,memory,40004260,phmap::parallel_flat_hash_map,1145835520
random,time,50000000,phmap::parallel_flat_hash_map,6.651000
random,memory,50008463,phmap::parallel_flat_hash_map,1145835520
random,memory,58650774,phmap::parallel_flat_hash_map,1145835520
random,memory,58650775,phmap::parallel_flat_hash_map,1288724480
random,memory,58651341,phmap::parallel_flat_hash_map,1217282048
random,memory,58670748,phmap::parallel_flat_hash_map,1217282048
random,memory,58670749,phmap::parallel_flat_hash_map,1360171008
random,memory,58672543,phmap::parallel_flat_hash_map,1288724480
random,memory,58679343,phmap::parallel_flat_hash_map,1288724480
random,memory,58679344,phmap::parallel_flat_hash_map,1431609344
random,memory,58679621,phmap::parallel_flat_hash_map,1431609344
random,memory,58679622,phmap::parallel_flat_hash_map,1503047680
random,memory,58681449,phmap::parallel_flat_hash_map,1503047680
random,memory,58681450,phmap::parallel_flat_hash_map,1574498304
random,memory,58687442,phmap::parallel_flat_hash_map,1503055872
random,memory,58716081,phmap::parallel_flat_hash_map,1503055872
random,memory,58716082,phmap::parallel_flat_hash_map,1645944832
random,memory,58719988,phmap::parallel_flat_hash_map,1574498304
random,memory,58720496,phmap::parallel_flat_hash_map,1574498304
random,memory,58720497,phmap::parallel_flat_hash_map,1717387264
random,memory,58723911,phmap::parallel_flat_hash_map,1717387264
random,memory,58723912,phmap::parallel_flat_hash_map,1788841984
random,memory,58728095,phmap::parallel_flat_hash_map,1717395456
random,memory,58731608,phmap::parallel_flat_hash_map,1717395456
random,memory,58731609,phmap::parallel_flat_hash_map,1860280320
random,memory,58737338,phmap::parallel_flat_hash_map,1860280320
random,memory,58737339,phmap::parallel_flat_hash_map,1931718656
random,memory,58737397,phmap::parallel_flat_hash_map,1860272128
random,memory,58744726,phmap::parallel_flat_hash_map,1860272128
random,memory,58744727,phmap::parallel_flat_hash_map,2003165184
random,memory,58746205,phmap::parallel_flat_hash_map,1931718656
random,memory,58752523,phmap::parallel_flat_hash_map,1931718656
random,memory,58752524,phmap::parallel_flat_hash_map,2074607616
random,memory,58753838,phmap::parallel_flat_hash_map,2074607616
random,memory,58753839,phmap::parallel_flat_hash_map,2146054144
random,memory,58756083,phmap::parallel_flat_hash_map,2146054144
random,memory,58756084,phmap::parallel_flat_hash_map,2217496576
random,memory,58758266,phmap::parallel_flat_hash_map,2217496576
random,memory,58758267,phmap::parallel_flat_hash_map,2288943104
random,memory,58760494,phmap::parallel_flat_hash_map,2217492480
random,memory,58766191,phmap::parallel_flat_hash_map,2217492480
random,memory,58766192,phmap::parallel_flat_hash_map,2360381440
random,memory,58773720,phmap::parallel_flat_hash_map,2288934912
random,time,60000000,phmap::parallel_flat_hash_map,9.067000
random,memory,60002586,phmap::parallel_flat_hash_map,2288934912
random,time,70000000,phmap::parallel_flat_hash_map,10.409000
random,memory,70011900,phmap::parallel_flat_hash_map,2288934912
random,time,80000000,phmap::parallel_flat_hash_map,11.747000
random,memory,80002981,phmap::parallel_flat_hash_map,2288934912
random,time,90000000,phmap::parallel_flat_hash_map,13.091000
random,memory,90007030,phmap::parallel_flat_hash_map,2288934912
random,time,100000000,phmap::parallel_flat_hash_map,14.467000

View File

@ -1,316 +0,0 @@
random,memory,0,phmap::flat_hash_map,15753216
random,memory,299298,phmap::flat_hash_map,15753216
random,memory,299585,phmap::flat_hash_map,11284480
random,memory,458751,phmap::flat_hash_map,11284480
random,memory,458752,phmap::flat_hash_map,29151232
random,memory,505180,phmap::flat_hash_map,29151232
random,memory,505419,phmap::flat_hash_map,20217856
random,memory,599314,phmap::flat_hash_map,20217856
random,memory,599573,phmap::flat_hash_map,19095552
random,memory,917503,phmap::flat_hash_map,19095552
random,memory,917504,phmap::flat_hash_map,54820864
random,memory,963390,phmap::flat_hash_map,54820864
random,memory,963601,phmap::flat_hash_map,36954112
random,memory,1835007,phmap::flat_hash_map,36954112
random,memory,1835008,phmap::flat_hash_map,108400640
random,memory,1860352,phmap::flat_hash_map,108400640
random,memory,1860468,phmap::flat_hash_map,72675328
random,memory,3670015,phmap::flat_hash_map,72675328
random,memory,3670016,phmap::flat_hash_map,215564288
random,memory,3686835,phmap::flat_hash_map,215564288
random,memory,3686879,phmap::flat_hash_map,144117760
random,memory,7340031,phmap::flat_hash_map,144117760
random,memory,7340032,phmap::flat_hash_map,429891584
random,memory,7352288,phmap::flat_hash_map,429891584
random,memory,7352289,phmap::flat_hash_map,287002624
random,time,10000000,phmap::flat_hash_map,0.923000
random,memory,10003658,phmap::flat_hash_map,287002624
random,memory,14680063,phmap::flat_hash_map,287002624
random,memory,14680064,phmap::flat_hash_map,858554368
random,memory,14690134,phmap::flat_hash_map,858554368
random,memory,14690179,phmap::flat_hash_map,572776448
random,time,20000000,phmap::flat_hash_map,2.224000
random,memory,20009269,phmap::flat_hash_map,572776448
random,memory,29360127,phmap::flat_hash_map,572776448
random,memory,29360128,phmap::flat_hash_map,1715867648
random,memory,29366940,phmap::flat_hash_map,1715867648
random,memory,29366994,phmap::flat_hash_map,1144315904
random,time,30000000,phmap::flat_hash_map,3.846000
random,memory,30008884,phmap::flat_hash_map,1144315904
random,time,40000000,phmap::flat_hash_map,5.131000
random,memory,40002137,phmap::flat_hash_map,1144315904
random,time,50000000,phmap::flat_hash_map,6.445000
random,memory,50005385,phmap::flat_hash_map,1144315904
random,memory,58720255,phmap::flat_hash_map,1144315904
random,memory,58720256,phmap::flat_hash_map,3430494208
random,memory,58729667,phmap::flat_hash_map,3430494208
random,memory,58729713,phmap::flat_hash_map,2287415296
random,time,60000000,phmap::flat_hash_map,8.827000
random,memory,60010828,phmap::flat_hash_map,2287415296
random,time,70000000,phmap::flat_hash_map,10.317000
random,memory,70006827,phmap::flat_hash_map,2287415296
random,time,80000000,phmap::flat_hash_map,11.803000
random,memory,80002090,phmap::flat_hash_map,2287415296
random,time,90000000,phmap::flat_hash_map,13.277000
random,memory,90005422,phmap::flat_hash_map,2287415296
random,time,100000000,phmap::flat_hash_map,14.716000
random,memory,0,phmap::parallel_flat_hash_map_mt,7884800
random,memory,229053,phmap::parallel_flat_hash_map_mt,7884800
random,memory,229054,phmap::parallel_flat_hash_map_mt,12562432
random,memory,244827,phmap::parallel_flat_hash_map_mt,12562432
random,memory,244899,phmap::parallel_flat_hash_map_mt,13127680
random,memory,455707,phmap::parallel_flat_hash_map_mt,13127680
random,memory,455708,phmap::parallel_flat_hash_map_mt,14254080
random,memory,457702,phmap::parallel_flat_hash_map_mt,14254080
random,memory,457703,phmap::parallel_flat_hash_map_mt,14700544
random,memory,458422,phmap::parallel_flat_hash_map_mt,14700544
random,memory,458423,phmap::parallel_flat_hash_map_mt,16953344
random,memory,459497,phmap::parallel_flat_hash_map_mt,16953344
random,memory,459498,phmap::parallel_flat_hash_map_mt,18644992
random,memory,460681,phmap::parallel_flat_hash_map_mt,18644992
random,memory,460682,phmap::parallel_flat_hash_map_mt,21450752
random,memory,482289,phmap::parallel_flat_hash_map_mt,21450752
random,memory,482359,phmap::parallel_flat_hash_map_mt,22495232
random,memory,914327,phmap::parallel_flat_hash_map_mt,22495232
random,memory,914328,phmap::parallel_flat_hash_map_mt,25849856
random,memory,914709,phmap::parallel_flat_hash_map_mt,25849856
random,memory,914710,phmap::parallel_flat_hash_map_mt,29200384
random,memory,915833,phmap::parallel_flat_hash_map_mt,29200384
random,memory,915834,phmap::parallel_flat_hash_map_mt,33673216
random,memory,917742,phmap::parallel_flat_hash_map_mt,33673216
random,memory,917743,phmap::parallel_flat_hash_map_mt,35905536
random,memory,920586,phmap::parallel_flat_hash_map_mt,35905536
random,memory,920587,phmap::parallel_flat_hash_map_mt,37023744
random,memory,921976,phmap::parallel_flat_hash_map_mt,37023744
random,memory,921977,phmap::parallel_flat_hash_map_mt,40370176
random,memory,922650,phmap::parallel_flat_hash_map_mt,41484288
random,memory,983562,phmap::parallel_flat_hash_map_mt,41484288
random,memory,1172876,phmap::parallel_flat_hash_map_mt,40366080
random,memory,1825547,phmap::parallel_flat_hash_map_mt,40366080
random,memory,1825548,phmap::parallel_flat_hash_map_mt,44834816
random,memory,1826741,phmap::parallel_flat_hash_map_mt,44834816
random,memory,1826816,phmap::parallel_flat_hash_map_mt,42598400
random,memory,1828151,phmap::parallel_flat_hash_map_mt,42598400
random,memory,1828152,phmap::parallel_flat_hash_map_mt,47067136
random,memory,1830082,phmap::parallel_flat_hash_map_mt,47067136
random,memory,1830083,phmap::parallel_flat_hash_map_mt,49295360
random,memory,1831123,phmap::parallel_flat_hash_map_mt,49295360
random,memory,1831124,phmap::parallel_flat_hash_map_mt,51531776
random,memory,1832184,phmap::parallel_flat_hash_map_mt,51531776
random,memory,1832185,phmap::parallel_flat_hash_map_mt,53760000
random,memory,1832769,phmap::parallel_flat_hash_map_mt,53760000
random,memory,1832770,phmap::parallel_flat_hash_map_mt,55996416
random,memory,1832874,phmap::parallel_flat_hash_map_mt,55996416
random,memory,1832875,phmap::parallel_flat_hash_map_mt,58228736
random,memory,1835220,phmap::parallel_flat_hash_map_mt,58228736
random,memory,1835221,phmap::parallel_flat_hash_map_mt,60465152
random,memory,1836418,phmap::parallel_flat_hash_map_mt,60465152
random,memory,1836419,phmap::parallel_flat_hash_map_mt,62701568
random,memory,1836633,phmap::parallel_flat_hash_map_mt,62701568
random,memory,1836634,phmap::parallel_flat_hash_map_mt,64929792
random,memory,1837724,phmap::parallel_flat_hash_map_mt,64929792
random,memory,1837725,phmap::parallel_flat_hash_map_mt,67158016
random,memory,1838209,phmap::parallel_flat_hash_map_mt,67158016
random,memory,1838210,phmap::parallel_flat_hash_map_mt,69394432
random,memory,1838995,phmap::parallel_flat_hash_map_mt,69394432
random,memory,1838996,phmap::parallel_flat_hash_map_mt,71622656
random,memory,1840918,phmap::parallel_flat_hash_map_mt,71622656
random,memory,1840919,phmap::parallel_flat_hash_map_mt,73859072
random,memory,1841584,phmap::parallel_flat_hash_map_mt,73859072
random,memory,1841585,phmap::parallel_flat_hash_map_mt,76095488
random,memory,1842548,phmap::parallel_flat_hash_map_mt,78323712
random,memory,1854401,phmap::parallel_flat_hash_map_mt,78323712
random,memory,2039888,phmap::parallel_flat_hash_map_mt,76087296
random,memory,3656563,phmap::parallel_flat_hash_map_mt,76091392
random,memory,3656564,phmap::parallel_flat_hash_map_mt,85028864
random,memory,3657600,phmap::parallel_flat_hash_map_mt,85028864
random,memory,3657601,phmap::parallel_flat_hash_map_mt,89497600
random,memory,3659709,phmap::parallel_flat_hash_map_mt,89497600
random,memory,3659710,phmap::parallel_flat_hash_map_mt,93958144
random,memory,3664287,phmap::parallel_flat_hash_map_mt,93958144
random,memory,3664288,phmap::parallel_flat_hash_map_mt,98418688
random,memory,3665897,phmap::parallel_flat_hash_map_mt,98418688
random,memory,3665898,phmap::parallel_flat_hash_map_mt,102879232
random,memory,3668708,phmap::parallel_flat_hash_map_mt,102879232
random,memory,3668709,phmap::parallel_flat_hash_map_mt,107347968
random,memory,3669267,phmap::parallel_flat_hash_map_mt,107347968
random,memory,3669268,phmap::parallel_flat_hash_map_mt,111816704
random,memory,3673233,phmap::parallel_flat_hash_map_mt,111816704
random,memory,3673234,phmap::parallel_flat_hash_map_mt,134148096
random,memory,3673249,phmap::parallel_flat_hash_map_mt,134148096
random,memory,3673261,phmap::parallel_flat_hash_map_mt,125210624
random,memory,3673702,phmap::parallel_flat_hash_map_mt,125210624
random,memory,3673703,phmap::parallel_flat_hash_map_mt,129679360
random,memory,3674703,phmap::parallel_flat_hash_map_mt,129679360
random,memory,3674704,phmap::parallel_flat_hash_map_mt,134139904
random,memory,3675513,phmap::parallel_flat_hash_map_mt,134139904
random,memory,3675514,phmap::parallel_flat_hash_map_mt,138600448
random,memory,3677599,phmap::parallel_flat_hash_map_mt,138600448
random,memory,3677600,phmap::parallel_flat_hash_map_mt,143073280
random,memory,3678958,phmap::parallel_flat_hash_map_mt,143073280
random,memory,3678959,phmap::parallel_flat_hash_map_mt,147537920
random,memory,3679455,phmap::parallel_flat_hash_map_mt,147537920
random,memory,3679456,phmap::parallel_flat_hash_map_mt,152006656
random,memory,3829988,phmap::parallel_flat_hash_map_mt,152006656
random,memory,3830019,phmap::parallel_flat_hash_map_mt,147537920
random,memory,7327631,phmap::parallel_flat_hash_map_mt,147537920
random,memory,7327632,phmap::parallel_flat_hash_map_mt,183267328
random,memory,7327726,phmap::parallel_flat_hash_map_mt,183267328
random,memory,7327727,phmap::parallel_flat_hash_map_mt,174333952
random,memory,7328167,phmap::parallel_flat_hash_map_mt,174333952
random,memory,7328168,phmap::parallel_flat_hash_map_mt,183263232
random,memory,7332754,phmap::parallel_flat_hash_map_mt,183263232
random,memory,7332755,phmap::parallel_flat_hash_map_mt,192196608
random,memory,7334286,phmap::parallel_flat_hash_map_mt,192196608
random,memory,7334287,phmap::parallel_flat_hash_map_mt,201121792
random,memory,7336335,phmap::parallel_flat_hash_map_mt,201121792
random,memory,7336336,phmap::parallel_flat_hash_map_mt,210059264
random,memory,7337725,phmap::parallel_flat_hash_map_mt,210059264
random,memory,7337726,phmap::parallel_flat_hash_map_mt,218984448
random,memory,7339260,phmap::parallel_flat_hash_map_mt,218984448
random,memory,7339261,phmap::parallel_flat_hash_map_mt,227909632
random,memory,7340643,phmap::parallel_flat_hash_map_mt,227909632
random,memory,7340644,phmap::parallel_flat_hash_map_mt,236838912
random,memory,7342329,phmap::parallel_flat_hash_map_mt,236838912
random,memory,7342330,phmap::parallel_flat_hash_map_mt,245776384
random,memory,7343707,phmap::parallel_flat_hash_map_mt,245776384
random,memory,7343708,phmap::parallel_flat_hash_map_mt,254709760
random,memory,7344092,phmap::parallel_flat_hash_map_mt,254709760
random,memory,7344093,phmap::parallel_flat_hash_map_mt,263639040
random,memory,7344454,phmap::parallel_flat_hash_map_mt,263639040
random,memory,7344529,phmap::parallel_flat_hash_map_mt,254705664
random,memory,7349960,phmap::parallel_flat_hash_map_mt,254705664
random,memory,7349961,phmap::parallel_flat_hash_map_mt,272572416
random,memory,7350165,phmap::parallel_flat_hash_map_mt,272572416
random,memory,7350166,phmap::parallel_flat_hash_map_mt,281497600
random,memory,7353807,phmap::parallel_flat_hash_map_mt,281497600
random,memory,7353808,phmap::parallel_flat_hash_map_mt,290430976
random,memory,7354809,phmap::parallel_flat_hash_map_mt,290430976
random,memory,7354810,phmap::parallel_flat_hash_map_mt,299356160
random,memory,7359696,phmap::parallel_flat_hash_map_mt,299356160
random,memory,7359779,phmap::parallel_flat_hash_map_mt,290422784
random,time,10000000,phmap::parallel_flat_hash_map_mt,0.788000
random,memory,10043554,phmap::parallel_flat_hash_map_mt,288821248
random,memory,14660773,phmap::parallel_flat_hash_map_mt,288821248
random,memory,14660774,phmap::parallel_flat_hash_map_mt,324546560
random,memory,14668394,phmap::parallel_flat_hash_map_mt,324546560
random,memory,14668395,phmap::parallel_flat_hash_map_mt,342409216
random,memory,14670081,phmap::parallel_flat_hash_map_mt,342409216
random,memory,14670082,phmap::parallel_flat_hash_map_mt,360271872
random,memory,14670721,phmap::parallel_flat_hash_map_mt,360271872
random,memory,14670722,phmap::parallel_flat_hash_map_mt,378126336
random,memory,14673268,phmap::parallel_flat_hash_map_mt,378126336
random,memory,14673269,phmap::parallel_flat_hash_map_mt,395984896
random,memory,14675927,phmap::parallel_flat_hash_map_mt,395984896
random,memory,14675929,phmap::parallel_flat_hash_map_mt,413843456
random,memory,14677274,phmap::parallel_flat_hash_map_mt,413843456
random,memory,14677275,phmap::parallel_flat_hash_map_mt,431706112
random,memory,14679690,phmap::parallel_flat_hash_map_mt,431706112
random,memory,14679691,phmap::parallel_flat_hash_map_mt,449564672
random,memory,14680028,phmap::parallel_flat_hash_map_mt,449564672
random,memory,14680031,phmap::parallel_flat_hash_map_mt,431702016
random,memory,14682548,phmap::parallel_flat_hash_map_mt,431702016
random,memory,14682549,phmap::parallel_flat_hash_map_mt,467423232
random,memory,14683242,phmap::parallel_flat_hash_map_mt,467423232
random,memory,14683243,phmap::parallel_flat_hash_map_mt,485289984
random,memory,14684510,phmap::parallel_flat_hash_map_mt,485289984
random,memory,14684511,phmap::parallel_flat_hash_map_mt,503152640
random,memory,14685762,phmap::parallel_flat_hash_map_mt,503152640
random,memory,14685763,phmap::parallel_flat_hash_map_mt,521015296
random,memory,14687183,phmap::parallel_flat_hash_map_mt,521015296
random,memory,14687184,phmap::parallel_flat_hash_map_mt,538873856
random,memory,14687856,phmap::parallel_flat_hash_map_mt,538873856
random,memory,14687857,phmap::parallel_flat_hash_map_mt,556740608
random,memory,14688774,phmap::parallel_flat_hash_map_mt,556740608
random,memory,14688775,phmap::parallel_flat_hash_map_mt,574595072
random,memory,14708553,phmap::parallel_flat_hash_map_mt,574595072
random,memory,14708554,phmap::parallel_flat_hash_map_mt,592453632
random,memory,14952078,phmap::parallel_flat_hash_map_mt,592453632
random,memory,14952197,phmap::parallel_flat_hash_map_mt,574582784
random,time,20000000,phmap::parallel_flat_hash_map_mt,1.615000
random,memory,20008974,phmap::parallel_flat_hash_map_mt,574586880
random,memory,29333764,phmap::parallel_flat_hash_map_mt,574586880
random,memory,29333765,phmap::parallel_flat_hash_map_mt,646033408
random,memory,29334022,phmap::parallel_flat_hash_map_mt,646033408
random,memory,29334023,phmap::parallel_flat_hash_map_mt,681766912
random,memory,29342949,phmap::parallel_flat_hash_map_mt,681766912
random,memory,29342950,phmap::parallel_flat_hash_map_mt,717488128
random,memory,29345586,phmap::parallel_flat_hash_map_mt,717488128
random,memory,29345587,phmap::parallel_flat_hash_map_mt,753205248
random,memory,29347489,phmap::parallel_flat_hash_map_mt,753205248
random,memory,29347490,phmap::parallel_flat_hash_map_mt,788930560
random,memory,29348504,phmap::parallel_flat_hash_map_mt,788930560
random,memory,29348542,phmap::parallel_flat_hash_map_mt,753209344
random,memory,29349198,phmap::parallel_flat_hash_map_mt,753209344
random,memory,29349199,phmap::parallel_flat_hash_map_mt,824655872
random,memory,29352494,phmap::parallel_flat_hash_map_mt,824655872
random,memory,29352495,phmap::parallel_flat_hash_map_mt,860377088
random,memory,29358759,phmap::parallel_flat_hash_map_mt,860377088
random,memory,29358760,phmap::parallel_flat_hash_map_mt,896094208
random,memory,29361234,phmap::parallel_flat_hash_map_mt,896094208
random,memory,29361235,phmap::parallel_flat_hash_map_mt,931811328
random,memory,29362544,phmap::parallel_flat_hash_map_mt,931811328
random,memory,29362545,phmap::parallel_flat_hash_map_mt,967536640
random,memory,29369457,phmap::parallel_flat_hash_map_mt,967536640
random,memory,29369458,phmap::parallel_flat_hash_map_mt,1003257856
random,memory,29372921,phmap::parallel_flat_hash_map_mt,1003257856
random,memory,29372922,phmap::parallel_flat_hash_map_mt,1038979072
random,memory,29374936,phmap::parallel_flat_hash_map_mt,1038979072
random,memory,29374937,phmap::parallel_flat_hash_map_mt,1074696192
random,memory,29383512,phmap::parallel_flat_hash_map_mt,1074696192
random,memory,29383513,phmap::parallel_flat_hash_map_mt,1110417408
random,memory,29383512,phmap::parallel_flat_hash_map_mt,1110417408
random,memory,29383513,phmap::parallel_flat_hash_map_mt,1181863936
random,memory,29474438,phmap::parallel_flat_hash_map_mt,1181851648
random,memory,29475679,phmap::parallel_flat_hash_map_mt,1146126336
random,time,30000000,phmap::parallel_flat_hash_map_mt,2.718000
random,memory,30039213,phmap::parallel_flat_hash_map_mt,1146114048
random,time,40000000,phmap::parallel_flat_hash_map_mt,3.314000
random,memory,40063406,phmap::parallel_flat_hash_map_mt,1146126336
random,time,50000000,phmap::parallel_flat_hash_map_mt,3.930000
random,memory,50000796,phmap::parallel_flat_hash_map_mt,1146003456
random,memory,58662905,phmap::parallel_flat_hash_map_mt,1146118144
random,memory,58662906,phmap::parallel_flat_hash_map_mt,1289007104
random,memory,58690501,phmap::parallel_flat_hash_map_mt,1289007104
random,memory,58690502,phmap::parallel_flat_hash_map_mt,1360453632
random,memory,58698182,phmap::parallel_flat_hash_map_mt,1360453632
random,memory,58698183,phmap::parallel_flat_hash_map_mt,1431904256
random,memory,58704661,phmap::parallel_flat_hash_map_mt,1431904256
random,memory,58704662,phmap::parallel_flat_hash_map_mt,1503346688
random,memory,58708120,phmap::parallel_flat_hash_map_mt,1503346688
random,memory,58708121,phmap::parallel_flat_hash_map_mt,1574785024
random,memory,58718704,phmap::parallel_flat_hash_map_mt,1574785024
random,memory,58718705,phmap::parallel_flat_hash_map_mt,1646223360
random,memory,58720588,phmap::parallel_flat_hash_map_mt,1646223360
random,memory,58720589,phmap::parallel_flat_hash_map_mt,1860554752
random,memory,58720613,phmap::parallel_flat_hash_map_mt,1860554752
random,memory,58720614,phmap::parallel_flat_hash_map_mt,1789112320
random,memory,58721807,phmap::parallel_flat_hash_map_mt,1789112320
random,memory,58721808,phmap::parallel_flat_hash_map_mt,1860558848
random,memory,58722210,phmap::parallel_flat_hash_map_mt,1860558848
random,memory,58722854,phmap::parallel_flat_hash_map_mt,1789112320
random,memory,58722853,phmap::parallel_flat_hash_map_mt,1789112320
random,memory,58722854,phmap::parallel_flat_hash_map_mt,1931997184
random,memory,58723270,phmap::parallel_flat_hash_map_mt,1931997184
random,memory,58723271,phmap::parallel_flat_hash_map_mt,2003435520
random,memory,58725728,phmap::parallel_flat_hash_map_mt,2003435520
random,memory,58725729,phmap::parallel_flat_hash_map_mt,2074873856
random,memory,58729127,phmap::parallel_flat_hash_map_mt,2074873856
random,memory,58729128,phmap::parallel_flat_hash_map_mt,2146328576
random,memory,58738897,phmap::parallel_flat_hash_map_mt,2146328576
random,memory,58738898,phmap::parallel_flat_hash_map_mt,2217775104
random,memory,58747088,phmap::parallel_flat_hash_map_mt,2217775104
random,memory,58747089,phmap::parallel_flat_hash_map_mt,2289213440
random,memory,58790495,phmap::parallel_flat_hash_map_mt,2289213440
random,memory,58790496,phmap::parallel_flat_hash_map_mt,2360659968
random,memory,58912378,phmap::parallel_flat_hash_map_mt,2360659968
random,memory,58915332,phmap::parallel_flat_hash_map_mt,2289213440
random,time,60000000,phmap::parallel_flat_hash_map_mt,5.665000
random,memory,60121415,phmap::parallel_flat_hash_map_mt,2289217536
random,time,70000000,phmap::parallel_flat_hash_map_mt,6.304000
random,memory,70000000,phmap::parallel_flat_hash_map_mt,2289008640
random,time,80000000,phmap::parallel_flat_hash_map_mt,6.942000
random,memory,80007185,phmap::parallel_flat_hash_map_mt,2289209344
random,time,90000000,phmap::parallel_flat_hash_map_mt,7.608000
random,memory,90008872,phmap::parallel_flat_hash_map_mt,2289201152
random,time,100000000,phmap::parallel_flat_hash_map_mt,8.286000

View File

@ -1,315 +0,0 @@
random,memory,0,absl::flat_hash_map,15745024
random,memory,238685,absl::flat_hash_map,15745024
random,memory,238809,absl::flat_hash_map,11276288
random,memory,458751,absl::flat_hash_map,11276288
random,memory,458752,absl::flat_hash_map,29143040
random,memory,485817,absl::flat_hash_map,29143040
random,memory,486085,absl::flat_hash_map,20209664
random,memory,675678,absl::flat_hash_map,20209664
random,memory,675893,absl::flat_hash_map,19091456
random,memory,917503,absl::flat_hash_map,19091456
random,memory,917504,absl::flat_hash_map,54816768
random,memory,927664,absl::flat_hash_map,54816768
random,memory,927716,absl::flat_hash_map,36950016
random,memory,1835007,absl::flat_hash_map,36950016
random,memory,1835008,absl::flat_hash_map,108396544
random,memory,1855763,absl::flat_hash_map,108396544
random,memory,1855867,absl::flat_hash_map,72671232
random,memory,3670015,absl::flat_hash_map,72671232
random,memory,3670016,absl::flat_hash_map,215560192
random,memory,3677233,absl::flat_hash_map,215560192
random,memory,3677313,absl::flat_hash_map,144113664
random,memory,7340031,absl::flat_hash_map,144113664
random,memory,7340032,absl::flat_hash_map,429887488
random,memory,7344858,absl::flat_hash_map,429887488
random,memory,7344912,absl::flat_hash_map,286998528
random,time,10000000,absl::flat_hash_map,0.935000
random,memory,10007722,absl::flat_hash_map,286998528
random,memory,14680063,absl::flat_hash_map,286998528
random,memory,14680064,absl::flat_hash_map,858546176
random,memory,14682782,absl::flat_hash_map,858546176
random,memory,14682830,absl::flat_hash_map,572768256
random,time,20000000,absl::flat_hash_map,2.244000
random,memory,20010261,absl::flat_hash_map,572768256
random,memory,29360127,absl::flat_hash_map,572768256
random,memory,29360128,absl::flat_hash_map,1715859456
random,memory,29363189,absl::flat_hash_map,1715859456
random,memory,29363226,absl::flat_hash_map,1144311808
random,time,30000000,absl::flat_hash_map,3.899000
random,memory,30008430,absl::flat_hash_map,1144311808
random,time,40000000,absl::flat_hash_map,5.165000
random,memory,40003909,absl::flat_hash_map,1144311808
random,time,50000000,absl::flat_hash_map,6.428000
random,memory,50001112,absl::flat_hash_map,1144311808
random,memory,58720255,absl::flat_hash_map,1144311808
random,memory,58720256,absl::flat_hash_map,3430490112
random,memory,58728488,absl::flat_hash_map,3430490112
random,memory,58728529,absl::flat_hash_map,2287411200
random,time,60000000,absl::flat_hash_map,8.813000
random,memory,60004544,absl::flat_hash_map,2287411200
random,time,70000000,absl::flat_hash_map,10.289000
random,memory,70001141,absl::flat_hash_map,2287411200
random,time,80000000,absl::flat_hash_map,11.765000
random,memory,80002276,absl::flat_hash_map,2287411200
random,time,90000000,absl::flat_hash_map,13.235000
random,memory,90011453,absl::flat_hash_map,2287411200
random,time,100000000,absl::flat_hash_map,14.683000
random,memory,0,absl::parallel_flat_hash_map_mt,8097792
random,memory,226683,absl::parallel_flat_hash_map_mt,8101888
random,memory,226684,absl::parallel_flat_hash_map_mt,9236480
random,memory,233565,absl::parallel_flat_hash_map_mt,9236480
random,memory,233647,absl::parallel_flat_hash_map_mt,12922880
random,memory,274958,absl::parallel_flat_hash_map_mt,13205504
random,memory,454560,absl::parallel_flat_hash_map_mt,13205504
random,memory,454569,absl::parallel_flat_hash_map_mt,15454208
random,memory,458135,absl::parallel_flat_hash_map_mt,15454208
random,memory,458136,absl::parallel_flat_hash_map_mt,20520960
random,memory,464748,absl::parallel_flat_hash_map_mt,20520960
random,memory,464749,absl::parallel_flat_hash_map_mt,23891968
random,memory,585537,absl::parallel_flat_hash_map_mt,24461312
random,memory,904457,absl::parallel_flat_hash_map_mt,24461312
random,memory,904458,absl::parallel_flat_hash_map_mt,25587712
random,memory,906298,absl::parallel_flat_hash_map_mt,25587712
random,memory,906305,absl::parallel_flat_hash_map_mt,22061056
random,memory,912070,absl::parallel_flat_hash_map_mt,22061056
random,memory,912071,absl::parallel_flat_hash_map_mt,25481216
random,memory,913175,absl::parallel_flat_hash_map_mt,25481216
random,memory,913176,absl::parallel_flat_hash_map_mt,28229632
random,memory,916122,absl::parallel_flat_hash_map_mt,28229632
random,memory,916123,absl::parallel_flat_hash_map_mt,29917184
random,memory,917759,absl::parallel_flat_hash_map_mt,29917184
random,memory,917760,absl::parallel_flat_hash_map_mt,31617024
random,memory,921180,absl::parallel_flat_hash_map_mt,31617024
random,memory,921181,absl::parallel_flat_hash_map_mt,34426880
random,memory,923206,absl::parallel_flat_hash_map_mt,34426880
random,memory,923207,absl::parallel_flat_hash_map_mt,37249024
random,memory,932268,absl::parallel_flat_hash_map_mt,37249024
random,memory,932269,absl::parallel_flat_hash_map_mt,39493632
random,memory,960264,absl::parallel_flat_hash_map_mt,39972864
random,memory,1818080,absl::parallel_flat_hash_map_mt,39972864
random,memory,1818081,absl::parallel_flat_hash_map_mt,42213376
random,memory,1818368,absl::parallel_flat_hash_map_mt,43331584
random,memory,1824622,absl::parallel_flat_hash_map_mt,44445696
random,memory,1825724,absl::parallel_flat_hash_map_mt,44445696
random,memory,1825725,absl::parallel_flat_hash_map_mt,46682112
random,memory,1827670,absl::parallel_flat_hash_map_mt,47800320
random,memory,1829247,absl::parallel_flat_hash_map_mt,47800320
random,memory,1829248,absl::parallel_flat_hash_map_mt,52269056
random,memory,1833459,absl::parallel_flat_hash_map_mt,52264960
random,memory,1833460,absl::parallel_flat_hash_map_mt,56733696
random,memory,1835812,absl::parallel_flat_hash_map_mt,56729600
random,memory,1835813,absl::parallel_flat_hash_map_mt,60080128
random,memory,1836350,absl::parallel_flat_hash_map_mt,60080128
random,memory,1836351,absl::parallel_flat_hash_map_mt,63438848
random,memory,1837412,absl::parallel_flat_hash_map_mt,64548864
random,memory,1838938,absl::parallel_flat_hash_map_mt,64548864
random,memory,1838939,absl::parallel_flat_hash_map_mt,66777088
random,memory,1839594,absl::parallel_flat_hash_map_mt,67891200
random,memory,1841385,absl::parallel_flat_hash_map_mt,67891200
random,memory,1841386,absl::parallel_flat_hash_map_mt,70123520
random,memory,1843499,absl::parallel_flat_hash_map_mt,70123520
random,memory,1843500,absl::parallel_flat_hash_map_mt,74596352
random,memory,1851800,absl::parallel_flat_hash_map_mt,76824576
random,memory,1881249,absl::parallel_flat_hash_map_mt,76824576
random,memory,1881322,absl::parallel_flat_hash_map_mt,75706368
random,memory,3642650,absl::parallel_flat_hash_map_mt,75706368
random,memory,3642651,absl::parallel_flat_hash_map_mt,80175104
random,memory,3650189,absl::parallel_flat_hash_map_mt,82411520
random,memory,3658302,absl::parallel_flat_hash_map_mt,84652032
random,memory,3659792,absl::parallel_flat_hash_map_mt,86884352
random,memory,3660327,absl::parallel_flat_hash_map_mt,89116672
random,memory,3662326,absl::parallel_flat_hash_map_mt,89116672
random,memory,3662327,absl::parallel_flat_hash_map_mt,95813632
random,memory,3666371,absl::parallel_flat_hash_map_mt,95817728
random,memory,3666372,absl::parallel_flat_hash_map_mt,102522880
random,memory,3667092,absl::parallel_flat_hash_map_mt,104767488
random,memory,3667485,absl::parallel_flat_hash_map_mt,104767488
random,memory,3667486,absl::parallel_flat_hash_map_mt,111464448
random,memory,3668276,absl::parallel_flat_hash_map_mt,111464448
random,memory,3668277,absl::parallel_flat_hash_map_mt,115920896
random,memory,3670350,absl::parallel_flat_hash_map_mt,118145024
random,memory,3671585,absl::parallel_flat_hash_map_mt,120381440
random,memory,3672959,absl::parallel_flat_hash_map_mt,122617856
random,memory,3673809,absl::parallel_flat_hash_map_mt,122617856
random,memory,3673810,absl::parallel_flat_hash_map_mt,129314816
random,memory,3675897,absl::parallel_flat_hash_map_mt,131547136
random,memory,3676555,absl::parallel_flat_hash_map_mt,133783552
random,memory,3676779,absl::parallel_flat_hash_map_mt,136015872
random,memory,3677839,absl::parallel_flat_hash_map_mt,138244096
random,memory,3678355,absl::parallel_flat_hash_map_mt,140472320
random,memory,3678866,absl::parallel_flat_hash_map_mt,142700544
random,memory,3690202,absl::parallel_flat_hash_map_mt,142700544
random,memory,3690203,absl::parallel_flat_hash_map_mt,149397504
random,memory,3722970,absl::parallel_flat_hash_map_mt,149393408
random,memory,3723091,absl::parallel_flat_hash_map_mt,147161088
random,memory,7304291,absl::parallel_flat_hash_map_mt,147161088
random,memory,7304305,absl::parallel_flat_hash_map_mt,156094464
random,memory,7317618,absl::parallel_flat_hash_map_mt,160567296
random,memory,7321953,absl::parallel_flat_hash_map_mt,165027840
random,memory,7324203,absl::parallel_flat_hash_map_mt,169492480
random,memory,7327095,absl::parallel_flat_hash_map_mt,173953024
random,memory,7329008,absl::parallel_flat_hash_map_mt,178417664
random,memory,7330112,absl::parallel_flat_hash_map_mt,182886400
random,memory,7330870,absl::parallel_flat_hash_map_mt,187346944
random,memory,7332208,absl::parallel_flat_hash_map_mt,191815680
random,memory,7332866,absl::parallel_flat_hash_map_mt,196280320
random,memory,7333480,absl::parallel_flat_hash_map_mt,196280320
random,memory,7333481,absl::parallel_flat_hash_map_mt,209686528
random,memory,7336329,absl::parallel_flat_hash_map_mt,214155264
random,memory,7337014,absl::parallel_flat_hash_map_mt,218624000
random,memory,7338084,absl::parallel_flat_hash_map_mt,223092736
random,memory,7338525,absl::parallel_flat_hash_map_mt,227553280
random,memory,7340267,absl::parallel_flat_hash_map_mt,232026112
random,memory,7340739,absl::parallel_flat_hash_map_mt,236490752
random,memory,7342416,absl::parallel_flat_hash_map_mt,240955392
random,memory,7343877,absl::parallel_flat_hash_map_mt,245415936
random,memory,7348892,absl::parallel_flat_hash_map_mt,245415936
random,memory,7348911,absl::parallel_flat_hash_map_mt,240947200
random,memory,7349331,absl::parallel_flat_hash_map_mt,240947200
random,memory,7349332,absl::parallel_flat_hash_map_mt,249876480
random,memory,7349765,absl::parallel_flat_hash_map_mt,254345216
random,memory,7349943,absl::parallel_flat_hash_map_mt,258818048
random,memory,7351616,absl::parallel_flat_hash_map_mt,263278592
random,memory,7352328,absl::parallel_flat_hash_map_mt,267739136
random,memory,7352954,absl::parallel_flat_hash_map_mt,272199680
random,memory,7353831,absl::parallel_flat_hash_map_mt,276664320
random,memory,7360307,absl::parallel_flat_hash_map_mt,281124864
random,memory,7360322,absl::parallel_flat_hash_map_mt,281124864
random,memory,7360340,absl::parallel_flat_hash_map_mt,276656128
random,memory,7362083,absl::parallel_flat_hash_map_mt,276656128
random,memory,7362084,absl::parallel_flat_hash_map_mt,285589504
random,memory,7368696,absl::parallel_flat_hash_map_mt,290050048
random,memory,7370511,absl::parallel_flat_hash_map_mt,294510592
random,memory,7545581,absl::parallel_flat_hash_map_mt,294510592
random,memory,7545600,absl::parallel_flat_hash_map_mt,290041856
random,time,10000000,absl::parallel_flat_hash_map_mt,0.685000
random,memory,10125610,absl::parallel_flat_hash_map_mt,290045952
random,memory,14624490,absl::parallel_flat_hash_map_mt,290045952
random,memory,14624491,absl::parallel_flat_hash_map_mt,307908608
random,memory,14640456,absl::parallel_flat_hash_map_mt,316846080
random,memory,14645771,absl::parallel_flat_hash_map_mt,325771264
random,memory,14646996,absl::parallel_flat_hash_map_mt,334704640
random,memory,14657141,absl::parallel_flat_hash_map_mt,334704640
random,memory,14657247,absl::parallel_flat_hash_map_mt,325775360
random,memory,14658963,absl::parallel_flat_hash_map_mt,325775360
random,memory,14658964,absl::parallel_flat_hash_map_mt,343642112
random,memory,14659931,absl::parallel_flat_hash_map_mt,352571392
random,memory,14665267,absl::parallel_flat_hash_map_mt,352571392
random,memory,14665268,absl::parallel_flat_hash_map_mt,379363328
random,memory,14670387,absl::parallel_flat_hash_map_mt,379363328
random,memory,14670388,absl::parallel_flat_hash_map_mt,397221888
random,memory,14671763,absl::parallel_flat_hash_map_mt,397221888
random,memory,14671764,absl::parallel_flat_hash_map_mt,424009728
random,memory,14677622,absl::parallel_flat_hash_map_mt,432939008
random,memory,14680084,absl::parallel_flat_hash_map_mt,441864192
random,memory,14680689,absl::parallel_flat_hash_map_mt,450789376
random,memory,14683195,absl::parallel_flat_hash_map_mt,459726848
random,memory,14683950,absl::parallel_flat_hash_map_mt,468652032
random,memory,14688089,absl::parallel_flat_hash_map_mt,477581312
random,memory,14691193,absl::parallel_flat_hash_map_mt,486514688
random,memory,14694936,absl::parallel_flat_hash_map_mt,495443968
random,memory,14696388,absl::parallel_flat_hash_map_mt,504377344
random,memory,14697737,absl::parallel_flat_hash_map_mt,513314816
random,memory,14698140,absl::parallel_flat_hash_map_mt,522248192
random,memory,14699618,absl::parallel_flat_hash_map_mt,531177472
random,memory,14700009,absl::parallel_flat_hash_map_mt,540110848
random,memory,14700466,absl::parallel_flat_hash_map_mt,540110848
random,memory,14700467,absl::parallel_flat_hash_map_mt,566910976
random,memory,14716491,absl::parallel_flat_hash_map_mt,575832064
random,memory,14739622,absl::parallel_flat_hash_map_mt,584757248
random,memory,14831157,absl::parallel_flat_hash_map_mt,584757248
random,memory,14831255,absl::parallel_flat_hash_map_mt,575823872
random,time,20000000,absl::parallel_flat_hash_map_mt,1.386000
random,memory,20162525,absl::parallel_flat_hash_map_mt,575811584
random,memory,29290166,absl::parallel_flat_hash_map_mt,575811584
random,memory,29290167,absl::parallel_flat_hash_map_mt,611536896
random,memory,29290166,absl::parallel_flat_hash_map_mt,611536896
random,memory,29290167,absl::parallel_flat_hash_map_mt,647262208
random,memory,29308217,absl::parallel_flat_hash_map_mt,665128960
random,memory,29316853,absl::parallel_flat_hash_map_mt,682983424
random,memory,29322818,absl::parallel_flat_hash_map_mt,682983424
random,memory,29322819,absl::parallel_flat_hash_map_mt,736567296
random,memory,29335771,absl::parallel_flat_hash_map_mt,754425856
random,memory,29341930,absl::parallel_flat_hash_map_mt,772284416
random,memory,29343145,absl::parallel_flat_hash_map_mt,790142976
random,memory,29350232,absl::parallel_flat_hash_map_mt,808005632
random,memory,29354162,absl::parallel_flat_hash_map_mt,825868288
random,memory,29356843,absl::parallel_flat_hash_map_mt,843722752
random,memory,29362327,absl::parallel_flat_hash_map_mt,843722752
random,memory,29362363,absl::parallel_flat_hash_map_mt,825860096
random,memory,29366343,absl::parallel_flat_hash_map_mt,825860096
random,memory,29366344,absl::parallel_flat_hash_map_mt,861585408
random,memory,29369094,absl::parallel_flat_hash_map_mt,879448064
random,memory,29370268,absl::parallel_flat_hash_map_mt,897310720
random,memory,29370522,absl::parallel_flat_hash_map_mt,897310720
random,memory,29370585,absl::parallel_flat_hash_map_mt,879452160
random,memory,29371240,absl::parallel_flat_hash_map_mt,879452160
random,memory,29371241,absl::parallel_flat_hash_map_mt,915177472
random,memory,29377637,absl::parallel_flat_hash_map_mt,933036032
random,memory,29378552,absl::parallel_flat_hash_map_mt,950894592
random,memory,29380612,absl::parallel_flat_hash_map_mt,968757248
random,memory,29382146,absl::parallel_flat_hash_map_mt,986615808
random,memory,29383649,absl::parallel_flat_hash_map_mt,1004474368
random,memory,29386774,absl::parallel_flat_hash_map_mt,1022328832
random,memory,29391253,absl::parallel_flat_hash_map_mt,1040187392
random,memory,29392067,absl::parallel_flat_hash_map_mt,1058045952
random,memory,29393223,absl::parallel_flat_hash_map_mt,1075908608
random,memory,29397664,absl::parallel_flat_hash_map_mt,1093763072
random,memory,29397820,absl::parallel_flat_hash_map_mt,1111621632
random,memory,29402968,absl::parallel_flat_hash_map_mt,1129480192
random,memory,29416940,absl::parallel_flat_hash_map_mt,1147346944
random,memory,29425034,absl::parallel_flat_hash_map_mt,1165201408
random,memory,29437495,absl::parallel_flat_hash_map_mt,1165201408
random,memory,29437615,absl::parallel_flat_hash_map_mt,1147342848
random,time,30000000,absl::parallel_flat_hash_map_mt,2.397000
random,memory,30000064,absl::parallel_flat_hash_map_mt,1147179008
random,time,40000000,absl::parallel_flat_hash_map_mt,2.894000
random,memory,40092788,absl::parallel_flat_hash_map_mt,1147342848
random,time,50000000,absl::parallel_flat_hash_map_mt,3.419000
random,memory,50016621,absl::parallel_flat_hash_map_mt,1147351040
random,memory,58617730,absl::parallel_flat_hash_map_mt,1147351040
random,memory,58617731,absl::parallel_flat_hash_map_mt,1218797568
random,memory,58624447,absl::parallel_flat_hash_map_mt,1254522880
random,memory,58647163,absl::parallel_flat_hash_map_mt,1290244096
random,memory,58652294,absl::parallel_flat_hash_map_mt,1290244096
random,memory,58652331,absl::parallel_flat_hash_map_mt,1254518784
random,memory,58657858,absl::parallel_flat_hash_map_mt,1254518784
random,memory,58657859,absl::parallel_flat_hash_map_mt,1325965312
random,memory,58672238,absl::parallel_flat_hash_map_mt,1361690624
random,memory,58684143,absl::parallel_flat_hash_map_mt,1361690624
random,memory,58684144,absl::parallel_flat_hash_map_mt,1468854272
random,memory,58686216,absl::parallel_flat_hash_map_mt,1504571392
random,memory,58705047,absl::parallel_flat_hash_map_mt,1540292608
random,memory,58707030,absl::parallel_flat_hash_map_mt,1576017920
random,memory,58713785,absl::parallel_flat_hash_map_mt,1611739136
random,memory,58719051,absl::parallel_flat_hash_map_mt,1647460352
random,memory,58719339,absl::parallel_flat_hash_map_mt,1683181568
random,memory,58721442,absl::parallel_flat_hash_map_mt,1718906880
random,memory,58722510,absl::parallel_flat_hash_map_mt,1754628096
random,memory,58731866,absl::parallel_flat_hash_map_mt,1790353408
random,memory,58732950,absl::parallel_flat_hash_map_mt,1826086912
random,memory,58733354,absl::parallel_flat_hash_map_mt,1861804032
random,memory,58734852,absl::parallel_flat_hash_map_mt,1897525248
random,memory,58735358,absl::parallel_flat_hash_map_mt,1933242368
random,memory,58739746,absl::parallel_flat_hash_map_mt,1968967680
random,memory,58739993,absl::parallel_flat_hash_map_mt,2004692992
random,memory,58745310,absl::parallel_flat_hash_map_mt,2040410112
random,memory,58746926,absl::parallel_flat_hash_map_mt,2076135424
random,memory,58747125,absl::parallel_flat_hash_map_mt,2111860736
random,memory,58756624,absl::parallel_flat_hash_map_mt,2147586048
random,memory,58769646,absl::parallel_flat_hash_map_mt,2183303168
random,memory,58771866,absl::parallel_flat_hash_map_mt,2219024384
random,memory,58789875,absl::parallel_flat_hash_map_mt,2254741504
random,memory,58798355,absl::parallel_flat_hash_map_mt,2290466816
random,memory,58824040,absl::parallel_flat_hash_map_mt,2326183936
random,memory,59024387,absl::parallel_flat_hash_map_mt,2326183936
random,memory,59024466,absl::parallel_flat_hash_map_mt,2290458624
random,time,60000000,absl::parallel_flat_hash_map_mt,4.973000
random,memory,60000000,absl::parallel_flat_hash_map_mt,2290229248
random,time,70000000,absl::parallel_flat_hash_map_mt,5.544000
random,memory,70133805,absl::parallel_flat_hash_map_mt,2290458624
random,time,80000000,absl::parallel_flat_hash_map_mt,6.054000
random,memory,80033533,absl::parallel_flat_hash_map_mt,2290458624
random,time,90000000,absl::parallel_flat_hash_map_mt,6.624000
random,memory,90023483,absl::parallel_flat_hash_map_mt,2290458624
random,time,100000000,absl::parallel_flat_hash_map_mt,7.175000

View File

@ -1,104 +0,0 @@
random,memory,0,absl::parallel_flat_hash_map,41910272
random,memory,924422,absl::parallel_flat_hash_map,41910272
random,memory,924433,absl::parallel_flat_hash_map,44146688
random,memory,952903,absl::parallel_flat_hash_map,44146688
random,memory,953013,absl::parallel_flat_hash_map,40779776
random,memory,1010078,absl::parallel_flat_hash_map,40779776
random,memory,1010200,absl::parallel_flat_hash_map,38539264
random,memory,1863512,absl::parallel_flat_hash_map,38539264
random,memory,1863540,absl::parallel_flat_hash_map,85454848
random,memory,2941624,absl::parallel_flat_hash_map,85454848
random,memory,2941816,absl::parallel_flat_hash_map,74272768
random,memory,3683917,absl::parallel_flat_hash_map,74272768
random,memory,3683918,absl::parallel_flat_hash_map,154685440
random,memory,3692980,absl::parallel_flat_hash_map,154685440
random,memory,3693011,absl::parallel_flat_hash_map,168075264
random,memory,4474443,absl::parallel_flat_hash_map,168075264
random,memory,4474556,absl::parallel_flat_hash_map,145719296
random,memory,6754095,absl::parallel_flat_hash_map,145707008
random,memory,6754147,absl::parallel_flat_hash_map,226099200
random,memory,7294556,absl::parallel_flat_hash_map,226099200
random,memory,7294670,absl::parallel_flat_hash_map,235036672
random,memory,7983489,absl::parallel_flat_hash_map,235036672
random,memory,7983651,absl::parallel_flat_hash_map,261820416
random,memory,8242552,absl::parallel_flat_hash_map,261820416
random,memory,8242691,absl::parallel_flat_hash_map,252887040
random,memory,8949833,absl::parallel_flat_hash_map,252887040
random,memory,8949892,absl::parallel_flat_hash_map,305504256
random,memory,8987991,absl::parallel_flat_hash_map,305475584
random,memory,8988323,absl::parallel_flat_hash_map,296538112
random,memory,9004502,absl::parallel_flat_hash_map,296538112
random,memory,9004594,absl::parallel_flat_hash_map,287604736
random,time,10000000,absl::parallel_flat_hash_map,0.471000
random,memory,10862319,absl::parallel_flat_hash_map,287756288
random,memory,14670115,absl::parallel_flat_hash_map,287756288
random,memory,14670116,absl::parallel_flat_hash_map,573566976
random,memory,14678079,absl::parallel_flat_hash_map,573566976
random,memory,14678102,absl::parallel_flat_hash_map,627142656
random,memory,14690163,absl::parallel_flat_hash_map,627142656
random,memory,14690164,absl::parallel_flat_hash_map,716455936
random,memory,15024573,absl::parallel_flat_hash_map,716455936
random,memory,15024686,absl::parallel_flat_hash_map,591388672
random,memory,15476837,absl::parallel_flat_hash_map,591388672
random,memory,15476994,absl::parallel_flat_hash_map,573521920
random,time,20000000,absl::parallel_flat_hash_map,0.956000
random,memory,20410280,absl::parallel_flat_hash_map,573497344
random,memory,29273379,absl::parallel_flat_hash_map,573497344
random,memory,29273380,absl::parallel_flat_hash_map,1073627136
random,memory,29353638,absl::parallel_flat_hash_map,1073627136
random,memory,29353639,absl::parallel_flat_hash_map,1252241408
random,memory,29686553,absl::parallel_flat_hash_map,1287847936
random,memory,29688294,absl::parallel_flat_hash_map,1287847936
random,memory,29688316,absl::parallel_flat_hash_map,1252122624
random,memory,29707720,absl::parallel_flat_hash_map,1252122624
random,memory,29707784,absl::parallel_flat_hash_map,1180663808
random,memory,29924480,absl::parallel_flat_hash_map,1180577792
random,memory,29924509,absl::parallel_flat_hash_map,1144856576
random,time,30000000,absl::parallel_flat_hash_map,1.567000
random,memory,30708549,absl::parallel_flat_hash_map,1145061376
random,time,40000000,absl::parallel_flat_hash_map,1.993000
random,memory,40790845,absl::parallel_flat_hash_map,1145049088
random,time,50000000,absl::parallel_flat_hash_map,2.423000
random,memory,50009479,absl::parallel_flat_hash_map,1145065472
random,memory,58110357,absl::parallel_flat_hash_map,1145065472
random,memory,58110423,absl::parallel_flat_hash_map,1716617216
random,memory,58545607,absl::parallel_flat_hash_map,1716617216
random,memory,58545651,absl::parallel_flat_hash_map,1859506176
random,memory,58671713,absl::parallel_flat_hash_map,1859506176
random,memory,58672142,absl::parallel_flat_hash_map,2002403328
random,memory,58697955,absl::parallel_flat_hash_map,2002403328
random,memory,58697956,absl::parallel_flat_hash_map,2288181248
random,memory,58704727,absl::parallel_flat_hash_map,2288181248
random,memory,58704728,absl::parallel_flat_hash_map,2359627776
random,memory,58705597,absl::parallel_flat_hash_map,2359627776
random,memory,58705598,absl::parallel_flat_hash_map,2288181248
random,memory,58730957,absl::parallel_flat_hash_map,2288181248
random,memory,58730958,absl::parallel_flat_hash_map,2573950976
random,memory,58736077,absl::parallel_flat_hash_map,2645401600
random,memory,58736169,absl::parallel_flat_hash_map,2716848128
random,memory,58742702,absl::parallel_flat_hash_map,2716848128
random,memory,58742703,absl::parallel_flat_hash_map,2859741184
random,memory,58787870,absl::parallel_flat_hash_map,2859741184
random,memory,58787918,absl::parallel_flat_hash_map,2716848128
random,memory,58863920,absl::parallel_flat_hash_map,2716848128
random,memory,58863994,absl::parallel_flat_hash_map,2645397504
random,memory,59087411,absl::parallel_flat_hash_map,2645397504
random,memory,59087521,absl::parallel_flat_hash_map,2573955072
random,memory,59355340,absl::parallel_flat_hash_map,2573877248
random,memory,59355391,absl::parallel_flat_hash_map,2502426624
random,memory,59387965,absl::parallel_flat_hash_map,2502426624
random,memory,59388025,absl::parallel_flat_hash_map,2430980096
random,memory,59484220,absl::parallel_flat_hash_map,2430951424
random,memory,59484283,absl::parallel_flat_hash_map,2359500800
random,memory,59503076,absl::parallel_flat_hash_map,2359500800
random,memory,59503156,absl::parallel_flat_hash_map,2288058368
random,time,60000000,absl::parallel_flat_hash_map,3.220000
random,memory,60745902,absl::parallel_flat_hash_map,2288160768
random,time,70000000,absl::parallel_flat_hash_map,3.671000
random,memory,70722318,absl::parallel_flat_hash_map,2288156672
random,time,80000000,absl::parallel_flat_hash_map,4.159000
random,memory,80002281,absl::parallel_flat_hash_map,2288119808
random,time,90000000,absl::parallel_flat_hash_map,4.615000
random,memory,90715643,absl::parallel_flat_hash_map,2288152576
random,time,100000000,absl::parallel_flat_hash_map,5.128000
random,memory,100000000,absl::parallel_flat_hash_map,2287927296

View File

@ -1,446 +0,0 @@
random,memory,0,std::unordered_map,6217728
random,memory,81839,std::unordered_map,6217728
random,memory,81866,std::unordered_map,7081984
random,memory,96791,std::unordered_map,7081984
random,memory,96811,std::unordered_map,7938048
random,memory,108492,std::unordered_map,7938048
random,memory,108510,std::unordered_map,8482816
random,memory,119431,std::unordered_map,8482816
random,memory,119443,std::unordered_map,9027584
random,memory,127648,std::unordered_map,9027584
random,memory,127666,std::unordered_map,9420800
random,memory,131071,std::unordered_map,9420800
random,memory,131072,std::unordered_map,11681792
random,memory,140589,std::unordered_map,11681792
random,memory,140596,std::unordered_map,12238848
random,memory,152717,std::unordered_map,12238848
random,memory,152732,std::unordered_map,12861440
random,memory,164819,std::unordered_map,12861440
random,memory,164832,std::unordered_map,13570048
random,memory,176210,std::unordered_map,13570048
random,memory,176219,std::unordered_map,14192640
random,memory,185598,std::unordered_map,14581760
random,memory,195438,std::unordered_map,14581760
random,memory,195443,std::unordered_map,15126528
random,memory,206045,std::unordered_map,15126528
random,memory,206062,std::unordered_map,15675392
random,memory,216715,std::unordered_map,15675392
random,memory,216726,std::unordered_map,16220160
random,memory,227698,std::unordered_map,16220160
random,memory,227712,std::unordered_map,16764928
random,memory,238365,std::unordered_map,16764928
random,memory,238381,std::unordered_map,17309696
random,memory,248089,std::unordered_map,17309696
random,memory,248095,std::unordered_map,17858560
random,memory,257442,std::unordered_map,18325504
random,memory,262143,std::unordered_map,18325504
random,memory,262144,std::unordered_map,26894336
random,memory,262143,std::unordered_map,26894336
random,memory,262144,std::unordered_map,22691840
random,memory,273217,std::unordered_map,23314432
random,memory,284202,std::unordered_map,23937024
random,memory,294934,std::unordered_map,24403968
random,memory,304770,std::unordered_map,24948736
random,memory,314973,std::unordered_map,25497600
random,memory,325228,std::unordered_map,26046464
random,memory,335546,std::unordered_map,26591232
random,memory,344776,std::unordered_map,26980352
random,memory,353536,std::unordered_map,27525120
random,memory,362203,std::unordered_map,27996160
random,memory,371418,std::unordered_map,28385280
random,memory,380977,std::unordered_map,28852224
random,memory,390397,std::unordered_map,29396992
random,memory,399764,std::unordered_map,29863936
random,memory,409260,std::unordered_map,30334976
random,memory,418252,std::unordered_map,30801920
random,memory,426340,std::unordered_map,31191040
random,memory,434549,std::unordered_map,31657984
random,memory,443151,std::unordered_map,32129024
random,memory,451873,std::unordered_map,32518144
random,memory,460714,std::unordered_map,32985088
random,memory,469657,std::unordered_map,33476608
random,memory,478601,std::unordered_map,33865728
random,memory,487440,std::unordered_map,34336768
random,memory,494742,std::unordered_map,34725888
random,memory,502423,std::unordered_map,35192832
random,memory,518619,std::unordered_map,35971072
random,memory,524287,std::unordered_map,35971072
random,memory,524288,std::unordered_map,53104640
random,memory,524287,std::unordered_map,53104640
random,memory,524288,std::unordered_map,44699648
random,memory,549272,std::unordered_map,45944832
random,memory,558487,std::unordered_map,46411776
random,memory,568160,std::unordered_map,46882816
random,memory,577422,std::unordered_map,47427584
random,memory,605424,std::unordered_map,48828416
random,memory,640487,std::unordered_map,50622464
random,memory,649784,std::unordered_map,51171328
random,memory,684975,std::unordered_map,52965376
random,memory,718904,std::unordered_map,54677504
random,memory,753470,std::unordered_map,56393728
random,memory,787320,std::unordered_map,58187776
random,memory,828012,std::unordered_map,60215296
random,memory,868058,std::unordered_map,62320640
random,memory,906661,std::unordered_map,64348160
random,memory,945911,std::unordered_map,66297856
random,memory,990443,std::unordered_map,68644864
random,memory,1036174,std::unordered_map,70983680
random,memory,1048575,std::unordered_map,71294976
random,memory,1048576,std::unordered_map,105234432
random,memory,1048575,std::unordered_map,105234432
random,memory,1048576,std::unordered_map,88424448
random,memory,1100160,std::unordered_map,91078656
random,memory,1160386,std::unordered_map,94117888
random,memory,1221920,std::unordered_map,97316864
random,memory,1282706,std::unordered_map,100433920
random,memory,1342726,std::unordered_map,103477248
random,memory,1401981,std::unordered_map,106594304
random,memory,1464762,std::unordered_map,109793280
random,memory,1530705,std::unordered_map,113143808
random,memory,1603780,std::unordered_map,116887552
random,memory,1674989,std::unordered_map,120631296
random,memory,1752908,std::unordered_map,124608512
random,memory,1826840,std::unordered_map,128352256
random,memory,1901645,std::unordered_map,132247552
random,memory,1981814,std::unordered_map,136306688
random,memory,2068859,std::unordered_map,140754944
random,memory,2097151,std::unordered_map,141922304
random,memory,2097152,std::unordered_map,209481728
random,memory,2097151,std::unordered_map,209481728
random,memory,2097152,std::unordered_map,175861760
random,memory,2207315,std::unordered_map,181477376
random,memory,2312577,std::unordered_map,186937344
random,memory,2423407,std::unordered_map,192659456
random,memory,2540989,std::unordered_map,198664192
random,memory,2659046,std::unordered_map,204750848
random,memory,2780893,std::unordered_map,210989056
random,memory,2908456,std::unordered_map,217616384
random,memory,3037917,std::unordered_map,224169984
random,memory,3170468,std::unordered_map,230952960
random,memory,3306278,std::unordered_map,237973504
random,memory,3450118,std::unordered_map,245383168
random,memory,3598043,std::unordered_map,252985344
random,memory,3747662,std::unordered_map,260706304
random,memory,3904906,std::unordered_map,268820480
random,memory,4066463,std::unordered_map,277086208
random,memory,4194303,std::unordered_map,283484160
random,memory,4194304,std::unordered_map,418127872
random,memory,4194303,std::unordered_map,418127872
random,memory,4194304,std::unordered_map,350887936
random,memory,4406007,std::unordered_map,361725952
random,memory,4618998,std::unordered_map,372645888
random,memory,4841808,std::unordered_map,384188416
random,memory,5068021,std::unordered_map,395784192
random,memory,5303596,std::unordered_map,407875584
random,memory,5541719,std::unordered_map,420122624
random,memory,5791497,std::unordered_map,432910336
random,memory,6050086,std::unordered_map,446242816
random,memory,6317526,std::unordered_map,459972608
random,memory,6591123,std::unordered_map,474009600
random,memory,6871888,std::unordered_map,488439808
random,memory,7157069,std::unordered_map,503103488
random,memory,7455408,std::unordered_map,518389760
random,memory,7759096,std::unordered_map,533991424
random,memory,8071668,std::unordered_map,550060032
random,memory,8388607,std::unordered_map,566202368
random,memory,8388608,std::unordered_map,835330048
random,memory,8388607,std::unordered_map,835330048
random,memory,8388608,std::unordered_map,700846080
random,memory,8800929,std::unordered_map,721985536
random,memory,9229377,std::unordered_map,743981056
random,memory,9669903,std::unordered_map,766681088
random,time,10000000,std::unordered_map,4.058000
random,memory,10006234,std::unordered_map,783917056
random,memory,10471995,std::unordered_map,807780352
random,memory,10944895,std::unordered_map,832118784
random,memory,11437088,std::unordered_map,857387008
random,memory,11942425,std::unordered_map,883281920
random,memory,12462221,std::unordered_map,910032896
random,memory,12997032,std::unordered_map,937488384
random,memory,13549619,std::unordered_map,965877760
random,memory,14116358,std::unordered_map,994889728
random,memory,14695755,std::unordered_map,1024761856
random,memory,15302036,std::unordered_map,1055805440
random,memory,15922424,std::unordered_map,1087705088
random,memory,16564203,std::unordered_map,1120698368
random,memory,16777216,std::unordered_map,1131618304
random,memory,16777217,std::unordered_map,1669545984
random,memory,16777216,std::unordered_map,1669545984
random,memory,16777217,std::unordered_map,1400582144
random,memory,17598216,std::unordered_map,1442697216
random,memory,18446165,std::unordered_map,1486299136
random,memory,19317877,std::unordered_map,1531068416
random,time,20000000,std::unordered_map,8.836000
random,memory,20005214,std::unordered_map,1566400512
random,memory,20925154,std::unordered_map,1613586432
random,memory,21874581,std::unordered_map,1662332928
random,memory,22851058,std::unordered_map,1712484352
random,memory,23854188,std::unordered_map,1764044800
random,memory,24889194,std::unordered_map,1817235456
random,memory,25956856,std::unordered_map,1871986688
random,memory,27052917,std::unordered_map,1928302592
random,memory,28182525,std::unordered_map,1986330624
random,memory,29343496,std::unordered_map,2045997056
random,time,30000000,std::unordered_map,12.189000
random,memory,30003110,std::unordered_map,2079850496
random,memory,31219769,std::unordered_map,2142253056
random,memory,32472749,std::unordered_map,2206601216
random,memory,33554433,std::unordered_map,2262134784
random,memory,33554434,std::unordered_map,3338063872
random,memory,33554433,std::unordered_map,3338063872
random,memory,33554434,std::unordered_map,2800144384
random,memory,35192104,std::unordered_map,2884296704
random,memory,36882738,std::unordered_map,2971029504
random,memory,38624262,std::unordered_map,3060490240
random,time,40000000,std::unordered_map,19.469000
random,memory,40004148,std::unordered_map,3131314176
random,memory,41836642,std::unordered_map,3225452544
random,memory,43723699,std::unordered_map,3322322944
random,memory,45664059,std::unordered_map,3422003200
random,memory,47663952,std::unordered_map,3524804608
random,memory,49729822,std::unordered_map,3630796800
random,time,50000000,std::unordered_map,22.945000
random,memory,50002422,std::unordered_map,3644837888
random,memory,52133946,std::unordered_map,3754262528
random,memory,54331297,std::unordered_map,3867045888
random,memory,56594458,std::unordered_map,3983339520
random,memory,58922279,std::unordered_map,4102909952
random,time,60000000,std::unordered_map,26.724001
random,memory,60000504,std::unordered_map,4158287872
random,memory,62432538,std::unordered_map,4283162624
random,memory,64938021,std::unordered_map,4411858944
random,memory,67108867,std::unordered_map,4523159552
random,memory,67108868,std::unordered_map,6675017728
random,memory,67108867,std::unordered_map,6674984960
random,memory,67108868,std::unordered_map,5599145984
random,time,70000000,std::unordered_map,38.929001
random,memory,70005239,std::unordered_map,5747884032
random,memory,73363452,std::unordered_map,5920329728
random,memory,76824572,std::unordered_map,6098083840
random,time,80000000,std::unordered_map,42.421001
random,memory,80004058,std::unordered_map,6261411840
random,memory,83663065,std::unordered_map,6449299456
random,memory,87431119,std::unordered_map,6642888704
random,time,90000000,std::unordered_map,46.064999
random,memory,90003941,std::unordered_map,6775009280
random,memory,93967227,std::unordered_map,6978502656
random,memory,98046859,std::unordered_map,7188000768
random,time,100000000,std::unordered_map,49.808998
random,memory,0,absl::flat_hash_map,15753216
random,memory,246268,absl::flat_hash_map,15753216
random,memory,246423,absl::flat_hash_map,11280384
random,memory,458751,absl::flat_hash_map,11280384
random,memory,458752,absl::flat_hash_map,29143040
random,memory,494344,absl::flat_hash_map,29143040
random,memory,494581,absl::flat_hash_map,20209664
random,memory,587568,absl::flat_hash_map,20209664
random,memory,587757,absl::flat_hash_map,19087360
random,memory,917503,absl::flat_hash_map,19087360
random,memory,917504,absl::flat_hash_map,54812672
random,memory,933203,absl::flat_hash_map,54812672
random,memory,933351,absl::flat_hash_map,36950016
random,memory,1835007,absl::flat_hash_map,36950016
random,memory,1835008,absl::flat_hash_map,108396544
random,memory,1862555,absl::flat_hash_map,108396544
random,memory,1862669,absl::flat_hash_map,72671232
random,memory,3670015,absl::flat_hash_map,72671232
random,memory,3670016,absl::flat_hash_map,215560192
random,memory,3671239,absl::flat_hash_map,215560192
random,memory,3671292,absl::flat_hash_map,144113664
random,memory,7340031,absl::flat_hash_map,144113664
random,memory,7340032,absl::flat_hash_map,429895680
random,memory,7357262,absl::flat_hash_map,429895680
random,memory,7357325,absl::flat_hash_map,287002624
random,time,10000000,absl::flat_hash_map,0.917000
random,memory,10004410,absl::flat_hash_map,287002624
random,memory,14680063,absl::flat_hash_map,287002624
random,memory,14680064,absl::flat_hash_map,858546176
random,memory,14692106,absl::flat_hash_map,858546176
random,memory,14692158,absl::flat_hash_map,572772352
random,time,20000000,absl::flat_hash_map,2.219000
random,memory,20000770,absl::flat_hash_map,572772352
random,memory,29360127,absl::flat_hash_map,572772352
random,memory,29360128,absl::flat_hash_map,1715863552
random,memory,29364265,absl::flat_hash_map,1715863552
random,memory,29364312,absl::flat_hash_map,1144311808
random,time,30000000,absl::flat_hash_map,3.875000
random,memory,30003827,absl::flat_hash_map,1144311808
random,time,40000000,absl::flat_hash_map,5.254000
random,memory,40009000,absl::flat_hash_map,1144311808
random,time,50000000,absl::flat_hash_map,6.636000
random,memory,50012195,absl::flat_hash_map,1144311808
random,memory,58720255,absl::flat_hash_map,1144311808
random,memory,58720256,absl::flat_hash_map,3430490112
random,memory,58721997,absl::flat_hash_map,3430490112
random,memory,58722035,absl::flat_hash_map,2287411200
random,time,60000000,absl::flat_hash_map,9.076000
random,memory,60006216,absl::flat_hash_map,2287411200
random,time,70000000,absl::flat_hash_map,10.597000
random,memory,70010624,absl::flat_hash_map,2287411200
random,time,80000000,absl::flat_hash_map,12.121000
random,memory,80009799,absl::flat_hash_map,2287411200
random,time,90000000,absl::flat_hash_map,13.627000
random,memory,90004802,absl::flat_hash_map,2287411200
random,time,100000000,absl::flat_hash_map,15.121000
random,memory,0,absl::parallel_flat_hash_map,10170368
random,memory,411848,absl::parallel_flat_hash_map,10170368
random,memory,411907,absl::parallel_flat_hash_map,16375808
random,memory,434804,absl::parallel_flat_hash_map,16375808
random,memory,434919,absl::parallel_flat_hash_map,19169280
random,memory,499955,absl::parallel_flat_hash_map,19169280
random,memory,500092,absl::parallel_flat_hash_map,18636800
random,memory,767798,absl::parallel_flat_hash_map,18636800
random,memory,767958,absl::parallel_flat_hash_map,20873216
random,memory,810538,absl::parallel_flat_hash_map,20873216
random,memory,810597,absl::parallel_flat_hash_map,30941184
random,memory,819492,absl::parallel_flat_hash_map,30941184
random,memory,819493,absl::parallel_flat_hash_map,39882752
random,memory,835988,absl::parallel_flat_hash_map,39882752
random,memory,836052,absl::parallel_flat_hash_map,36519936
random,memory,894649,absl::parallel_flat_hash_map,36519936
random,memory,894754,absl::parallel_flat_hash_map,34279424
random,memory,1154846,absl::parallel_flat_hash_map,34242560
random,memory,1154988,absl::parallel_flat_hash_map,35360768
random,memory,1216254,absl::parallel_flat_hash_map,35360768
random,memory,1216391,absl::parallel_flat_hash_map,36552704
random,memory,1583771,absl::parallel_flat_hash_map,36552704
random,memory,1583947,absl::parallel_flat_hash_map,39907328
random,memory,1622124,absl::parallel_flat_hash_map,39907328
random,memory,1622237,absl::parallel_flat_hash_map,52199424
random,memory,1639638,absl::parallel_flat_hash_map,52199424
random,memory,1639661,absl::parallel_flat_hash_map,65605632
random,memory,1653514,absl::parallel_flat_hash_map,65605632
random,memory,1653539,absl::parallel_flat_hash_map,72306688
random,memory,1666888,absl::parallel_flat_hash_map,72306688
random,memory,1666916,absl::parallel_flat_hash_map,79003648
random,memory,1691750,absl::parallel_flat_hash_map,79003648
random,memory,1691824,absl::parallel_flat_hash_map,72306688
random,memory,1738807,absl::parallel_flat_hash_map,72306688
random,memory,1738925,absl::parallel_flat_hash_map,65593344
random,memory,2222488,absl::parallel_flat_hash_map,65593344
random,memory,2222655,absl::parallel_flat_hash_map,70066176
random,memory,2275719,absl::parallel_flat_hash_map,70066176
random,memory,2275807,absl::parallel_flat_hash_map,72294400
random,memory,2319482,absl::parallel_flat_hash_map,72294400
random,memory,2319616,absl::parallel_flat_hash_map,76759040
random,memory,2370330,absl::parallel_flat_hash_map,76759040
random,memory,2370869,absl::parallel_flat_hash_map,74518528
random,memory,2422380,absl::parallel_flat_hash_map,74518528
random,memory,2422622,absl::parallel_flat_hash_map,76754944
random,memory,2471942,absl::parallel_flat_hash_map,76754944
random,memory,2472109,absl::parallel_flat_hash_map,74518528
random,memory,3212727,absl::parallel_flat_hash_map,74518528
random,memory,3212832,absl::parallel_flat_hash_map,92385280
random,memory,3279060,absl::parallel_flat_hash_map,92385280
random,memory,3279135,absl::parallel_flat_hash_map,110256128
random,memory,3330438,absl::parallel_flat_hash_map,110256128
random,memory,3330505,absl::parallel_flat_hash_map,119193600
random,memory,3357017,absl::parallel_flat_hash_map,119193600
random,memory,3357061,absl::parallel_flat_hash_map,123658240
random,memory,3382717,absl::parallel_flat_hash_map,123658240
random,memory,3382766,absl::parallel_flat_hash_map,128126976
random,memory,3410216,absl::parallel_flat_hash_map,128126976
random,memory,3410294,absl::parallel_flat_hash_map,119193600
random,memory,3487891,absl::parallel_flat_hash_map,119193600
random,memory,3487995,absl::parallel_flat_hash_map,114720768
random,memory,3535204,absl::parallel_flat_hash_map,114720768
random,memory,3535343,absl::parallel_flat_hash_map,110252032
random,memory,3806272,absl::parallel_flat_hash_map,110252032
random,memory,3806419,absl::parallel_flat_hash_map,119189504
random,memory,3851844,absl::parallel_flat_hash_map,119189504
random,memory,3851947,absl::parallel_flat_hash_map,137056256
random,memory,3912789,absl::parallel_flat_hash_map,137056256
random,memory,3912899,absl::parallel_flat_hash_map,141520896
random,memory,3936842,absl::parallel_flat_hash_map,141520896
random,memory,3936909,absl::parallel_flat_hash_map,150458368
random,memory,3959815,absl::parallel_flat_hash_map,150458368
random,memory,3959905,absl::parallel_flat_hash_map,159383552
random,memory,4023374,absl::parallel_flat_hash_map,159383552
random,memory,4023538,absl::parallel_flat_hash_map,150446080
random,memory,4065053,absl::parallel_flat_hash_map,154906624
random,memory,4204140,absl::parallel_flat_hash_map,154906624
random,memory,4204297,absl::parallel_flat_hash_map,150437888
random,memory,4301074,absl::parallel_flat_hash_map,150437888
random,memory,4301249,absl::parallel_flat_hash_map,145965056
random,memory,6549677,absl::parallel_flat_hash_map,145965056
random,memory,6549825,absl::parallel_flat_hash_map,181694464
random,memory,6997079,absl::parallel_flat_hash_map,181694464
random,memory,6997211,absl::parallel_flat_hash_map,208494592
random,memory,7230339,absl::parallel_flat_hash_map,208494592
random,memory,7230465,absl::parallel_flat_hash_map,226361344
random,memory,7291549,absl::parallel_flat_hash_map,226361344
random,memory,7291670,absl::parallel_flat_hash_map,217427968
random,memory,7657520,absl::parallel_flat_hash_map,217427968
random,memory,7657607,absl::parallel_flat_hash_map,297807872
random,memory,7804692,absl::parallel_flat_hash_map,297807872
random,memory,7804756,absl::parallel_flat_hash_map,315654144
random,memory,7862884,absl::parallel_flat_hash_map,324587520
random,memory,8300446,absl::parallel_flat_hash_map,324587520
random,memory,8300602,absl::parallel_flat_hash_map,288845824
random,time,10000000,absl::parallel_flat_hash_map,0.424000
random,memory,10549382,absl::parallel_flat_hash_map,287694848
random,memory,14509630,absl::parallel_flat_hash_map,287694848
random,memory,14509631,absl::parallel_flat_hash_map,537772032
random,memory,14625205,absl::parallel_flat_hash_map,537772032
random,memory,14625206,absl::parallel_flat_hash_map,662798336
random,memory,14985538,absl::parallel_flat_hash_map,662798336
random,memory,14985695,absl::parallel_flat_hash_map,573476864
random,memory,15812726,absl::parallel_flat_hash_map,573476864
random,memory,15812791,absl::parallel_flat_hash_map,591331328
random,memory,16545857,absl::parallel_flat_hash_map,591331328
random,memory,16545973,absl::parallel_flat_hash_map,573460480
random,time,20000000,absl::parallel_flat_hash_map,0.954000
random,memory,20807098,absl::parallel_flat_hash_map,573456384
random,memory,29087356,absl::parallel_flat_hash_map,573456384
random,memory,29087477,absl::parallel_flat_hash_map,644902912
random,memory,29349303,absl::parallel_flat_hash_map,644902912
random,memory,29349304,absl::parallel_flat_hash_map,1145028608
random,memory,29350502,absl::parallel_flat_hash_map,1145028608
random,memory,29350503,absl::parallel_flat_hash_map,1180753920
random,memory,29353744,absl::parallel_flat_hash_map,1180753920
random,memory,29353745,absl::parallel_flat_hash_map,1252196352
random,memory,29356269,absl::parallel_flat_hash_map,1252196352
random,memory,29356270,absl::parallel_flat_hash_map,1216475136
random,memory,29371063,absl::parallel_flat_hash_map,1216475136
random,memory,29371064,absl::parallel_flat_hash_map,1430810624
random,memory,29406162,absl::parallel_flat_hash_map,1430810624
random,memory,29406217,absl::parallel_flat_hash_map,1359364096
random,memory,29624052,absl::parallel_flat_hash_map,1359364096
random,memory,29624117,absl::parallel_flat_hash_map,1216425984
random,memory,29711436,absl::parallel_flat_hash_map,1216397312
random,memory,29711557,absl::parallel_flat_hash_map,1180667904
random,memory,29779052,absl::parallel_flat_hash_map,1180643328
random,memory,29779149,absl::parallel_flat_hash_map,1144913920
random,time,30000000,absl::parallel_flat_hash_map,1.510000
random,memory,30000000,absl::parallel_flat_hash_map,1144786944
random,time,40000000,absl::parallel_flat_hash_map,1.977000
random,memory,40000000,absl::parallel_flat_hash_map,1144782848
random,time,50000000,absl::parallel_flat_hash_map,2.410000
random,memory,50109244,absl::parallel_flat_hash_map,1144987648
random,memory,58696456,absl::parallel_flat_hash_map,1144987648
random,memory,58696478,absl::parallel_flat_hash_map,2145222656
random,memory,58705957,absl::parallel_flat_hash_map,2145222656
random,memory,58705958,absl::parallel_flat_hash_map,2288111616
random,memory,58710284,absl::parallel_flat_hash_map,2288111616
random,memory,58710285,absl::parallel_flat_hash_map,2502451200
random,memory,58716154,absl::parallel_flat_hash_map,2502451200
random,memory,58716155,absl::parallel_flat_hash_map,2645327872
random,memory,58719191,absl::parallel_flat_hash_map,2645327872
random,memory,58719214,absl::parallel_flat_hash_map,2573885440
random,memory,58734799,absl::parallel_flat_hash_map,2573885440
random,memory,58734800,absl::parallel_flat_hash_map,2859651072
random,memory,58754516,absl::parallel_flat_hash_map,2859651072
random,memory,58754559,absl::parallel_flat_hash_map,2716762112
random,memory,59072502,absl::parallel_flat_hash_map,2716762112
random,memory,59072581,absl::parallel_flat_hash_map,2359533568
random,memory,59445636,absl::parallel_flat_hash_map,2359533568
random,memory,59449345,absl::parallel_flat_hash_map,2288054272
random,time,60000000,absl::parallel_flat_hash_map,3.184000
random,memory,60659819,absl::parallel_flat_hash_map,2288070656
random,time,70000000,absl::parallel_flat_hash_map,3.678000
random,memory,70001013,absl::parallel_flat_hash_map,2288001024
random,time,80000000,absl::parallel_flat_hash_map,4.120000
random,memory,80008641,absl::parallel_flat_hash_map,2288046080
random,time,90000000,absl::parallel_flat_hash_map,4.653000
random,memory,90000000,absl::parallel_flat_hash_map,2287878144
random,time,100000000,absl::parallel_flat_hash_map,5.111000

View File

@ -1,374 +0,0 @@
random,memory,0,std::unordered_map,6262784
random,memory,66147,std::unordered_map,6340608
random,memory,82637,std::unordered_map,6340608
random,memory,82649,std::unordered_map,7204864
random,memory,99619,std::unordered_map,7204864
random,memory,99639,std::unordered_map,8060928
random,memory,116159,std::unordered_map,8060928
random,memory,116174,std::unordered_map,8916992
random,memory,129704,std::unordered_map,8916992
random,memory,129718,std::unordered_map,9621504
random,memory,131071,std::unordered_map,9621504
random,memory,131072,std::unordered_map,11804672
random,memory,135283,std::unordered_map,12038144
random,memory,147679,std::unordered_map,12038144
random,memory,147680,std::unordered_map,12660736
random,memory,159818,std::unordered_map,12660736
random,memory,159834,std::unordered_map,13291520
random,memory,170700,std::unordered_map,13291520
random,memory,170717,std::unordered_map,13914112
random,memory,179486,std::unordered_map,14303232
random,memory,188398,std::unordered_map,14303232
random,memory,188409,std::unordered_map,14770176
random,memory,195927,std::unordered_map,14770176
random,memory,195939,std::unordered_map,15237120
random,memory,203959,std::unordered_map,15630336
random,memory,211779,std::unordered_map,15941632
random,memory,220483,std::unordered_map,15941632
random,memory,220484,std::unordered_map,16486400
random,memory,229922,std::unordered_map,16953344
random,memory,239746,std::unordered_map,17424384
random,memory,250042,std::unordered_map,17424384
random,memory,250053,std::unordered_map,17969152
random,memory,259821,std::unordered_map,18436096
random,memory,262143,std::unordered_map,18436096
random,memory,262144,std::unordered_map,26927104
random,memory,262143,std::unordered_map,26927104
random,memory,262144,std::unordered_map,22724608
random,memory,273337,std::unordered_map,23347200
random,memory,281584,std::unordered_map,23814144
random,memory,291318,std::unordered_map,24293376
random,memory,301478,std::unordered_map,24838144
random,memory,311977,std::unordered_map,25382912
random,memory,322715,std::unordered_map,25935872
random,memory,333302,std::unordered_map,26558464
random,memory,343264,std::unordered_map,27025408
random,memory,352924,std::unordered_map,27492352
random,memory,361958,std::unordered_map,27963392
random,memory,369865,std::unordered_map,28352512
random,memory,378535,std::unordered_map,28819456
random,memory,387443,std::unordered_map,29286400
random,memory,396689,std::unordered_map,29753344
random,memory,405932,std::unordered_map,30224384
random,memory,415263,std::unordered_map,30691328
random,memory,424445,std::unordered_map,31158272
random,memory,433724,std::unordered_map,31625216
random,memory,442183,std::unordered_map,32096256
random,memory,450170,std::unordered_map,32485376
random,memory,458338,std::unordered_map,32874496
random,memory,466025,std::unordered_map,33341440
random,memory,474254,std::unordered_map,33730560
random,memory,482593,std::unordered_map,34123776
random,memory,491058,std::unordered_map,34590720
random,memory,499360,std::unordered_map,35057664
random,memory,514720,std::unordered_map,35758080
random,memory,522349,std::unordered_map,36147200
random,memory,524287,std::unordered_map,36147200
random,memory,524288,std::unordered_map,53125120
random,memory,524287,std::unordered_map,53125120
random,memory,524288,std::unordered_map,44720128
random,memory,543462,std::unordered_map,45654016
random,memory,552986,std::unordered_map,46198784
random,memory,572111,std::unordered_map,47136768
random,memory,608007,std::unordered_map,49004544
random,memory,626830,std::unordered_map,49938432
random,memory,662501,std::unordered_map,51838976
random,memory,697143,std::unordered_map,53633024
random,memory,730779,std::unordered_map,55349248
random,memory,763966,std::unordered_map,57061376
random,memory,797419,std::unordered_map,58777600
random,memory,838262,std::unordered_map,60805120
random,memory,877693,std::unordered_map,62910464
random,memory,919839,std::unordered_map,65015808
random,memory,963409,std::unordered_map,67280896
random,memory,1006880,std::unordered_map,69541888
random,memory,1048575,std::unordered_map,71491584
random,memory,1048576,std::unordered_map,105275392
random,memory,1048575,std::unordered_map,105279488
random,memory,1048576,std::unordered_map,88469504
random,memory,1101898,std::unordered_map,91201536
random,memory,1159041,std::unordered_map,94085120
random,memory,1214581,std::unordered_map,96968704
random,memory,1277500,std::unordered_map,100163584
random,memory,1336144,std::unordered_map,103211008
random,memory,1401705,std::unordered_map,106561536
random,memory,1467192,std::unordered_map,109993984
random,memory,1539228,std::unordered_map,113659904
random,memory,1610540,std::unordered_map,117321728
random,memory,1679692,std::unordered_map,120909824
random,memory,1754775,std::unordered_map,124731392
random,memory,1829692,std::unordered_map,128552960
random,memory,1911333,std::unordered_map,132685824
random,memory,1992045,std::unordered_map,136900608
random,memory,2078160,std::unordered_map,141344768
random,memory,2097151,std::unordered_map,141967360
random,memory,2097152,std::unordered_map,209526784
random,memory,2097151,std::unordered_map,209526784
random,memory,2097152,std::unordered_map,175906816
random,memory,2203649,std::unordered_map,181366784
random,memory,2313060,std::unordered_map,187060224
random,memory,2430763,std::unordered_map,193064960
random,memory,2547134,std::unordered_map,199041024
random,memory,2663349,std::unordered_map,205049856
random,memory,2783850,std::unordered_map,211288064
random,memory,2910198,std::unordered_map,217763840
random,memory,3037927,std::unordered_map,224313344
random,memory,3177861,std::unordered_map,231485440
random,memory,3313832,std::unordered_map,238505984
random,memory,3457523,std::unordered_map,245760000
random,memory,3602506,std::unordered_map,253329408
random,memory,3759506,std::unordered_map,261279744
random,memory,3911955,std::unordered_map,269160448
random,memory,4070796,std::unordered_map,277348352
random,memory,4194303,std::unordered_map,283435008
random,memory,4194304,std::unordered_map,418156544
random,memory,4194303,std::unordered_map,418156544
random,memory,4194304,std::unordered_map,350916608
random,memory,4407009,std::unordered_map,361832448
random,memory,4622523,std::unordered_map,372908032
random,memory,4840785,std::unordered_map,384139264
random,memory,5069285,std::unordered_map,395759616
random,memory,5303878,std::unordered_map,407928832
random,memory,5543266,std::unordered_map,420253696
random,memory,5791025,std::unordered_map,432885760
random,memory,6044095,std::unordered_map,445906944
random,memory,6305319,std::unordered_map,459321344
random,memory,6577545,std::unordered_map,473284608
random,memory,6858697,std::unordered_map,487792640
random,memory,7147317,std::unordered_map,502611968
random,memory,7442937,std::unordered_map,517742592
random,memory,7748304,std::unordered_map,533422080
random,memory,8065615,std::unordered_map,549801984
random,memory,8388607,std::unordered_map,566177792
random,memory,8388608,std::unordered_map,835301376
random,memory,8388607,std::unordered_map,835301376
random,memory,8388608,std::unordered_map,700817408
random,memory,8802366,std::unordered_map,722030592
random,memory,9226003,std::unordered_map,743714816
random,memory,9659613,std::unordered_map,766099456
random,time,10000000,std::unordered_map,4.219000
random,memory,10004203,std::unordered_map,783728640
random,memory,10467953,std::unordered_map,807591936
random,memory,10941688,std::unordered_map,831930368
random,memory,11430458,std::unordered_map,856965120
random,memory,11932272,std::unordered_map,882782208
random,memory,12452228,std::unordered_map,909455360
random,memory,12986599,std::unordered_map,936914944
random,memory,13534295,std::unordered_map,965074944
random,memory,14099120,std::unordered_map,994086912
random,memory,14685277,std::unordered_map,1024192512
random,memory,15284333,std::unordered_map,1055002624
random,memory,15901280,std::unordered_map,1086668800
random,memory,16540739,std::unordered_map,1119506432
random,memory,16777216,std::unordered_map,1131593728
random,memory,16777217,std::unordered_map,1669521408
random,memory,16777216,std::unordered_map,1669521408
random,memory,16777217,std::unordered_map,1400561664
random,memory,17594843,std::unordered_map,1442594816
random,memory,18441168,std::unordered_map,1486041088
random,memory,19314823,std::unordered_map,1530888192
random,time,20000000,std::unordered_map,9.237000
random,memory,20001449,std::unordered_map,1566220288
random,memory,20922961,std::unordered_map,1613488128
random,memory,21867605,std::unordered_map,1661919232
random,memory,22842566,std::unordered_map,1711992832
random,memory,23846371,std::unordered_map,1763553280
random,memory,24877882,std::unordered_map,1816588288
random,memory,25939795,std::unordered_map,1871106048
random,memory,27035961,std::unordered_map,1927417856
random,memory,28166332,std::unordered_map,1985449984
random,memory,29325566,std::unordered_map,2045038592
random,time,30000000,std::unordered_map,12.731000
random,memory,30005312,std::unordered_map,2079903744
random,memory,31220485,std::unordered_map,2142306304
random,memory,32473699,std::unordered_map,2206654464
random,memory,33554433,std::unordered_map,2261954560
random,memory,33554434,std::unordered_map,3338039296
random,memory,33554433,std::unordered_map,3338039296
random,memory,33554434,std::unordered_map,2800119808
random,memory,35190517,std::unordered_map,2884198400
random,memory,36881331,std::unordered_map,2971004928
random,memory,38618963,std::unordered_map,3060154368
random,time,40000000,std::unordered_map,20.341999
random,memory,40000165,std::unordered_map,3131133952
random,memory,41832534,std::unordered_map,3225194496
random,memory,43716435,std::unordered_map,3321987072
random,memory,45660968,std::unordered_map,3421900800
random,memory,47664978,std::unordered_map,3524857856
random,memory,49728995,std::unordered_map,3630772224
random,time,50000000,std::unordered_map,23.892000
random,memory,50003393,std::unordered_map,3644891136
random,memory,52133603,std::unordered_map,3754237952
random,memory,54328284,std::unordered_map,3866943488
random,memory,56590586,std::unordered_map,3983159296
random,memory,58922512,std::unordered_map,4102963200
random,time,60000000,std::unordered_map,27.804001
random,memory,60002789,std::unordered_map,4158418944
random,memory,62434781,std::unordered_map,4283215872
random,memory,64938804,std::unordered_map,4411912192
random,memory,67108867,std::unordered_map,4523261952
random,memory,67108868,std::unordered_map,6674964480
random,memory,67108867,std::unordered_map,6674964480
random,memory,67108868,std::unordered_map,5599125504
random,time,70000000,std::unordered_map,40.429001
random,memory,70000893,std::unordered_map,5747630080
random,memory,73361782,std::unordered_map,5920231424
random,memory,76823810,std::unordered_map,6098063360
random,time,80000000,std::unordered_map,43.907001
random,memory,80001253,std::unordered_map,6261313536
random,memory,83662519,std::unordered_map,6449278976
random,memory,87433081,std::unordered_map,6642946048
random,time,90000000,std::unordered_map,47.674000
random,memory,90000620,std::unordered_map,6774833152
random,memory,93961521,std::unordered_map,6978170880
random,memory,98041926,std::unordered_map,7187746816
random,time,100000000,std::unordered_map,51.557999
random,memory,100000000,std::unordered_map,7288283136
random,memory,0,phmap::flat_hash_map,15810560
random,memory,239818,phmap::flat_hash_map,15810560
random,memory,240039,phmap::flat_hash_map,11341824
random,memory,458751,phmap::flat_hash_map,11341824
random,memory,458752,phmap::flat_hash_map,29208576
random,memory,487182,phmap::flat_hash_map,29208576
random,memory,487416,phmap::flat_hash_map,20275200
random,memory,669554,phmap::flat_hash_map,20275200
random,memory,669793,phmap::flat_hash_map,19144704
random,memory,917503,phmap::flat_hash_map,19144704
random,memory,917504,phmap::flat_hash_map,54870016
random,memory,956900,phmap::flat_hash_map,54870016
random,memory,957064,phmap::flat_hash_map,37003264
random,memory,1835007,phmap::flat_hash_map,37003264
random,memory,1835008,phmap::flat_hash_map,108449792
random,memory,1849262,phmap::flat_hash_map,108449792
random,memory,1849368,phmap::flat_hash_map,72724480
random,memory,3670015,phmap::flat_hash_map,72724480
random,memory,3670016,phmap::flat_hash_map,215613440
random,memory,3671196,phmap::flat_hash_map,215613440
random,memory,3671252,phmap::flat_hash_map,144166912
random,memory,7340031,phmap::flat_hash_map,144166912
random,memory,7340032,phmap::flat_hash_map,429944832
random,memory,7345416,phmap::flat_hash_map,429944832
random,memory,7345476,phmap::flat_hash_map,287055872
random,time,10000000,phmap::flat_hash_map,0.952000
random,memory,10005890,phmap::flat_hash_map,287055872
random,memory,14680063,phmap::flat_hash_map,287055872
random,memory,14680064,phmap::flat_hash_map,858599424
random,memory,14681371,phmap::flat_hash_map,858599424
random,memory,14681406,phmap::flat_hash_map,572825600
random,time,20000000,phmap::flat_hash_map,2.315000
random,memory,20016264,phmap::flat_hash_map,572825600
random,memory,29360127,phmap::flat_hash_map,572825600
random,memory,29360128,phmap::flat_hash_map,1715916800
random,memory,29363718,phmap::flat_hash_map,1715916800
random,memory,29363764,phmap::flat_hash_map,1144373248
random,time,30000000,phmap::flat_hash_map,4.047000
random,memory,30001212,phmap::flat_hash_map,1144373248
random,time,40000000,phmap::flat_hash_map,5.437000
random,memory,40013884,phmap::flat_hash_map,1144373248
random,time,50000000,phmap::flat_hash_map,6.807000
random,memory,50012642,phmap::flat_hash_map,1144373248
random,memory,58720255,phmap::flat_hash_map,1144373248
random,memory,58720256,phmap::flat_hash_map,3430551552
random,memory,58726692,phmap::flat_hash_map,3430551552
random,memory,58726725,phmap::flat_hash_map,2287464448
random,time,60000000,phmap::flat_hash_map,9.232000
random,memory,60005561,phmap::flat_hash_map,2287464448
random,time,70000000,phmap::flat_hash_map,10.811000
random,memory,70008847,phmap::flat_hash_map,2287464448
random,time,80000000,phmap::flat_hash_map,12.387000
random,memory,80000522,phmap::flat_hash_map,2287464448
random,time,90000000,phmap::flat_hash_map,13.936000
random,memory,90006732,phmap::flat_hash_map,2287464448
random,time,100000000,phmap::flat_hash_map,15.467000
random,memory,0,phmap::parallel_flat_hash_map,37785600
random,memory,1921864,phmap::parallel_flat_hash_map,37785600
random,memory,1921990,phmap::parallel_flat_hash_map,75739136
random,memory,2969317,phmap::parallel_flat_hash_map,75739136
random,memory,2969478,phmap::parallel_flat_hash_map,73498624
random,memory,3714056,phmap::parallel_flat_hash_map,73498624
random,memory,3714057,phmap::parallel_flat_hash_map,162828288
random,memory,4501128,phmap::parallel_flat_hash_map,162828288
random,memory,4501312,phmap::parallel_flat_hash_map,144936960
random,memory,7228404,phmap::parallel_flat_hash_map,144936960
random,memory,7228507,phmap::parallel_flat_hash_map,207466496
random,memory,7275817,phmap::parallel_flat_hash_map,207466496
random,memory,7275940,phmap::parallel_flat_hash_map,216391680
random,memory,7498901,phmap::parallel_flat_hash_map,216391680
random,memory,7499009,phmap::parallel_flat_hash_map,323563520
random,memory,7543411,phmap::parallel_flat_hash_map,323563520
random,memory,7543523,phmap::parallel_flat_hash_map,305696768
random,memory,8354331,phmap::parallel_flat_hash_map,305696768
random,memory,8354519,phmap::parallel_flat_hash_map,287825920
random,time,10000000,phmap::parallel_flat_hash_map,0.406000
random,memory,10849279,phmap::parallel_flat_hash_map,288239616
random,memory,14474156,phmap::parallel_flat_hash_map,288239616
random,memory,14474206,phmap::parallel_flat_hash_map,395419648
random,memory,14565308,phmap::parallel_flat_hash_map,395419648
random,memory,14565382,phmap::parallel_flat_hash_map,466870272
random,memory,14678635,phmap::parallel_flat_hash_map,466870272
random,memory,14678636,phmap::parallel_flat_hash_map,609767424
random,memory,14683611,phmap::parallel_flat_hash_map,627630080
random,memory,14800987,phmap::parallel_flat_hash_map,627630080
random,memory,14801039,phmap::parallel_flat_hash_map,663339008
random,memory,15290395,phmap::parallel_flat_hash_map,663339008
random,memory,15290450,phmap::parallel_flat_hash_map,591884288
random,memory,15480090,phmap::parallel_flat_hash_map,591884288
random,memory,15480237,phmap::parallel_flat_hash_map,574021632
random,time,20000000,phmap::parallel_flat_hash_map,0.912000
random,memory,20838704,phmap::parallel_flat_hash_map,574017536
random,memory,28900745,phmap::parallel_flat_hash_map,574017536
random,memory,28900840,phmap::parallel_flat_hash_map,645464064
random,memory,29185725,phmap::parallel_flat_hash_map,645464064
random,memory,29185801,phmap::parallel_flat_hash_map,788357120
random,memory,29330003,phmap::parallel_flat_hash_map,788357120
random,memory,29330055,phmap::parallel_flat_hash_map,1002696704
random,memory,29349427,phmap::parallel_flat_hash_map,1002696704
random,memory,29349428,phmap::parallel_flat_hash_map,1145589760
random,memory,29352020,phmap::parallel_flat_hash_map,1145589760
random,memory,29352021,phmap::parallel_flat_hash_map,1181310976
random,memory,29355250,phmap::parallel_flat_hash_map,1181310976
random,memory,29355251,phmap::parallel_flat_hash_map,1252745216
random,memory,29363721,phmap::parallel_flat_hash_map,1252745216
random,memory,29363722,phmap::parallel_flat_hash_map,1324191744
random,memory,29370810,phmap::parallel_flat_hash_map,1324191744
random,memory,29370811,phmap::parallel_flat_hash_map,1431351296
random,memory,29553925,phmap::parallel_flat_hash_map,1431351296
random,memory,29553998,phmap::parallel_flat_hash_map,1252732928
random,memory,29747915,phmap::parallel_flat_hash_map,1252732928
random,memory,29748035,phmap::parallel_flat_hash_map,1181249536
random,memory,29849570,phmap::parallel_flat_hash_map,1181167616
random,memory,29849635,phmap::parallel_flat_hash_map,1145438208
random,time,30000000,phmap::parallel_flat_hash_map,1.470000
random,memory,30044703,phmap::parallel_flat_hash_map,1145556992
random,time,40000000,phmap::parallel_flat_hash_map,1.935000
random,memory,40000000,phmap::parallel_flat_hash_map,1145356288
random,time,50000000,phmap::parallel_flat_hash_map,2.359000
random,memory,50622111,phmap::parallel_flat_hash_map,1145556992
random,memory,58670362,phmap::parallel_flat_hash_map,1145556992
random,memory,58670384,phmap::parallel_flat_hash_map,2145792000
random,memory,58698634,phmap::parallel_flat_hash_map,2145792000
random,memory,58698635,phmap::parallel_flat_hash_map,2288680960
random,memory,58715876,phmap::parallel_flat_hash_map,2288685056
random,memory,58715877,phmap::parallel_flat_hash_map,2574458880
random,memory,58720779,phmap::parallel_flat_hash_map,2574458880
random,memory,58720802,phmap::parallel_flat_hash_map,2503016448
random,memory,58723605,phmap::parallel_flat_hash_map,2503016448
random,memory,58723606,phmap::parallel_flat_hash_map,2645905408
random,memory,58729212,phmap::parallel_flat_hash_map,2645905408
random,memory,58729213,phmap::parallel_flat_hash_map,2788790272
random,memory,58741845,phmap::parallel_flat_hash_map,2860228608
random,memory,58760201,phmap::parallel_flat_hash_map,2860228608
random,memory,58760227,phmap::parallel_flat_hash_map,2788786176
random,memory,58967162,phmap::parallel_flat_hash_map,2788786176
random,memory,58967269,phmap::parallel_flat_hash_map,2360111104
random,memory,59568547,phmap::parallel_flat_hash_map,2360111104
random,memory,59568692,phmap::parallel_flat_hash_map,2288660480
random,time,60000000,phmap::parallel_flat_hash_map,3.120000
random,memory,60764467,phmap::parallel_flat_hash_map,2288656384
random,time,70000000,phmap::parallel_flat_hash_map,3.567000
random,memory,70747076,phmap::parallel_flat_hash_map,2288652288
random,time,80000000,phmap::parallel_flat_hash_map,4.004000
random,memory,80005300,phmap::parallel_flat_hash_map,2288590848
random,time,90000000,phmap::parallel_flat_hash_map,4.527000
random,memory,90699330,phmap::parallel_flat_hash_map,2288656384
random,time,100000000,phmap::parallel_flat_hash_map,4.986000

View File

@ -1,225 +0,0 @@
random,memory,0,std::unordered_map,6688768
random,memory,94189,std::unordered_map,7778304
random,memory,109769,std::unordered_map,8556544
random,memory,122654,std::unordered_map,9261056
random,memory,131072,std::unordered_map,13778944
random,memory,131072,std::unordered_map,11677696
random,memory,139313,std::unordered_map,12144640
random,memory,153935,std::unordered_map,12943360
random,memory,165753,std::unordered_map,13643776
random,memory,177309,std::unordered_map,14266368
random,memory,188501,std::unordered_map,14733312
random,memory,198715,std::unordered_map,15282176
random,memory,208082,std::unordered_map,15749120
random,memory,217961,std::unordered_map,16293888
random,memory,228367,std::unordered_map,16838656
random,memory,248349,std::unordered_map,17854464
random,memory,262144,std::unordered_map,26890240
random,memory,262144,std::unordered_map,22683648
random,memory,276980,std::unordered_map,23543808
random,memory,296991,std::unordered_map,24477696
random,memory,317107,std::unordered_map,25571328
random,memory,336773,std::unordered_map,26660864
random,memory,356852,std::unordered_map,27676672
random,memory,374674,std::unordered_map,28532736
random,memory,393524,std::unordered_map,29544448
random,memory,412757,std::unordered_map,30482432
random,memory,430634,std::unordered_map,31416320
random,memory,456096,std::unordered_map,32743424
random,memory,480998,std::unordered_map,34017280
random,memory,506761,std::unordered_map,35340288
random,memory,524288,std::unordered_map,53096448
random,memory,524288,std::unordered_map,44687360
random,memory,559809,std::unordered_map,46481408
random,memory,586869,std::unordered_map,47882240
random,memory,625664,std::unordered_map,49827840
random,memory,661343,std::unordered_map,51781632
random,memory,697780,std::unordered_map,53575680
random,memory,732263,std::unordered_map,55369728
random,memory,767346,std::unordered_map,57163776
random,memory,801265,std::unordered_map,58880000
random,memory,843401,std::unordered_map,61063168
random,memory,883359,std::unordered_map,63008768
random,memory,923703,std::unordered_map,65114112
random,memory,962276,std::unordered_map,67145728
random,memory,1000499,std::unordered_map,69173248
random,memory,1046029,std::unordered_map,71438336
random,memory,1048576,std::unordered_map,105222144
random,memory,1048576,std::unordered_map,88412160
random,memory,1103068,std::unordered_map,91217920
random,memory,1166341,std::unordered_map,94412800
random,memory,1227947,std::unordered_map,97611776
random,memory,1288360,std::unordered_map,100732928
random,memory,1348784,std::unordered_map,103849984
random,memory,1415960,std::unordered_map,107282432
random,memory,1483476,std::unordered_map,110710784
random,memory,1551489,std::unordered_map,114221056
random,memory,1622998,std::unordered_map,117964800
random,memory,1698528,std::unordered_map,121786368
random,memory,1774279,std::unordered_map,125607936
random,memory,1852847,std::unordered_map,129658880
random,memory,1935045,std::unordered_map,133955584
random,memory,2016124,std::unordered_map,138084352
random,memory,2097152,std::unordered_map,209465344
random,memory,2097152,std::unordered_map,175845376
random,memory,2202017,std::unordered_map,181227520
random,memory,2308233,std::unordered_map,186687488
random,memory,2421995,std::unordered_map,192569344
random,memory,2540952,std::unordered_map,198647808
random,memory,2664197,std::unordered_map,205049856
random,memory,2786842,std::unordered_map,211288064
random,memory,2914893,std::unordered_map,217915392
random,memory,3042611,std::unordered_map,224464896
random,memory,3177918,std::unordered_map,231325696
random,memory,3316856,std::unordered_map,238583808
random,memory,3463219,std::unordered_map,245989376
random,memory,3606297,std::unordered_map,253440000
random,memory,3758685,std::unordered_map,261234688
random,memory,3918344,std::unordered_map,269426688
random,memory,4082497,std::unordered_map,277848064
random,memory,4194304,std::unordered_map,418111488
random,memory,4194304,std::unordered_map,350871552
random,memory,4405390,std::unordered_map,361631744
random,memory,4622462,std::unordered_map,372862976
random,memory,4843447,std::unordered_map,384253952
random,memory,5077057,std::unordered_map,396234752
random,memory,5310379,std::unordered_map,408170496
random,memory,5553459,std::unordered_map,420728832
random,memory,5801485,std::unordered_map,433438720
random,memory,6061642,std::unordered_map,446771200
random,memory,6321544,std::unordered_map,460189696
random,memory,6597657,std::unordered_map,474308608
random,memory,6874638,std::unordered_map,488579072
random,memory,7165061,std::unordered_map,503480320
random,memory,7464156,std::unordered_map,518844416
random,memory,7769321,std::unordered_map,534519808
random,memory,8083787,std::unordered_map,550666240
random,memory,8388608,std::unordered_map,835313664
random,memory,8388608,std::unordered_map,700833792
random,memory,8799364,std::unordered_map,721883136
random,memory,9228893,std::unordered_map,743878656
random,memory,9664620,std::unordered_map,766345216
random,time,10000000,std::unordered_map,4.373000
random,memory,10005035,std::unordered_map,783814656
random,memory,10114472,std::unordered_map,789352448
random,memory,10581340,std::unordered_map,813371392
random,memory,11060026,std::unordered_map,837943296
random,memory,11554760,std::unordered_map,863367168
random,memory,12063672,std::unordered_map,889499648
random,memory,12588048,std::unordered_map,916488192
random,memory,13128601,std::unordered_map,944173056
random,memory,13682065,std::unordered_map,972640256
random,memory,14255923,std::unordered_map,1002127360
random,memory,14847433,std::unordered_map,1032548352
random,memory,15456818,std::unordered_map,1063825408
random,memory,16080459,std::unordered_map,1095798784
random,memory,16726977,std::unordered_map,1128947712
random,memory,16777217,std::unordered_map,1669529600
random,memory,16777217,std::unordered_map,1400569856
random,memory,17595085,std::unordered_map,1442603008
random,memory,18438183,std::unordered_map,1485893632
random,memory,19311311,std::unordered_map,1530658816
random,time,20000000,std::unordered_map,8.842000
random,memory,20000810,std::unordered_map,1566150656
random,memory,20207250,std::unordered_map,1576677376
random,memory,21131235,std::unordered_map,1624178688
random,memory,22086647,std::unordered_map,1673158656
random,memory,23064920,std::unordered_map,1723465728
random,memory,24073299,std::unordered_map,1775177728
random,memory,25110516,std::unordered_map,1828532224
random,memory,26181575,std::unordered_map,1883516928
random,memory,27282467,std::unordered_map,1940062208
random,memory,28422030,std::unordered_map,1998561280
random,memory,29593778,std::unordered_map,2058694656
random,time,30000000,std::unordered_map,12.018000
random,memory,30000114,std::unordered_map,2079678464
random,memory,30796939,std::unordered_map,2120552448
random,memory,32039135,std::unordered_map,2184355840
random,memory,33320240,std::unordered_map,2250104832
random,memory,33554434,std::unordered_map,3338047488
random,memory,33554434,std::unordered_map,2800128000
random,memory,35194605,std::unordered_map,2884362240
random,memory,36886268,std::unordered_map,2971246592
random,memory,38624437,std::unordered_map,3060473856
random,time,40000000,std::unordered_map,18.924999
random,memory,40003628,std::unordered_map,3131297792
random,memory,40417618,std::unordered_map,3152588800
random,memory,42264600,std::unordered_map,3247431680
random,memory,44165274,std::unordered_map,3345006592
random,memory,46122181,std::unordered_map,3445542912
random,memory,48137986,std::unordered_map,3549040640
random,time,50000000,std::unordered_map,22.261999
random,memory,50001657,std::unordered_map,3644821504
random,memory,50216354,std::unordered_map,3655737344
random,memory,52356080,std::unordered_map,3765637120
random,memory,54556920,std::unordered_map,3878731776
random,memory,56823702,std::unordered_map,3995103232
random,memory,59156726,std::unordered_map,4114980864
random,time,60000000,std::unordered_map,25.919001
random,memory,60002957,std::unordered_map,4158427136
random,memory,61562985,std::unordered_map,4238528512
random,memory,64040759,std::unordered_map,4365746176
random,memory,66594964,std::unordered_map,4496855040
random,memory,67108868,std::unordered_map,6675001344
random,memory,67108868,std::unordered_map,5599162368
random,time,70000000,std::unordered_map,37.734001
random,memory,70005322,std::unordered_map,5747867648
random,memory,70384719,std::unordered_map,5767364608
random,memory,73758686,std::unordered_map,5940674560
random,memory,77233925,std::unordered_map,6119124992
random,time,80000000,std::unordered_map,41.104000
random,memory,80002815,std::unordered_map,6261395456
random,memory,80810186,std::unordered_map,6302810112
random,memory,84496350,std::unordered_map,6492106752
random,memory,88293603,std::unordered_map,6687174656
random,time,90000000,std::unordered_map,44.681000
random,memory,90004365,std::unordered_map,6774996992
random,memory,92206220,std::unordered_map,6888091648
random,memory,96235553,std::unordered_map,7095013376
random,time,100000000,std::unordered_map,48.382000
random,memory,0,absl::flat_hash_map,15740928
random,memory,240967,absl::flat_hash_map,11272192
random,memory,458751,absl::flat_hash_map,11272192
random,memory,458752,absl::flat_hash_map,29138944
random,memory,493930,absl::flat_hash_map,20205568
random,memory,678845,absl::flat_hash_map,19087360
random,memory,917503,absl::flat_hash_map,19087360
random,memory,917504,absl::flat_hash_map,54812672
random,memory,930488,absl::flat_hash_map,36945920
random,memory,1835007,absl::flat_hash_map,36945920
random,memory,1835008,absl::flat_hash_map,108392448
random,memory,1860950,absl::flat_hash_map,72667136
random,memory,3670015,absl::flat_hash_map,72667136
random,memory,3670016,absl::flat_hash_map,215556096
random,memory,3681610,absl::flat_hash_map,144109568
random,memory,7340031,absl::flat_hash_map,144109568
random,memory,7340032,absl::flat_hash_map,429883392
random,memory,7348393,absl::flat_hash_map,286994432
random,time,10000000,absl::flat_hash_map,0.917000
random,memory,10000174,absl::flat_hash_map,286994432
random,memory,14680063,absl::flat_hash_map,286994432
random,memory,14680064,absl::flat_hash_map,858537984
random,memory,14680512,absl::flat_hash_map,572764160
random,time,20000000,absl::flat_hash_map,2.199000
random,memory,20013320,absl::flat_hash_map,572764160
random,memory,29360127,absl::flat_hash_map,572764160
random,memory,29360128,absl::flat_hash_map,1715859456
random,memory,29369210,absl::flat_hash_map,1144307712
random,time,30000000,absl::flat_hash_map,3.818000
random,memory,30002294,absl::flat_hash_map,1144307712
random,time,40000000,absl::flat_hash_map,5.070000
random,memory,40010797,absl::flat_hash_map,1144307712
random,time,50000000,absl::flat_hash_map,6.323000
random,memory,50009729,absl::flat_hash_map,1144307712
random,memory,58720255,absl::flat_hash_map,1144307712
random,memory,58720256,absl::flat_hash_map,3430486016
random,memory,58721491,absl::flat_hash_map,2287403008
random,time,60000000,absl::flat_hash_map,8.700000
random,memory,60002661,absl::flat_hash_map,2287403008
random,time,70000000,absl::flat_hash_map,10.155000
random,memory,70010887,absl::flat_hash_map,2287403008
random,time,80000000,absl::flat_hash_map,11.589000
random,memory,80002681,absl::flat_hash_map,2287403008
random,time,90000000,absl::flat_hash_map,13.020000
random,memory,90012468,absl::flat_hash_map,2287403008
random,time,100000000,absl::flat_hash_map,14.407000

View File

@ -1,499 +0,0 @@
random,memory,0,std::unordered_map,6688768
random,memory,94189,std::unordered_map,7778304
random,memory,109769,std::unordered_map,8556544
random,memory,122654,std::unordered_map,9261056
random,memory,131072,std::unordered_map,13778944
random,memory,131072,std::unordered_map,11677696
random,memory,139313,std::unordered_map,12144640
random,memory,153935,std::unordered_map,12943360
random,memory,165753,std::unordered_map,13643776
random,memory,177309,std::unordered_map,14266368
random,memory,188501,std::unordered_map,14733312
random,memory,198715,std::unordered_map,15282176
random,memory,208082,std::unordered_map,15749120
random,memory,217961,std::unordered_map,16293888
random,memory,228367,std::unordered_map,16838656
random,memory,248349,std::unordered_map,17854464
random,memory,262144,std::unordered_map,26890240
random,memory,262144,std::unordered_map,22683648
random,memory,276980,std::unordered_map,23543808
random,memory,296991,std::unordered_map,24477696
random,memory,317107,std::unordered_map,25571328
random,memory,336773,std::unordered_map,26660864
random,memory,356852,std::unordered_map,27676672
random,memory,374674,std::unordered_map,28532736
random,memory,393524,std::unordered_map,29544448
random,memory,412757,std::unordered_map,30482432
random,memory,430634,std::unordered_map,31416320
random,memory,456096,std::unordered_map,32743424
random,memory,480998,std::unordered_map,34017280
random,memory,506761,std::unordered_map,35340288
random,memory,524288,std::unordered_map,53096448
random,memory,524288,std::unordered_map,44687360
random,memory,559809,std::unordered_map,46481408
random,memory,586869,std::unordered_map,47882240
random,memory,625664,std::unordered_map,49827840
random,memory,661343,std::unordered_map,51781632
random,memory,697780,std::unordered_map,53575680
random,memory,732263,std::unordered_map,55369728
random,memory,767346,std::unordered_map,57163776
random,memory,801265,std::unordered_map,58880000
random,memory,843401,std::unordered_map,61063168
random,memory,883359,std::unordered_map,63008768
random,memory,923703,std::unordered_map,65114112
random,memory,962276,std::unordered_map,67145728
random,memory,1000499,std::unordered_map,69173248
random,memory,1046029,std::unordered_map,71438336
random,memory,1048576,std::unordered_map,105222144
random,memory,1048576,std::unordered_map,88412160
random,memory,1103068,std::unordered_map,91217920
random,memory,1166341,std::unordered_map,94412800
random,memory,1227947,std::unordered_map,97611776
random,memory,1288360,std::unordered_map,100732928
random,memory,1348784,std::unordered_map,103849984
random,memory,1415960,std::unordered_map,107282432
random,memory,1483476,std::unordered_map,110710784
random,memory,1551489,std::unordered_map,114221056
random,memory,1622998,std::unordered_map,117964800
random,memory,1698528,std::unordered_map,121786368
random,memory,1774279,std::unordered_map,125607936
random,memory,1852847,std::unordered_map,129658880
random,memory,1935045,std::unordered_map,133955584
random,memory,2016124,std::unordered_map,138084352
random,memory,2097152,std::unordered_map,209465344
random,memory,2097152,std::unordered_map,175845376
random,memory,2202017,std::unordered_map,181227520
random,memory,2308233,std::unordered_map,186687488
random,memory,2421995,std::unordered_map,192569344
random,memory,2540952,std::unordered_map,198647808
random,memory,2664197,std::unordered_map,205049856
random,memory,2786842,std::unordered_map,211288064
random,memory,2914893,std::unordered_map,217915392
random,memory,3042611,std::unordered_map,224464896
random,memory,3177918,std::unordered_map,231325696
random,memory,3316856,std::unordered_map,238583808
random,memory,3463219,std::unordered_map,245989376
random,memory,3606297,std::unordered_map,253440000
random,memory,3758685,std::unordered_map,261234688
random,memory,3918344,std::unordered_map,269426688
random,memory,4082497,std::unordered_map,277848064
random,memory,4194304,std::unordered_map,418111488
random,memory,4194304,std::unordered_map,350871552
random,memory,4405390,std::unordered_map,361631744
random,memory,4622462,std::unordered_map,372862976
random,memory,4843447,std::unordered_map,384253952
random,memory,5077057,std::unordered_map,396234752
random,memory,5310379,std::unordered_map,408170496
random,memory,5553459,std::unordered_map,420728832
random,memory,5801485,std::unordered_map,433438720
random,memory,6061642,std::unordered_map,446771200
random,memory,6321544,std::unordered_map,460189696
random,memory,6597657,std::unordered_map,474308608
random,memory,6874638,std::unordered_map,488579072
random,memory,7165061,std::unordered_map,503480320
random,memory,7464156,std::unordered_map,518844416
random,memory,7769321,std::unordered_map,534519808
random,memory,8083787,std::unordered_map,550666240
random,memory,8388608,std::unordered_map,835313664
random,memory,8388608,std::unordered_map,700833792
random,memory,8799364,std::unordered_map,721883136
random,memory,9228893,std::unordered_map,743878656
random,memory,9664620,std::unordered_map,766345216
random,time,10000000,std::unordered_map,4.373000
random,memory,10005035,std::unordered_map,783814656
random,memory,10114472,std::unordered_map,789352448
random,memory,10581340,std::unordered_map,813371392
random,memory,11060026,std::unordered_map,837943296
random,memory,11554760,std::unordered_map,863367168
random,memory,12063672,std::unordered_map,889499648
random,memory,12588048,std::unordered_map,916488192
random,memory,13128601,std::unordered_map,944173056
random,memory,13682065,std::unordered_map,972640256
random,memory,14255923,std::unordered_map,1002127360
random,memory,14847433,std::unordered_map,1032548352
random,memory,15456818,std::unordered_map,1063825408
random,memory,16080459,std::unordered_map,1095798784
random,memory,16726977,std::unordered_map,1128947712
random,memory,16777217,std::unordered_map,1669529600
random,memory,16777217,std::unordered_map,1400569856
random,memory,17595085,std::unordered_map,1442603008
random,memory,18438183,std::unordered_map,1485893632
random,memory,19311311,std::unordered_map,1530658816
random,time,20000000,std::unordered_map,8.842000
random,memory,20000810,std::unordered_map,1566150656
random,memory,20207250,std::unordered_map,1576677376
random,memory,21131235,std::unordered_map,1624178688
random,memory,22086647,std::unordered_map,1673158656
random,memory,23064920,std::unordered_map,1723465728
random,memory,24073299,std::unordered_map,1775177728
random,memory,25110516,std::unordered_map,1828532224
random,memory,26181575,std::unordered_map,1883516928
random,memory,27282467,std::unordered_map,1940062208
random,memory,28422030,std::unordered_map,1998561280
random,memory,29593778,std::unordered_map,2058694656
random,time,30000000,std::unordered_map,12.018000
random,memory,30000114,std::unordered_map,2079678464
random,memory,30796939,std::unordered_map,2120552448
random,memory,32039135,std::unordered_map,2184355840
random,memory,33320240,std::unordered_map,2250104832
random,memory,33554434,std::unordered_map,3338047488
random,memory,33554434,std::unordered_map,2800128000
random,memory,35194605,std::unordered_map,2884362240
random,memory,36886268,std::unordered_map,2971246592
random,memory,38624437,std::unordered_map,3060473856
random,time,40000000,std::unordered_map,18.924999
random,memory,40003628,std::unordered_map,3131297792
random,memory,40417618,std::unordered_map,3152588800
random,memory,42264600,std::unordered_map,3247431680
random,memory,44165274,std::unordered_map,3345006592
random,memory,46122181,std::unordered_map,3445542912
random,memory,48137986,std::unordered_map,3549040640
random,time,50000000,std::unordered_map,22.261999
random,memory,50001657,std::unordered_map,3644821504
random,memory,50216354,std::unordered_map,3655737344
random,memory,52356080,std::unordered_map,3765637120
random,memory,54556920,std::unordered_map,3878731776
random,memory,56823702,std::unordered_map,3995103232
random,memory,59156726,std::unordered_map,4114980864
random,time,60000000,std::unordered_map,25.919001
random,memory,60002957,std::unordered_map,4158427136
random,memory,61562985,std::unordered_map,4238528512
random,memory,64040759,std::unordered_map,4365746176
random,memory,66594964,std::unordered_map,4496855040
random,memory,67108868,std::unordered_map,6675001344
random,memory,67108868,std::unordered_map,5599162368
random,time,70000000,std::unordered_map,37.734001
random,memory,70005322,std::unordered_map,5747867648
random,memory,70384719,std::unordered_map,5767364608
random,memory,73758686,std::unordered_map,5940674560
random,memory,77233925,std::unordered_map,6119124992
random,time,80000000,std::unordered_map,41.104000
random,memory,80002815,std::unordered_map,6261395456
random,memory,80810186,std::unordered_map,6302810112
random,memory,84496350,std::unordered_map,6492106752
random,memory,88293603,std::unordered_map,6687174656
random,time,90000000,std::unordered_map,44.681000
random,memory,90004365,std::unordered_map,6774996992
random,memory,92206220,std::unordered_map,6888091648
random,memory,96235553,std::unordered_map,7095013376
random,time,100000000,std::unordered_map,48.382000
random,memory,0,phmap::flat_hash_map,15740928
random,memory,240967,phmap::flat_hash_map,11272192
random,memory,458751,phmap::flat_hash_map,11272192
random,memory,458752,phmap::flat_hash_map,29138944
random,memory,493930,phmap::flat_hash_map,20205568
random,memory,678845,phmap::flat_hash_map,19087360
random,memory,917503,phmap::flat_hash_map,19087360
random,memory,917504,phmap::flat_hash_map,54812672
random,memory,930488,phmap::flat_hash_map,36945920
random,memory,1835007,phmap::flat_hash_map,36945920
random,memory,1835008,phmap::flat_hash_map,108392448
random,memory,1860950,phmap::flat_hash_map,72667136
random,memory,3670015,phmap::flat_hash_map,72667136
random,memory,3670016,phmap::flat_hash_map,215556096
random,memory,3681610,phmap::flat_hash_map,144109568
random,memory,7340031,phmap::flat_hash_map,144109568
random,memory,7340032,phmap::flat_hash_map,429883392
random,memory,7348393,phmap::flat_hash_map,286994432
random,time,10000000,phmap::flat_hash_map,0.917000
random,memory,10000174,phmap::flat_hash_map,286994432
random,memory,14680063,phmap::flat_hash_map,286994432
random,memory,14680064,phmap::flat_hash_map,858537984
random,memory,14680512,phmap::flat_hash_map,572764160
random,time,20000000,phmap::flat_hash_map,2.199000
random,memory,20013320,phmap::flat_hash_map,572764160
random,memory,29360127,phmap::flat_hash_map,572764160
random,memory,29360128,phmap::flat_hash_map,1715859456
random,memory,29369210,phmap::flat_hash_map,1144307712
random,time,30000000,phmap::flat_hash_map,3.818000
random,memory,30002294,phmap::flat_hash_map,1144307712
random,time,40000000,phmap::flat_hash_map,5.070000
random,memory,40010797,phmap::flat_hash_map,1144307712
random,time,50000000,phmap::flat_hash_map,6.323000
random,memory,50009729,phmap::flat_hash_map,1144307712
random,memory,58720255,phmap::flat_hash_map,1144307712
random,memory,58720256,phmap::flat_hash_map,3430486016
random,memory,58721491,phmap::flat_hash_map,2287403008
random,time,60000000,phmap::flat_hash_map,8.700000
random,memory,60002661,phmap::flat_hash_map,2287403008
random,time,70000000,phmap::flat_hash_map,10.155000
random,memory,70010887,phmap::flat_hash_map,2287403008
random,time,80000000,phmap::flat_hash_map,11.589000
random,memory,80002681,phmap::flat_hash_map,2287403008
random,time,90000000,phmap::flat_hash_map,13.020000
random,memory,90012468,phmap::flat_hash_map,2287403008
random,time,100000000,phmap::flat_hash_map,14.407000
random,memory,0,phmap::parallel_flat_hash_map,6688768
random,memory,228584,phmap::parallel_flat_hash_map,6688768
random,memory,228585,phmap::parallel_flat_hash_map,8372224
random,memory,230683,phmap::parallel_flat_hash_map,8372224
random,memory,230684,phmap::parallel_flat_hash_map,11190272
random,memory,257042,phmap::parallel_flat_hash_map,11190272
random,memory,257105,phmap::parallel_flat_hash_map,11751424
random,memory,456008,phmap::parallel_flat_hash_map,11751424
random,memory,456009,phmap::parallel_flat_hash_map,13996032
random,memory,456819,phmap::parallel_flat_hash_map,13582336
random,memory,458740,phmap::parallel_flat_hash_map,13582336
random,memory,458741,phmap::parallel_flat_hash_map,15847424
random,memory,459266,phmap::parallel_flat_hash_map,15847424
random,memory,459267,phmap::parallel_flat_hash_map,17518592
random,memory,465267,phmap::parallel_flat_hash_map,17518592
random,memory,465268,phmap::parallel_flat_hash_map,21155840
random,memory,494937,phmap::parallel_flat_hash_map,20598784
random,memory,911236,phmap::parallel_flat_hash_map,20598784
random,memory,911237,phmap::parallel_flat_hash_map,22835200
random,memory,913145,phmap::parallel_flat_hash_map,22835200
random,memory,913146,phmap::parallel_flat_hash_map,25067520
random,memory,914338,phmap::parallel_flat_hash_map,25067520
random,memory,914339,phmap::parallel_flat_hash_map,27303936
random,memory,916480,phmap::parallel_flat_hash_map,27303936
random,memory,916481,phmap::parallel_flat_hash_map,29536256
random,memory,916523,phmap::parallel_flat_hash_map,29536256
random,memory,916524,phmap::parallel_flat_hash_map,30650368
random,memory,917790,phmap::parallel_flat_hash_map,30650368
random,memory,917791,phmap::parallel_flat_hash_map,32882688
random,memory,918474,phmap::parallel_flat_hash_map,32882688
random,memory,918475,phmap::parallel_flat_hash_map,35115008
random,memory,924420,phmap::parallel_flat_hash_map,35115008
random,memory,924421,phmap::parallel_flat_hash_map,37355520
random,memory,937279,phmap::parallel_flat_hash_map,37355520
random,memory,937319,phmap::parallel_flat_hash_map,38465536
random,memory,1826595,phmap::parallel_flat_hash_map,38465536
random,memory,1826596,phmap::parallel_flat_hash_map,42934272
random,memory,1827102,phmap::parallel_flat_hash_map,42934272
random,memory,1827103,phmap::parallel_flat_hash_map,45170688
random,memory,1828265,phmap::parallel_flat_hash_map,45170688
random,memory,1828266,phmap::parallel_flat_hash_map,47398912
random,memory,1831166,phmap::parallel_flat_hash_map,47398912
random,memory,1831167,phmap::parallel_flat_hash_map,49631232
random,memory,1831515,phmap::parallel_flat_hash_map,49631232
random,memory,1831516,phmap::parallel_flat_hash_map,51867648
random,memory,1833264,phmap::parallel_flat_hash_map,51867648
random,memory,1833265,phmap::parallel_flat_hash_map,54099968
random,memory,1833345,phmap::parallel_flat_hash_map,54099968
random,memory,1833346,phmap::parallel_flat_hash_map,56332288
random,memory,1835078,phmap::parallel_flat_hash_map,56332288
random,memory,1835079,phmap::parallel_flat_hash_map,58572800
random,memory,1836213,phmap::parallel_flat_hash_map,58572800
random,memory,1836214,phmap::parallel_flat_hash_map,60801024
random,memory,1836364,phmap::parallel_flat_hash_map,60801024
random,memory,1836365,phmap::parallel_flat_hash_map,63033344
random,memory,1836849,phmap::parallel_flat_hash_map,63033344
random,memory,1836850,phmap::parallel_flat_hash_map,65265664
random,memory,1838065,phmap::parallel_flat_hash_map,65265664
random,memory,1838066,phmap::parallel_flat_hash_map,67502080
random,memory,1839241,phmap::parallel_flat_hash_map,67502080
random,memory,1839242,phmap::parallel_flat_hash_map,69734400
random,memory,1839771,phmap::parallel_flat_hash_map,69734400
random,memory,1839772,phmap::parallel_flat_hash_map,71962624
random,memory,1844031,phmap::parallel_flat_hash_map,71962624
random,memory,1844032,phmap::parallel_flat_hash_map,74194944
random,memory,1844165,phmap::parallel_flat_hash_map,74194944
random,memory,1844166,phmap::parallel_flat_hash_map,76423168
random,memory,1849529,phmap::parallel_flat_hash_map,74186752
random,memory,3656347,phmap::parallel_flat_hash_map,74186752
random,memory,3656348,phmap::parallel_flat_hash_map,83120128
random,memory,3658236,phmap::parallel_flat_hash_map,83120128
random,memory,3658237,phmap::parallel_flat_hash_map,87592960
random,memory,3660832,phmap::parallel_flat_hash_map,87592960
random,memory,3660833,phmap::parallel_flat_hash_map,92061696
random,memory,3663897,phmap::parallel_flat_hash_map,92061696
random,memory,3663898,phmap::parallel_flat_hash_map,96526336
random,memory,3668004,phmap::parallel_flat_hash_map,96526336
random,memory,3668005,phmap::parallel_flat_hash_map,100990976
random,memory,3668781,phmap::parallel_flat_hash_map,100990976
random,memory,3668782,phmap::parallel_flat_hash_map,105459712
random,memory,3669316,phmap::parallel_flat_hash_map,100990976
random,memory,3669736,phmap::parallel_flat_hash_map,100990976
random,memory,3669737,phmap::parallel_flat_hash_map,109928448
random,memory,3670780,phmap::parallel_flat_hash_map,109928448
random,memory,3670781,phmap::parallel_flat_hash_map,114388992
random,memory,3671735,phmap::parallel_flat_hash_map,114388992
random,memory,3671736,phmap::parallel_flat_hash_map,118853632
random,memory,3672742,phmap::parallel_flat_hash_map,118853632
random,memory,3672743,phmap::parallel_flat_hash_map,123322368
random,memory,3672841,phmap::parallel_flat_hash_map,123322368
random,memory,3672842,phmap::parallel_flat_hash_map,127787008
random,memory,3674661,phmap::parallel_flat_hash_map,127787008
random,memory,3674662,phmap::parallel_flat_hash_map,132259840
random,memory,3675918,phmap::parallel_flat_hash_map,132259840
random,memory,3675919,phmap::parallel_flat_hash_map,136724480
random,memory,3676502,phmap::parallel_flat_hash_map,136724480
random,memory,3676503,phmap::parallel_flat_hash_map,141180928
random,memory,3676556,phmap::parallel_flat_hash_map,141180928
random,memory,3676557,phmap::parallel_flat_hash_map,145645568
random,memory,3679943,phmap::parallel_flat_hash_map,141176832
random,memory,3682847,phmap::parallel_flat_hash_map,141176832
random,memory,3682848,phmap::parallel_flat_hash_map,150106112
random,memory,3701420,phmap::parallel_flat_hash_map,145637376
random,memory,7323550,phmap::parallel_flat_hash_map,145637376
random,memory,7323551,phmap::parallel_flat_hash_map,163500032
random,memory,7325955,phmap::parallel_flat_hash_map,154566656
random,memory,7326781,phmap::parallel_flat_hash_map,154566656
random,memory,7326782,phmap::parallel_flat_hash_map,172433408
random,memory,7327471,phmap::parallel_flat_hash_map,172433408
random,memory,7327472,phmap::parallel_flat_hash_map,181362688
random,memory,7328548,phmap::parallel_flat_hash_map,181362688
random,memory,7328549,phmap::parallel_flat_hash_map,190300160
random,memory,7331571,phmap::parallel_flat_hash_map,190300160
random,memory,7331572,phmap::parallel_flat_hash_map,199229440
random,memory,7333270,phmap::parallel_flat_hash_map,199229440
random,memory,7333271,phmap::parallel_flat_hash_map,208154624
random,memory,7336330,phmap::parallel_flat_hash_map,208154624
random,memory,7336331,phmap::parallel_flat_hash_map,217083904
random,memory,7338941,phmap::parallel_flat_hash_map,217083904
random,memory,7338942,phmap::parallel_flat_hash_map,226021376
random,memory,7339987,phmap::parallel_flat_hash_map,226021376
random,memory,7339988,phmap::parallel_flat_hash_map,234950656
random,memory,7340192,phmap::parallel_flat_hash_map,234950656
random,memory,7340193,phmap::parallel_flat_hash_map,243879936
random,memory,7340212,phmap::parallel_flat_hash_map,243879936
random,memory,7340213,phmap::parallel_flat_hash_map,252805120
random,memory,7340756,phmap::parallel_flat_hash_map,252805120
random,memory,7340757,phmap::parallel_flat_hash_map,261734400
random,memory,7353138,phmap::parallel_flat_hash_map,261734400
random,memory,7353139,phmap::parallel_flat_hash_map,270659584
random,memory,7355638,phmap::parallel_flat_hash_map,270659584
random,memory,7355639,phmap::parallel_flat_hash_map,279592960
random,memory,7358552,phmap::parallel_flat_hash_map,279592960
random,memory,7358553,phmap::parallel_flat_hash_map,288522240
random,memory,7363002,phmap::parallel_flat_hash_map,279584768
random,memory,7364175,phmap::parallel_flat_hash_map,279584768
random,memory,7364176,phmap::parallel_flat_hash_map,297451520
random,memory,7379232,phmap::parallel_flat_hash_map,288518144
random,time,10000000,phmap::parallel_flat_hash_map,1.115000
random,memory,10001837,phmap::parallel_flat_hash_map,288518144
random,memory,14641981,phmap::parallel_flat_hash_map,288518144
random,memory,14641982,phmap::parallel_flat_hash_map,324243456
random,memory,14649536,phmap::parallel_flat_hash_map,306380800
random,memory,14658094,phmap::parallel_flat_hash_map,306380800
random,memory,14658095,phmap::parallel_flat_hash_map,342106112
random,memory,14663598,phmap::parallel_flat_hash_map,342106112
random,memory,14663599,phmap::parallel_flat_hash_map,359968768
random,memory,14667323,phmap::parallel_flat_hash_map,359968768
random,memory,14667324,phmap::parallel_flat_hash_map,377835520
random,memory,14668425,phmap::parallel_flat_hash_map,377835520
random,memory,14668426,phmap::parallel_flat_hash_map,395694080
random,memory,14669145,phmap::parallel_flat_hash_map,395694080
random,memory,14669146,phmap::parallel_flat_hash_map,413560832
random,memory,14669916,phmap::parallel_flat_hash_map,395698176
random,memory,14673506,phmap::parallel_flat_hash_map,395698176
random,memory,14673507,phmap::parallel_flat_hash_map,431423488
random,memory,14676201,phmap::parallel_flat_hash_map,431423488
random,memory,14676202,phmap::parallel_flat_hash_map,449286144
random,memory,14681323,phmap::parallel_flat_hash_map,449286144
random,memory,14681324,phmap::parallel_flat_hash_map,467152896
random,memory,14684771,phmap::parallel_flat_hash_map,449286144
random,memory,14686498,phmap::parallel_flat_hash_map,449286144
random,memory,14686499,phmap::parallel_flat_hash_map,485011456
random,memory,14691299,phmap::parallel_flat_hash_map,485011456
random,memory,14691300,phmap::parallel_flat_hash_map,502865920
random,memory,14694531,phmap::parallel_flat_hash_map,502865920
random,memory,14694532,phmap::parallel_flat_hash_map,520728576
random,memory,14696324,phmap::parallel_flat_hash_map,520728576
random,memory,14696325,phmap::parallel_flat_hash_map,538587136
random,memory,14701255,phmap::parallel_flat_hash_map,538587136
random,memory,14701256,phmap::parallel_flat_hash_map,556445696
random,memory,14702651,phmap::parallel_flat_hash_map,538578944
random,memory,14704639,phmap::parallel_flat_hash_map,538578944
random,memory,14704640,phmap::parallel_flat_hash_map,574300160
random,memory,14707748,phmap::parallel_flat_hash_map,574300160
random,memory,14707749,phmap::parallel_flat_hash_map,592158720
random,memory,14711651,phmap::parallel_flat_hash_map,574296064
random,time,20000000,phmap::parallel_flat_hash_map,2.484000
random,memory,20006564,phmap::parallel_flat_hash_map,574296064
random,memory,29321443,phmap::parallel_flat_hash_map,574296064
random,memory,29321444,phmap::parallel_flat_hash_map,645742592
random,memory,29322576,phmap::parallel_flat_hash_map,645742592
random,memory,29322577,phmap::parallel_flat_hash_map,681463808
random,memory,29331685,phmap::parallel_flat_hash_map,645742592
random,memory,29333141,phmap::parallel_flat_hash_map,645742592
random,memory,29333142,phmap::parallel_flat_hash_map,717189120
random,memory,29336447,phmap::parallel_flat_hash_map,717189120
random,memory,29336448,phmap::parallel_flat_hash_map,752910336
random,memory,29345055,phmap::parallel_flat_hash_map,717185024
random,memory,29352413,phmap::parallel_flat_hash_map,717185024
random,memory,29352414,phmap::parallel_flat_hash_map,788627456
random,memory,29357051,phmap::parallel_flat_hash_map,752902144
random,memory,29357141,phmap::parallel_flat_hash_map,752902144
random,memory,29357142,phmap::parallel_flat_hash_map,824348672
random,memory,29359481,phmap::parallel_flat_hash_map,824348672
random,memory,29359482,phmap::parallel_flat_hash_map,860069888
random,memory,29362077,phmap::parallel_flat_hash_map,860069888
random,memory,29362078,phmap::parallel_flat_hash_map,895795200
random,memory,29366120,phmap::parallel_flat_hash_map,895795200
random,memory,29366121,phmap::parallel_flat_hash_map,931512320
random,memory,29368098,phmap::parallel_flat_hash_map,931512320
random,memory,29368099,phmap::parallel_flat_hash_map,967229440
random,memory,29368978,phmap::parallel_flat_hash_map,931508224
random,memory,29373953,phmap::parallel_flat_hash_map,931508224
random,memory,29373954,phmap::parallel_flat_hash_map,1002954752
random,memory,29376083,phmap::parallel_flat_hash_map,1002954752
random,memory,29376084,phmap::parallel_flat_hash_map,1038680064
random,memory,29378406,phmap::parallel_flat_hash_map,1002950656
random,memory,29378970,phmap::parallel_flat_hash_map,1002950656
random,memory,29378971,phmap::parallel_flat_hash_map,1074397184
random,memory,29380083,phmap::parallel_flat_hash_map,1074397184
random,memory,29380084,phmap::parallel_flat_hash_map,1110122496
random,memory,29381250,phmap::parallel_flat_hash_map,1110122496
random,memory,29381251,phmap::parallel_flat_hash_map,1145839616
random,memory,29384576,phmap::parallel_flat_hash_map,1110110208
random,memory,29391514,phmap::parallel_flat_hash_map,1110110208
random,memory,29391515,phmap::parallel_flat_hash_map,1181556736
random,memory,29398827,phmap::parallel_flat_hash_map,1145835520
random,time,30000000,phmap::parallel_flat_hash_map,4.197000
random,memory,30003726,phmap::parallel_flat_hash_map,1145835520
random,time,40000000,phmap::parallel_flat_hash_map,5.407000
random,memory,40004260,phmap::parallel_flat_hash_map,1145835520
random,time,50000000,phmap::parallel_flat_hash_map,6.651000
random,memory,50008463,phmap::parallel_flat_hash_map,1145835520
random,memory,58650774,phmap::parallel_flat_hash_map,1145835520
random,memory,58650775,phmap::parallel_flat_hash_map,1288724480
random,memory,58651341,phmap::parallel_flat_hash_map,1217282048
random,memory,58670748,phmap::parallel_flat_hash_map,1217282048
random,memory,58670749,phmap::parallel_flat_hash_map,1360171008
random,memory,58672543,phmap::parallel_flat_hash_map,1288724480
random,memory,58679343,phmap::parallel_flat_hash_map,1288724480
random,memory,58679344,phmap::parallel_flat_hash_map,1431609344
random,memory,58679621,phmap::parallel_flat_hash_map,1431609344
random,memory,58679622,phmap::parallel_flat_hash_map,1503047680
random,memory,58681449,phmap::parallel_flat_hash_map,1503047680
random,memory,58681450,phmap::parallel_flat_hash_map,1574498304
random,memory,58687442,phmap::parallel_flat_hash_map,1503055872
random,memory,58716081,phmap::parallel_flat_hash_map,1503055872
random,memory,58716082,phmap::parallel_flat_hash_map,1645944832
random,memory,58719988,phmap::parallel_flat_hash_map,1574498304
random,memory,58720496,phmap::parallel_flat_hash_map,1574498304
random,memory,58720497,phmap::parallel_flat_hash_map,1717387264
random,memory,58723911,phmap::parallel_flat_hash_map,1717387264
random,memory,58723912,phmap::parallel_flat_hash_map,1788841984
random,memory,58728095,phmap::parallel_flat_hash_map,1717395456
random,memory,58731608,phmap::parallel_flat_hash_map,1717395456
random,memory,58731609,phmap::parallel_flat_hash_map,1860280320
random,memory,58737338,phmap::parallel_flat_hash_map,1860280320
random,memory,58737339,phmap::parallel_flat_hash_map,1931718656
random,memory,58737397,phmap::parallel_flat_hash_map,1860272128
random,memory,58744726,phmap::parallel_flat_hash_map,1860272128
random,memory,58744727,phmap::parallel_flat_hash_map,2003165184
random,memory,58746205,phmap::parallel_flat_hash_map,1931718656
random,memory,58752523,phmap::parallel_flat_hash_map,1931718656
random,memory,58752524,phmap::parallel_flat_hash_map,2074607616
random,memory,58753838,phmap::parallel_flat_hash_map,2074607616
random,memory,58753839,phmap::parallel_flat_hash_map,2146054144
random,memory,58756083,phmap::parallel_flat_hash_map,2146054144
random,memory,58756084,phmap::parallel_flat_hash_map,2217496576
random,memory,58758266,phmap::parallel_flat_hash_map,2217496576
random,memory,58758267,phmap::parallel_flat_hash_map,2288943104
random,memory,58760494,phmap::parallel_flat_hash_map,2217492480
random,memory,58766191,phmap::parallel_flat_hash_map,2217492480
random,memory,58766192,phmap::parallel_flat_hash_map,2360381440
random,memory,58773720,phmap::parallel_flat_hash_map,2288934912
random,time,60000000,phmap::parallel_flat_hash_map,9.067000
random,memory,60002586,phmap::parallel_flat_hash_map,2288934912
random,time,70000000,phmap::parallel_flat_hash_map,10.409000
random,memory,70011900,phmap::parallel_flat_hash_map,2288934912
random,time,80000000,phmap::parallel_flat_hash_map,11.747000
random,memory,80002981,phmap::parallel_flat_hash_map,2288934912
random,time,90000000,phmap::parallel_flat_hash_map,13.091000
random,memory,90007030,phmap::parallel_flat_hash_map,2288934912
random,time,100000000,phmap::parallel_flat_hash_map,14.467000

View File

@ -1,838 +0,0 @@
random,memory,0,phmap::flat_hash_map,15736832
random,memory,262696,phmap::flat_hash_map,15736832
random,memory,262879,phmap::flat_hash_map,11268096
random,memory,458751,phmap::flat_hash_map,11268096
random,memory,458752,phmap::flat_hash_map,29134848
random,memory,493071,phmap::flat_hash_map,29134848
random,memory,493277,phmap::flat_hash_map,20201472
random,memory,680181,phmap::flat_hash_map,20201472
random,memory,680399,phmap::flat_hash_map,19083264
random,memory,917503,phmap::flat_hash_map,19083264
random,memory,917504,phmap::flat_hash_map,54808576
random,memory,927756,phmap::flat_hash_map,54808576
random,memory,927844,phmap::flat_hash_map,36941824
random,memory,1835007,phmap::flat_hash_map,36941824
random,memory,1835008,phmap::flat_hash_map,108388352
random,memory,1840514,phmap::flat_hash_map,108388352
random,memory,1840562,phmap::flat_hash_map,72663040
random,memory,3670015,phmap::flat_hash_map,72663040
random,memory,3670016,phmap::flat_hash_map,215552000
random,memory,3672773,phmap::flat_hash_map,215552000
random,memory,3672818,phmap::flat_hash_map,144105472
random,memory,7340031,phmap::flat_hash_map,144105472
random,memory,7340032,phmap::flat_hash_map,429887488
random,memory,7341507,phmap::flat_hash_map,429887488
random,memory,7341551,phmap::flat_hash_map,286994432
random,time,10000000,phmap::flat_hash_map,0.959000
random,memory,10013489,phmap::flat_hash_map,286994432
random,memory,14680063,phmap::flat_hash_map,286994432
random,memory,14680064,phmap::flat_hash_map,858537984
random,memory,14689336,phmap::flat_hash_map,858537984
random,memory,14689395,phmap::flat_hash_map,572764160
random,time,20000000,phmap::flat_hash_map,2.235000
random,memory,20014360,phmap::flat_hash_map,572764160
random,memory,29360127,phmap::flat_hash_map,572764160
random,memory,29360128,phmap::flat_hash_map,1715855360
random,memory,29362598,phmap::flat_hash_map,1715855360
random,memory,29362641,phmap::flat_hash_map,1144303616
random,time,30000000,phmap::flat_hash_map,3.893000
random,memory,30002217,phmap::flat_hash_map,1144303616
random,time,40000000,phmap::flat_hash_map,5.194000
random,memory,40013295,phmap::flat_hash_map,1144303616
random,time,50000000,phmap::flat_hash_map,6.478000
random,memory,50004165,phmap::flat_hash_map,1144303616
random,memory,58720255,phmap::flat_hash_map,1144303616
random,memory,58720256,phmap::flat_hash_map,3430486016
random,memory,58730855,phmap::flat_hash_map,3430486016
random,memory,58730895,phmap::flat_hash_map,2287407104
random,time,60000000,phmap::flat_hash_map,8.861000
random,memory,60005803,phmap::flat_hash_map,2287407104
random,time,70000000,phmap::flat_hash_map,10.361000
random,memory,70008717,phmap::flat_hash_map,2287407104
random,time,80000000,phmap::flat_hash_map,11.848000
random,memory,80003058,phmap::flat_hash_map,2287407104
random,time,90000000,phmap::flat_hash_map,13.318000
random,memory,90012411,phmap::flat_hash_map,2287407104
random,time,100000000,phmap::flat_hash_map,14.773000
random,memory,0,phmap::parallel_flat_hash_map_4,8425472
random,memory,230139,phmap::parallel_flat_hash_map_4,8503296
random,memory,230140,phmap::parallel_flat_hash_map_4,10977280
random,memory,253089,phmap::parallel_flat_hash_map_4,10977280
random,memory,253158,phmap::parallel_flat_hash_map_4,13225984
random,memory,454288,phmap::parallel_flat_hash_map_4,13225984
random,memory,454289,phmap::parallel_flat_hash_map_4,14352384
random,memory,456498,phmap::parallel_flat_hash_map_4,14352384
random,memory,456499,phmap::parallel_flat_hash_map_4,14082048
random,memory,457735,phmap::parallel_flat_hash_map_4,14082048
random,memory,457736,phmap::parallel_flat_hash_map_4,15777792
random,memory,459898,phmap::parallel_flat_hash_map_4,15777792
random,memory,459899,phmap::parallel_flat_hash_map_4,18591744
random,memory,461397,phmap::parallel_flat_hash_map_4,18591744
random,memory,461398,phmap::parallel_flat_hash_map_4,20283392
random,memory,471716,phmap::parallel_flat_hash_map_4,20283392
random,memory,471760,phmap::parallel_flat_hash_map_4,21397504
random,memory,911802,phmap::parallel_flat_hash_map_4,21397504
random,memory,911803,phmap::parallel_flat_hash_map_4,23633920
random,memory,911912,phmap::parallel_flat_hash_map_4,23633920
random,memory,911963,phmap::parallel_flat_hash_map_4,22515712
random,memory,912599,phmap::parallel_flat_hash_map_4,22515712
random,memory,912600,phmap::parallel_flat_hash_map_4,25866240
random,memory,915388,phmap::parallel_flat_hash_map_4,25866240
random,memory,915389,phmap::parallel_flat_hash_map_4,28098560
random,memory,916642,phmap::parallel_flat_hash_map_4,28098560
random,memory,916643,phmap::parallel_flat_hash_map_4,30339072
random,memory,917177,phmap::parallel_flat_hash_map_4,30339072
random,memory,917178,phmap::parallel_flat_hash_map_4,32575488
random,memory,917415,phmap::parallel_flat_hash_map_4,32575488
random,memory,917416,phmap::parallel_flat_hash_map_4,33689600
random,memory,920064,phmap::parallel_flat_hash_map_4,33689600
random,memory,920065,phmap::parallel_flat_hash_map_4,35917824
random,memory,921982,phmap::parallel_flat_hash_map_4,35917824
random,memory,921983,phmap::parallel_flat_hash_map_4,38154240
random,memory,922325,phmap::parallel_flat_hash_map_4,39272448
random,memory,1826091,phmap::parallel_flat_hash_map_4,39268352
random,memory,1826092,phmap::parallel_flat_hash_map_4,43737088
random,memory,1827754,phmap::parallel_flat_hash_map_4,43737088
random,memory,1827755,phmap::parallel_flat_hash_map_4,45973504
random,memory,1830054,phmap::parallel_flat_hash_map_4,45973504
random,memory,1830055,phmap::parallel_flat_hash_map_4,48209920
random,memory,1830521,phmap::parallel_flat_hash_map_4,48209920
random,memory,1830522,phmap::parallel_flat_hash_map_4,50438144
random,memory,1831966,phmap::parallel_flat_hash_map_4,50438144
random,memory,1831967,phmap::parallel_flat_hash_map_4,52666368
random,memory,1832841,phmap::parallel_flat_hash_map_4,52666368
random,memory,1832842,phmap::parallel_flat_hash_map_4,59375616
random,memory,1836262,phmap::parallel_flat_hash_map_4,59367424
random,memory,1836263,phmap::parallel_flat_hash_map_4,61603840
random,memory,1836728,phmap::parallel_flat_hash_map_4,61603840
random,memory,1836729,phmap::parallel_flat_hash_map_4,63836160
random,memory,1836910,phmap::parallel_flat_hash_map_4,63836160
random,memory,1836911,phmap::parallel_flat_hash_map_4,66064384
random,memory,1838008,phmap::parallel_flat_hash_map_4,66064384
random,memory,1838009,phmap::parallel_flat_hash_map_4,68300800
random,memory,1839009,phmap::parallel_flat_hash_map_4,68300800
random,memory,1839010,phmap::parallel_flat_hash_map_4,70529024
random,memory,1842043,phmap::parallel_flat_hash_map_4,70529024
random,memory,1842044,phmap::parallel_flat_hash_map_4,72761344
random,memory,1842263,phmap::parallel_flat_hash_map_4,72761344
random,memory,1842264,phmap::parallel_flat_hash_map_4,74993664
random,memory,1843365,phmap::parallel_flat_hash_map_4,77230080
random,memory,1902147,phmap::parallel_flat_hash_map_4,77230080
random,memory,1902233,phmap::parallel_flat_hash_map_4,74997760
random,memory,3656950,phmap::parallel_flat_hash_map_4,74997760
random,memory,3656951,phmap::parallel_flat_hash_map_4,83935232
random,memory,3658625,phmap::parallel_flat_hash_map_4,83939328
random,memory,3658626,phmap::parallel_flat_hash_map_4,88403968
random,memory,3660741,phmap::parallel_flat_hash_map_4,88403968
random,memory,3660742,phmap::parallel_flat_hash_map_4,92872704
random,memory,3663376,phmap::parallel_flat_hash_map_4,92872704
random,memory,3663377,phmap::parallel_flat_hash_map_4,97341440
random,memory,3665288,phmap::parallel_flat_hash_map_4,97341440
random,memory,3665289,phmap::parallel_flat_hash_map_4,101801984
random,memory,3668214,phmap::parallel_flat_hash_map_4,101801984
random,memory,3668215,phmap::parallel_flat_hash_map_4,106270720
random,memory,3669632,phmap::parallel_flat_hash_map_4,106270720
random,memory,3669633,phmap::parallel_flat_hash_map_4,110731264
random,memory,3670422,phmap::parallel_flat_hash_map_4,110731264
random,memory,3670423,phmap::parallel_flat_hash_map_4,115195904
random,memory,3671980,phmap::parallel_flat_hash_map_4,115195904
random,memory,3671981,phmap::parallel_flat_hash_map_4,119656448
random,memory,3673456,phmap::parallel_flat_hash_map_4,119656448
random,memory,3673457,phmap::parallel_flat_hash_map_4,124116992
random,memory,3675504,phmap::parallel_flat_hash_map_4,124116992
random,memory,3675548,phmap::parallel_flat_hash_map_4,119644160
random,memory,3675608,phmap::parallel_flat_hash_map_4,119644160
random,memory,3675609,phmap::parallel_flat_hash_map_4,137519104
random,memory,3676812,phmap::parallel_flat_hash_map_4,137515008
random,memory,3676813,phmap::parallel_flat_hash_map_4,141983744
random,memory,3677010,phmap::parallel_flat_hash_map_4,141983744
random,memory,3677011,phmap::parallel_flat_hash_map_4,146444288
random,memory,3682438,phmap::parallel_flat_hash_map_4,146444288
random,memory,3682439,phmap::parallel_flat_hash_map_4,150904832
random,memory,3705594,phmap::parallel_flat_hash_map_4,150904832
random,memory,3705595,phmap::parallel_flat_hash_map_4,146440192
random,memory,7320177,phmap::parallel_flat_hash_map_4,146440192
random,memory,7320178,phmap::parallel_flat_hash_map_4,164302848
random,memory,7321389,phmap::parallel_flat_hash_map_4,164302848
random,memory,7321390,phmap::parallel_flat_hash_map_4,173240320
random,memory,7332480,phmap::parallel_flat_hash_map_4,173240320
random,memory,7332481,phmap::parallel_flat_hash_map_4,182169600
random,memory,7334320,phmap::parallel_flat_hash_map_4,182169600
random,memory,7334321,phmap::parallel_flat_hash_map_4,191094784
random,memory,7338310,phmap::parallel_flat_hash_map_4,191094784
random,memory,7338311,phmap::parallel_flat_hash_map_4,200028160
random,memory,7338542,phmap::parallel_flat_hash_map_4,200028160
random,memory,7338543,phmap::parallel_flat_hash_map_4,208961536
random,memory,7339365,phmap::parallel_flat_hash_map_4,208961536
random,memory,7339366,phmap::parallel_flat_hash_map_4,217899008
random,memory,7339930,phmap::parallel_flat_hash_map_4,217899008
random,memory,7339931,phmap::parallel_flat_hash_map_4,226828288
random,memory,7341026,phmap::parallel_flat_hash_map_4,226828288
random,memory,7341027,phmap::parallel_flat_hash_map_4,253620224
random,memory,7345230,phmap::parallel_flat_hash_map_4,253616128
random,memory,7345231,phmap::parallel_flat_hash_map_4,262545408
random,memory,7347839,phmap::parallel_flat_hash_map_4,262545408
random,memory,7347840,phmap::parallel_flat_hash_map_4,271470592
random,memory,7349398,phmap::parallel_flat_hash_map_4,271470592
random,memory,7349399,phmap::parallel_flat_hash_map_4,280399872
random,memory,7350072,phmap::parallel_flat_hash_map_4,280399872
random,memory,7350073,phmap::parallel_flat_hash_map_4,289329152
random,memory,7358606,phmap::parallel_flat_hash_map_4,289329152
random,memory,7358607,phmap::parallel_flat_hash_map_4,298262528
random,memory,7418699,phmap::parallel_flat_hash_map_4,298262528
random,memory,7418807,phmap::parallel_flat_hash_map_4,289329152
random,time,10000000,phmap::parallel_flat_hash_map_4,0.775000
random,memory,10143429,phmap::parallel_flat_hash_map_4,288841728
random,memory,14656465,phmap::parallel_flat_hash_map_4,288841728
random,memory,14656466,phmap::parallel_flat_hash_map_4,324567040
random,memory,14666142,phmap::parallel_flat_hash_map_4,324567040
random,memory,14666153,phmap::parallel_flat_hash_map_4,342429696
random,memory,14668185,phmap::parallel_flat_hash_map_4,342429696
random,memory,14668186,phmap::parallel_flat_hash_map_4,360292352
random,memory,14669296,phmap::parallel_flat_hash_map_4,360292352
random,memory,14669297,phmap::parallel_flat_hash_map_4,378155008
random,memory,14669466,phmap::parallel_flat_hash_map_4,378155008
random,memory,14669467,phmap::parallel_flat_hash_map_4,396017664
random,memory,14673507,phmap::parallel_flat_hash_map_4,396017664
random,memory,14673508,phmap::parallel_flat_hash_map_4,413876224
random,memory,14677314,phmap::parallel_flat_hash_map_4,413876224
random,memory,14677315,phmap::parallel_flat_hash_map_4,467460096
random,memory,14677330,phmap::parallel_flat_hash_map_4,467460096
random,memory,14677331,phmap::parallel_flat_hash_map_4,449593344
random,memory,14681511,phmap::parallel_flat_hash_map_4,449593344
random,memory,14681512,phmap::parallel_flat_hash_map_4,467456000
random,memory,14681884,phmap::parallel_flat_hash_map_4,467456000
random,memory,14681885,phmap::parallel_flat_hash_map_4,485318656
random,memory,14685984,phmap::parallel_flat_hash_map_4,485318656
random,memory,14685985,phmap::parallel_flat_hash_map_4,503173120
random,memory,14692178,phmap::parallel_flat_hash_map_4,503173120
random,memory,14692179,phmap::parallel_flat_hash_map_4,521035776
random,memory,14693317,phmap::parallel_flat_hash_map_4,521035776
random,memory,14693318,phmap::parallel_flat_hash_map_4,538902528
random,memory,14695057,phmap::parallel_flat_hash_map_4,538902528
random,memory,14695058,phmap::parallel_flat_hash_map_4,556769280
random,memory,14696242,phmap::parallel_flat_hash_map_4,556769280
random,memory,14696243,phmap::parallel_flat_hash_map_4,574623744
random,memory,14699788,phmap::parallel_flat_hash_map_4,574623744
random,memory,14699789,phmap::parallel_flat_hash_map_4,592478208
random,memory,14724882,phmap::parallel_flat_hash_map_4,592478208
random,memory,14724958,phmap::parallel_flat_hash_map_4,574607360
random,time,20000000,phmap::parallel_flat_hash_map_4,1.624000
random,memory,20059632,phmap::parallel_flat_hash_map_4,574607360
random,memory,29320741,phmap::parallel_flat_hash_map_4,574607360
random,memory,29320742,phmap::parallel_flat_hash_map_4,646053888
random,memory,29324660,phmap::parallel_flat_hash_map_4,646053888
random,memory,29324661,phmap::parallel_flat_hash_map_4,681779200
random,memory,29337731,phmap::parallel_flat_hash_map_4,681779200
random,memory,29337732,phmap::parallel_flat_hash_map_4,717500416
random,memory,29344679,phmap::parallel_flat_hash_map_4,717500416
random,memory,29344680,phmap::parallel_flat_hash_map_4,753221632
random,memory,29345420,phmap::parallel_flat_hash_map_4,753221632
random,memory,29345421,phmap::parallel_flat_hash_map_4,788938752
random,memory,29346467,phmap::parallel_flat_hash_map_4,788938752
random,memory,29346468,phmap::parallel_flat_hash_map_4,824659968
random,memory,29350032,phmap::parallel_flat_hash_map_4,824659968
random,memory,29350033,phmap::parallel_flat_hash_map_4,860385280
random,memory,29363538,phmap::parallel_flat_hash_map_4,860385280
random,memory,29363539,phmap::parallel_flat_hash_map_4,896106496
random,memory,29368515,phmap::parallel_flat_hash_map_4,896106496
random,memory,29368516,phmap::parallel_flat_hash_map_4,931831808
random,memory,29377392,phmap::parallel_flat_hash_map_4,931831808
random,memory,29377393,phmap::parallel_flat_hash_map_4,967553024
random,memory,29378023,phmap::parallel_flat_hash_map_4,967553024
random,memory,29378024,phmap::parallel_flat_hash_map_4,1003274240
random,memory,29379201,phmap::parallel_flat_hash_map_4,1003274240
random,memory,29379202,phmap::parallel_flat_hash_map_4,1038991360
random,memory,29380427,phmap::parallel_flat_hash_map_4,1038991360
random,memory,29380428,phmap::parallel_flat_hash_map_4,1074712576
random,memory,29380936,phmap::parallel_flat_hash_map_4,1074712576
random,memory,29380937,phmap::parallel_flat_hash_map_4,1110429696
random,memory,29381222,phmap::parallel_flat_hash_map_4,1110429696
random,memory,29381223,phmap::parallel_flat_hash_map_4,1146150912
random,memory,29383327,phmap::parallel_flat_hash_map_4,1146150912
random,memory,29383328,phmap::parallel_flat_hash_map_4,1181872128
random,memory,29481786,phmap::parallel_flat_hash_map_4,1181872128
random,memory,29482210,phmap::parallel_flat_hash_map_4,1146150912
random,time,30000000,phmap::parallel_flat_hash_map_4,2.765000
random,memory,30042200,phmap::parallel_flat_hash_map_4,1146150912
random,time,40000000,phmap::parallel_flat_hash_map_4,3.366000
random,memory,40007439,phmap::parallel_flat_hash_map_4,1146093568
random,time,50000000,phmap::parallel_flat_hash_map_4,3.980000
random,memory,50022406,phmap::parallel_flat_hash_map_4,1146150912
random,memory,58667479,phmap::parallel_flat_hash_map_4,1146150912
random,memory,58667498,phmap::parallel_flat_hash_map_4,1289039872
random,memory,58667500,phmap::parallel_flat_hash_map_4,1289039872
random,memory,58667517,phmap::parallel_flat_hash_map_4,1217597440
random,memory,58679732,phmap::parallel_flat_hash_map_4,1217597440
random,memory,58679733,phmap::parallel_flat_hash_map_4,1360486400
random,memory,58694839,phmap::parallel_flat_hash_map_4,1360486400
random,memory,58694840,phmap::parallel_flat_hash_map_4,1431928832
random,memory,58698836,phmap::parallel_flat_hash_map_4,1431928832
random,memory,58698837,phmap::parallel_flat_hash_map_4,1503367168
random,memory,58699874,phmap::parallel_flat_hash_map_4,1503367168
random,memory,58699875,phmap::parallel_flat_hash_map_4,1574809600
random,memory,58709079,phmap::parallel_flat_hash_map_4,1574809600
random,memory,58709080,phmap::parallel_flat_hash_map_4,1646252032
random,memory,58719855,phmap::parallel_flat_hash_map_4,1646252032
random,memory,58719863,phmap::parallel_flat_hash_map_4,1717694464
random,memory,58722595,phmap::parallel_flat_hash_map_4,1717694464
random,memory,58722596,phmap::parallel_flat_hash_map_4,1789149184
random,memory,58724186,phmap::parallel_flat_hash_map_4,1789149184
random,memory,58724187,phmap::parallel_flat_hash_map_4,1860595712
random,memory,58728663,phmap::parallel_flat_hash_map_4,1860595712
random,memory,58728664,phmap::parallel_flat_hash_map_4,1932034048
random,memory,58734146,phmap::parallel_flat_hash_map_4,1932034048
random,memory,58734147,phmap::parallel_flat_hash_map_4,2003476480
random,memory,58739881,phmap::parallel_flat_hash_map_4,2003476480
random,memory,58739882,phmap::parallel_flat_hash_map_4,2074923008
random,memory,58743626,phmap::parallel_flat_hash_map_4,2074923008
random,memory,58743627,phmap::parallel_flat_hash_map_4,2146361344
random,memory,58748930,phmap::parallel_flat_hash_map_4,2146361344
random,memory,58748931,phmap::parallel_flat_hash_map_4,2217803776
random,memory,58752653,phmap::parallel_flat_hash_map_4,2217803776
random,memory,58752654,phmap::parallel_flat_hash_map_4,2289242112
random,memory,58761467,phmap::parallel_flat_hash_map_4,2289242112
random,memory,58761468,phmap::parallel_flat_hash_map_4,2360680448
random,memory,58767953,phmap::parallel_flat_hash_map_4,2360680448
random,memory,58767993,phmap::parallel_flat_hash_map_4,2289233920
random,time,60000000,phmap::parallel_flat_hash_map_4,5.747000
random,memory,60013676,phmap::parallel_flat_hash_map_4,2289242112
random,time,70000000,phmap::parallel_flat_hash_map_4,6.369000
random,memory,70124243,phmap::parallel_flat_hash_map_4,2289233920
random,time,80000000,phmap::parallel_flat_hash_map_4,7.042000
random,memory,80028849,phmap::parallel_flat_hash_map_4,2289238016
random,time,90000000,phmap::parallel_flat_hash_map_4,7.670000
random,memory,90048047,phmap::parallel_flat_hash_map_4,2289238016
random,time,100000000,phmap::parallel_flat_hash_map_4,8.369000
random,memory,0,phmap::parallel_flat_hash_map_5,8171520
random,memory,230048,phmap::parallel_flat_hash_map_5,8171520
random,memory,230049,phmap::parallel_flat_hash_map_5,11292672
random,memory,447941,phmap::parallel_flat_hash_map_5,11292672
random,memory,447942,phmap::parallel_flat_hash_map_5,12705792
random,memory,454330,phmap::parallel_flat_hash_map_5,12705792
random,memory,454331,phmap::parallel_flat_hash_map_5,16080896
random,memory,459541,phmap::parallel_flat_hash_map_5,16080896
random,memory,459542,phmap::parallel_flat_hash_map_5,18911232
random,memory,463883,phmap::parallel_flat_hash_map_5,18911232
random,memory,463884,phmap::parallel_flat_hash_map_5,23703552
random,memory,907467,phmap::parallel_flat_hash_map_5,23703552
random,memory,907468,phmap::parallel_flat_hash_map_5,25948160
random,memory,910634,phmap::parallel_flat_hash_map_5,25948160
random,memory,910635,phmap::parallel_flat_hash_map_5,25681920
random,memory,912368,phmap::parallel_flat_hash_map_5,25681920
random,memory,912369,phmap::parallel_flat_hash_map_5,25169920
random,memory,914982,phmap::parallel_flat_hash_map_5,25169920
random,memory,914983,phmap::parallel_flat_hash_map_5,29949952
random,memory,918814,phmap::parallel_flat_hash_map_5,29949952
random,memory,918815,phmap::parallel_flat_hash_map_5,32497664
random,memory,920383,phmap::parallel_flat_hash_map_5,32497664
random,memory,920384,phmap::parallel_flat_hash_map_5,33644544
random,memory,922282,phmap::parallel_flat_hash_map_5,33644544
random,memory,922283,phmap::parallel_flat_hash_map_5,35336192
random,memory,924207,phmap::parallel_flat_hash_map_5,35336192
random,memory,924208,phmap::parallel_flat_hash_map_5,38166528
random,memory,1045187,phmap::parallel_flat_hash_map_5,38166528
random,memory,1045188,phmap::parallel_flat_hash_map_5,39317504
random,memory,1821687,phmap::parallel_flat_hash_map_5,39317504
random,memory,1821688,phmap::parallel_flat_hash_map_5,41553920
random,memory,1825706,phmap::parallel_flat_hash_map_5,41553920
random,memory,1825707,phmap::parallel_flat_hash_map_5,43786240
random,memory,1827224,phmap::parallel_flat_hash_map_5,43786240
random,memory,1827225,phmap::parallel_flat_hash_map_5,47144960
random,memory,1828449,phmap::parallel_flat_hash_map_5,48259072
random,memory,1831516,phmap::parallel_flat_hash_map_5,48259072
random,memory,1831517,phmap::parallel_flat_hash_map_5,52727808
random,memory,1832911,phmap::parallel_flat_hash_map_5,52727808
random,memory,1832912,phmap::parallel_flat_hash_map_5,56082432
random,memory,1835515,phmap::parallel_flat_hash_map_5,56078336
random,memory,1835516,phmap::parallel_flat_hash_map_5,60547072
random,memory,1836508,phmap::parallel_flat_hash_map_5,60547072
random,memory,1836509,phmap::parallel_flat_hash_map_5,62779392
random,memory,1837620,phmap::parallel_flat_hash_map_5,63893504
random,memory,1838419,phmap::parallel_flat_hash_map_5,63893504
random,memory,1838420,phmap::parallel_flat_hash_map_5,68362240
random,memory,1844110,phmap::parallel_flat_hash_map_5,68358144
random,memory,1844111,phmap::parallel_flat_hash_map_5,71704576
random,memory,1845194,phmap::parallel_flat_hash_map_5,72822784
random,memory,1848605,phmap::parallel_flat_hash_map_5,72822784
random,memory,1848606,phmap::parallel_flat_hash_map_5,76173312
random,memory,1903391,phmap::parallel_flat_hash_map_5,76173312
random,memory,2062005,phmap::parallel_flat_hash_map_5,75051008
random,memory,3647995,phmap::parallel_flat_hash_map_5,75051008
random,memory,3647996,phmap::parallel_flat_hash_map_5,79519744
random,memory,3653763,phmap::parallel_flat_hash_map_5,81756160
random,memory,3654750,phmap::parallel_flat_hash_map_5,83988480
random,memory,3655941,phmap::parallel_flat_hash_map_5,86216704
random,memory,3658224,phmap::parallel_flat_hash_map_5,88457216
random,memory,3658959,phmap::parallel_flat_hash_map_5,90689536
random,memory,3659868,phmap::parallel_flat_hash_map_5,90689536
random,memory,3659869,phmap::parallel_flat_hash_map_5,97394688
random,memory,3665747,phmap::parallel_flat_hash_map_5,99618816
random,memory,3666483,phmap::parallel_flat_hash_map_5,101855232
random,memory,3666786,phmap::parallel_flat_hash_map_5,104083456
random,memory,3668303,phmap::parallel_flat_hash_map_5,106319872
random,memory,3669798,phmap::parallel_flat_hash_map_5,108560384
random,memory,3670157,phmap::parallel_flat_hash_map_5,110800896
random,memory,3670634,phmap::parallel_flat_hash_map_5,110800896
random,memory,3670635,phmap::parallel_flat_hash_map_5,117501952
random,memory,3671412,phmap::parallel_flat_hash_map_5,117497856
random,memory,3671413,phmap::parallel_flat_hash_map_5,124194816
random,memory,3676143,phmap::parallel_flat_hash_map_5,126423040
random,memory,3676807,phmap::parallel_flat_hash_map_5,128655360
random,memory,3677068,phmap::parallel_flat_hash_map_5,128655360
random,memory,3677069,phmap::parallel_flat_hash_map_5,135356416
random,memory,3677181,phmap::parallel_flat_hash_map_5,135356416
random,memory,3677182,phmap::parallel_flat_hash_map_5,133115904
random,memory,3680571,phmap::parallel_flat_hash_map_5,135348224
random,memory,3683612,phmap::parallel_flat_hash_map_5,137580544
random,memory,3684355,phmap::parallel_flat_hash_map_5,139808768
random,memory,3684486,phmap::parallel_flat_hash_map_5,142045184
random,memory,3684703,phmap::parallel_flat_hash_map_5,144277504
random,memory,3687105,phmap::parallel_flat_hash_map_5,146505728
random,memory,3690770,phmap::parallel_flat_hash_map_5,148733952
random,memory,3715764,phmap::parallel_flat_hash_map_5,148733952
random,memory,3715808,phmap::parallel_flat_hash_map_5,146497536
random,memory,7297554,phmap::parallel_flat_hash_map_5,146497536
random,memory,7297555,phmap::parallel_flat_hash_map_5,155435008
random,memory,7311903,phmap::parallel_flat_hash_map_5,159903744
random,memory,7322014,phmap::parallel_flat_hash_map_5,164372480
random,memory,7324284,phmap::parallel_flat_hash_map_5,168845312
random,memory,7325861,phmap::parallel_flat_hash_map_5,168845312
random,memory,7325862,phmap::parallel_flat_hash_map_5,182243328
random,memory,7327665,phmap::parallel_flat_hash_map_5,186707968
random,memory,7328023,phmap::parallel_flat_hash_map_5,186707968
random,memory,7328024,phmap::parallel_flat_hash_map_5,200101888
random,memory,7329789,phmap::parallel_flat_hash_map_5,200110080
random,memory,7329790,phmap::parallel_flat_hash_map_5,213512192
random,memory,7334043,phmap::parallel_flat_hash_map_5,217964544
random,memory,7334415,phmap::parallel_flat_hash_map_5,222425088
random,memory,7339734,phmap::parallel_flat_hash_map_5,226893824
random,memory,7341649,phmap::parallel_flat_hash_map_5,231358464
random,memory,7344137,phmap::parallel_flat_hash_map_5,235819008
random,memory,7344731,phmap::parallel_flat_hash_map_5,240279552
random,memory,7345981,phmap::parallel_flat_hash_map_5,244748288
random,memory,7347533,phmap::parallel_flat_hash_map_5,249208832
random,memory,7348108,phmap::parallel_flat_hash_map_5,253677568
random,memory,7348995,phmap::parallel_flat_hash_map_5,258142208
random,memory,7352977,phmap::parallel_flat_hash_map_5,262598656
random,memory,7355355,phmap::parallel_flat_hash_map_5,267063296
random,memory,7356095,phmap::parallel_flat_hash_map_5,271536128
random,memory,7357263,phmap::parallel_flat_hash_map_5,276004864
random,memory,7365455,phmap::parallel_flat_hash_map_5,280465408
random,memory,7367447,phmap::parallel_flat_hash_map_5,284930048
random,memory,7371641,phmap::parallel_flat_hash_map_5,289386496
random,memory,7378137,phmap::parallel_flat_hash_map_5,289386496
random,memory,7378146,phmap::parallel_flat_hash_map_5,284917760
random,memory,7389605,phmap::parallel_flat_hash_map_5,284917760
random,memory,7389606,phmap::parallel_flat_hash_map_5,293851136
random,memory,7544723,phmap::parallel_flat_hash_map_5,293851136
random,memory,7544854,phmap::parallel_flat_hash_map_5,289382400
random,time,10000000,phmap::parallel_flat_hash_map_5,0.706000
random,memory,10026761,phmap::parallel_flat_hash_map_5,288780288
random,memory,14626943,phmap::parallel_flat_hash_map_5,288780288
random,memory,14626967,phmap::parallel_flat_hash_map_5,306647040
random,memory,14639253,phmap::parallel_flat_hash_map_5,306647040
random,memory,14639317,phmap::parallel_flat_hash_map_5,297713664
random,memory,14649711,phmap::parallel_flat_hash_map_5,297713664
random,memory,14649712,phmap::parallel_flat_hash_map_5,315576320
random,memory,14652713,phmap::parallel_flat_hash_map_5,324509696
random,memory,14654833,phmap::parallel_flat_hash_map_5,333443072
random,memory,14662126,phmap::parallel_flat_hash_map_5,342380544
random,memory,14663094,phmap::parallel_flat_hash_map_5,351309824
random,memory,14666099,phmap::parallel_flat_hash_map_5,360239104
random,memory,14670830,phmap::parallel_flat_hash_map_5,360239104
random,memory,14670831,phmap::parallel_flat_hash_map_5,387043328
random,memory,14672442,phmap::parallel_flat_hash_map_5,387043328
random,memory,14672443,phmap::parallel_flat_hash_map_5,404893696
random,memory,14672704,phmap::parallel_flat_hash_map_5,404893696
random,memory,14672705,phmap::parallel_flat_hash_map_5,422756352
random,memory,14676798,phmap::parallel_flat_hash_map_5,431681536
random,memory,14677479,phmap::parallel_flat_hash_map_5,440610816
random,memory,14677635,phmap::parallel_flat_hash_map_5,440610816
random,memory,14677636,phmap::parallel_flat_hash_map_5,467410944
random,memory,14677806,phmap::parallel_flat_hash_map_5,467410944
random,memory,14677964,phmap::parallel_flat_hash_map_5,449540096
random,memory,14679982,phmap::parallel_flat_hash_map_5,449540096
random,memory,14679983,phmap::parallel_flat_hash_map_5,467406848
random,memory,14681796,phmap::parallel_flat_hash_map_5,476340224
random,memory,14683621,phmap::parallel_flat_hash_map_5,485265408
random,memory,14685751,phmap::parallel_flat_hash_map_5,494202880
random,memory,14686247,phmap::parallel_flat_hash_map_5,503128064
random,memory,14689965,phmap::parallel_flat_hash_map_5,503128064
random,memory,14689966,phmap::parallel_flat_hash_map_5,529915904
random,memory,14701543,phmap::parallel_flat_hash_map_5,538849280
random,memory,14702897,phmap::parallel_flat_hash_map_5,547774464
random,memory,14706767,phmap::parallel_flat_hash_map_5,556707840
random,memory,14718882,phmap::parallel_flat_hash_map_5,565637120
random,memory,14723067,phmap::parallel_flat_hash_map_5,574562304
random,memory,14725863,phmap::parallel_flat_hash_map_5,583491584
random,memory,14830100,phmap::parallel_flat_hash_map_5,583491584
random,memory,14830101,phmap::parallel_flat_hash_map_5,574558208
random,time,20000000,phmap::parallel_flat_hash_map_5,1.394000
random,memory,20032077,phmap::parallel_flat_hash_map_5,574541824
random,memory,29275812,phmap::parallel_flat_hash_map_5,574541824
random,memory,29275813,phmap::parallel_flat_hash_map_5,610267136
random,memory,29289707,phmap::parallel_flat_hash_map_5,610267136
random,memory,29289796,phmap::parallel_flat_hash_map_5,592404480
random,memory,29315566,phmap::parallel_flat_hash_map_5,592404480
random,memory,29315567,phmap::parallel_flat_hash_map_5,628129792
random,memory,29323636,phmap::parallel_flat_hash_map_5,645992448
random,memory,29330379,phmap::parallel_flat_hash_map_5,663855104
random,memory,29331279,phmap::parallel_flat_hash_map_5,681713664
random,memory,29336070,phmap::parallel_flat_hash_map_5,699576320
random,memory,29339390,phmap::parallel_flat_hash_map_5,717447168
random,memory,29341008,phmap::parallel_flat_hash_map_5,735305728
random,memory,29341515,phmap::parallel_flat_hash_map_5,753164288
random,memory,29344933,phmap::parallel_flat_hash_map_5,771031040
random,memory,29349195,phmap::parallel_flat_hash_map_5,771031040
random,memory,29349196,phmap::parallel_flat_hash_map_5,824614912
random,memory,29352451,phmap::parallel_flat_hash_map_5,824614912
random,memory,29352452,phmap::parallel_flat_hash_map_5,878198784
random,memory,29355941,phmap::parallel_flat_hash_map_5,878198784
random,memory,29355942,phmap::parallel_flat_hash_map_5,913915904
random,memory,29356055,phmap::parallel_flat_hash_map_5,913915904
random,memory,29356056,phmap::parallel_flat_hash_map_5,896053248
random,memory,29359791,phmap::parallel_flat_hash_map_5,913915904
random,memory,29363827,phmap::parallel_flat_hash_map_5,931774464
random,memory,29366034,phmap::parallel_flat_hash_map_5,949637120
random,memory,29367103,phmap::parallel_flat_hash_map_5,967495680
random,memory,29368343,phmap::parallel_flat_hash_map_5,985354240
random,memory,29375432,phmap::parallel_flat_hash_map_5,1003216896
random,memory,29376205,phmap::parallel_flat_hash_map_5,1021071360
random,memory,29378354,phmap::parallel_flat_hash_map_5,1038925824
random,memory,29385594,phmap::parallel_flat_hash_map_5,1056784384
random,memory,29388397,phmap::parallel_flat_hash_map_5,1074647040
random,memory,29401214,phmap::parallel_flat_hash_map_5,1092509696
random,memory,29403877,phmap::parallel_flat_hash_map_5,1110368256
random,memory,29410744,phmap::parallel_flat_hash_map_5,1128235008
random,memory,29417350,phmap::parallel_flat_hash_map_5,1146093568
random,memory,29423045,phmap::parallel_flat_hash_map_5,1163956224
random,memory,29554740,phmap::parallel_flat_hash_map_5,1163956224
random,memory,29554741,phmap::parallel_flat_hash_map_5,1146097664
random,time,30000000,phmap::parallel_flat_hash_map_5,2.388000
random,memory,30058375,phmap::parallel_flat_hash_map_5,1146105856
random,time,40000000,phmap::parallel_flat_hash_map_5,2.859000
random,memory,40129005,phmap::parallel_flat_hash_map_5,1146118144
random,time,50000000,phmap::parallel_flat_hash_map_5,3.398000
random,memory,50130659,phmap::parallel_flat_hash_map_5,1146114048
random,memory,58648505,phmap::parallel_flat_hash_map_5,1146114048
random,memory,58648506,phmap::parallel_flat_hash_map_5,1217560576
random,memory,58659099,phmap::parallel_flat_hash_map_5,1253285888
random,memory,58664853,phmap::parallel_flat_hash_map_5,1289011200
random,memory,58672884,phmap::parallel_flat_hash_map_5,1324728320
random,memory,58677336,phmap::parallel_flat_hash_map_5,1360449536
random,memory,58685517,phmap::parallel_flat_hash_map_5,1396174848
random,memory,58694184,phmap::parallel_flat_hash_map_5,1431896064
random,memory,58695854,phmap::parallel_flat_hash_map_5,1467617280
random,memory,58697408,phmap::parallel_flat_hash_map_5,1503346688
random,memory,58697642,phmap::parallel_flat_hash_map_5,1503346688
random,memory,58697658,phmap::parallel_flat_hash_map_5,1467617280
random,memory,58702073,phmap::parallel_flat_hash_map_5,1467617280
random,memory,58702074,phmap::parallel_flat_hash_map_5,1539063808
random,memory,58705027,phmap::parallel_flat_hash_map_5,1574785024
random,memory,58706773,phmap::parallel_flat_hash_map_5,1610506240
random,memory,58709256,phmap::parallel_flat_hash_map_5,1646227456
random,memory,58713971,phmap::parallel_flat_hash_map_5,1681940480
random,memory,58714578,phmap::parallel_flat_hash_map_5,1717657600
random,memory,58714931,phmap::parallel_flat_hash_map_5,1753378816
random,memory,58723299,phmap::parallel_flat_hash_map_5,1789095936
random,memory,58724869,phmap::parallel_flat_hash_map_5,1824829440
random,memory,58728103,phmap::parallel_flat_hash_map_5,1860554752
random,memory,58728557,phmap::parallel_flat_hash_map_5,1896271872
random,memory,58735188,phmap::parallel_flat_hash_map_5,1931988992
random,memory,58736098,phmap::parallel_flat_hash_map_5,1967710208
random,memory,58737751,phmap::parallel_flat_hash_map_5,2003435520
random,memory,58738589,phmap::parallel_flat_hash_map_5,2039152640
random,memory,58739865,phmap::parallel_flat_hash_map_5,2074877952
random,memory,58742832,phmap::parallel_flat_hash_map_5,2110599168
random,memory,58754529,phmap::parallel_flat_hash_map_5,2146316288
random,memory,58762104,phmap::parallel_flat_hash_map_5,2182037504
random,memory,58767879,phmap::parallel_flat_hash_map_5,2217758720
random,memory,58778531,phmap::parallel_flat_hash_map_5,2253479936
random,memory,58793956,phmap::parallel_flat_hash_map_5,2289197056
random,memory,58800861,phmap::parallel_flat_hash_map_5,2324922368
random,memory,58894435,phmap::parallel_flat_hash_map_5,2324922368
random,memory,58894436,phmap::parallel_flat_hash_map_5,2289197056
random,time,60000000,phmap::parallel_flat_hash_map_5,4.975000
random,memory,60010883,phmap::parallel_flat_hash_map_5,2289197056
random,time,70000000,phmap::parallel_flat_hash_map_5,5.534000
random,memory,70176985,phmap::parallel_flat_hash_map_5,2289192960
random,time,80000000,phmap::parallel_flat_hash_map_5,6.041000
random,memory,80051145,phmap::parallel_flat_hash_map_5,2289180672
random,time,90000000,phmap::parallel_flat_hash_map_5,6.613000
random,memory,90041943,phmap::parallel_flat_hash_map_5,2289188864
random,time,100000000,phmap::parallel_flat_hash_map_5,7.142000
random,memory,0,phmap::parallel_flat_hash_map_6,9543680
random,memory,240118,phmap::parallel_flat_hash_map_6,9543680
random,memory,240274,phmap::parallel_flat_hash_map_6,13426688
random,memory,447602,phmap::parallel_flat_hash_map_6,13713408
random,memory,456883,phmap::parallel_flat_hash_map_6,13713408
random,memory,456884,phmap::parallel_flat_hash_map_6,17674240
random,memory,462632,phmap::parallel_flat_hash_map_6,17674240
random,memory,462653,phmap::parallel_flat_hash_map_6,23060480
random,memory,564425,phmap::parallel_flat_hash_map_6,23060480
random,memory,564455,phmap::parallel_flat_hash_map_6,23908352
random,memory,910490,phmap::parallel_flat_hash_map_6,23920640
random,memory,910491,phmap::parallel_flat_hash_map_6,27856896
random,memory,914643,phmap::parallel_flat_hash_map_6,27856896
random,memory,914659,phmap::parallel_flat_hash_map_6,32354304
random,memory,918680,phmap::parallel_flat_hash_map_6,32354304
random,memory,918789,phmap::parallel_flat_hash_map_6,37982208
random,memory,923341,phmap::parallel_flat_hash_map_6,37982208
random,memory,923342,phmap::parallel_flat_hash_map_6,43044864
random,memory,967301,phmap::parallel_flat_hash_map_6,43479040
random,memory,1818677,phmap::parallel_flat_hash_map_6,43479040
random,memory,1818678,phmap::parallel_flat_hash_map_6,46841856
random,memory,1820853,phmap::parallel_flat_hash_map_6,46841856
random,memory,1820854,phmap::parallel_flat_hash_map_6,42500096
random,memory,1822952,phmap::parallel_flat_hash_map_6,42500096
random,memory,1822953,phmap::parallel_flat_hash_map_6,45305856
random,memory,1826229,phmap::parallel_flat_hash_map_6,45305856
random,memory,1826230,phmap::parallel_flat_hash_map_6,48701440
random,memory,1828846,phmap::parallel_flat_hash_map_6,48701440
random,memory,1828847,phmap::parallel_flat_hash_map_6,52629504
random,memory,1830697,phmap::parallel_flat_hash_map_6,53891072
random,memory,1834838,phmap::parallel_flat_hash_map_6,53891072
random,memory,1834839,phmap::parallel_flat_hash_map_6,57712640
random,memory,1835801,phmap::parallel_flat_hash_map_6,57712640
random,memory,1835802,phmap::parallel_flat_hash_map_6,60547072
random,memory,1837939,phmap::parallel_flat_hash_map_6,61685760
random,memory,1839861,phmap::parallel_flat_hash_map_6,61685760
random,memory,1839862,phmap::parallel_flat_hash_map_6,65630208
random,memory,1843172,phmap::parallel_flat_hash_map_6,65630208
random,memory,1843173,phmap::parallel_flat_hash_map_6,67899392
random,memory,1846075,phmap::parallel_flat_hash_map_6,67899392
random,memory,1846076,phmap::parallel_flat_hash_map_6,71970816
random,memory,1850890,phmap::parallel_flat_hash_map_6,73510912
random,memory,1864735,phmap::parallel_flat_hash_map_6,73510912
random,memory,1864741,phmap::parallel_flat_hash_map_6,75743232
random,memory,3640764,phmap::parallel_flat_hash_map_6,77979648
random,memory,3643691,phmap::parallel_flat_hash_map_6,77979648
random,memory,3643692,phmap::parallel_flat_hash_map_6,82452480
random,memory,3647471,phmap::parallel_flat_hash_map_6,84680704
random,memory,3647865,phmap::parallel_flat_hash_map_6,84680704
random,memory,3647866,phmap::parallel_flat_hash_map_6,88031232
random,memory,3657171,phmap::parallel_flat_hash_map_6,90267648
random,memory,3659273,phmap::parallel_flat_hash_map_6,90267648
random,memory,3659274,phmap::parallel_flat_hash_map_6,94740480
random,memory,3661956,phmap::parallel_flat_hash_map_6,94736384
random,memory,3661971,phmap::parallel_flat_hash_map_6,98091008
random,memory,3662467,phmap::parallel_flat_hash_map_6,98091008
random,memory,3662468,phmap::parallel_flat_hash_map_6,101441536
random,memory,3663439,phmap::parallel_flat_hash_map_6,102551552
random,memory,3664226,phmap::parallel_flat_hash_map_6,103669760
random,memory,3667885,phmap::parallel_flat_hash_map_6,103669760
random,memory,3667897,phmap::parallel_flat_hash_map_6,109264896
random,memory,3669813,phmap::parallel_flat_hash_map_6,109264896
random,memory,3669814,phmap::parallel_flat_hash_map_6,113737728
random,memory,3675800,phmap::parallel_flat_hash_map_6,114843648
random,memory,3675801,phmap::parallel_flat_hash_map_6,119308288
random,memory,3676890,phmap::parallel_flat_hash_map_6,121536512
random,memory,3679398,phmap::parallel_flat_hash_map_6,124882944
random,memory,3681013,phmap::parallel_flat_hash_map_6,129355776
random,memory,3682289,phmap::parallel_flat_hash_map_6,129355776
random,memory,3682290,phmap::parallel_flat_hash_map_6,133828608
random,memory,3684318,phmap::parallel_flat_hash_map_6,137175040
random,memory,3687517,phmap::parallel_flat_hash_map_6,138289152
random,memory,3687518,phmap::parallel_flat_hash_map_6,142753792
random,memory,3690464,phmap::parallel_flat_hash_map_6,144990208
random,memory,3699225,phmap::parallel_flat_hash_map_6,147214336
random,memory,7301764,phmap::parallel_flat_hash_map_6,147214336
random,memory,7301801,phmap::parallel_flat_hash_map_6,151683072
random,memory,7304266,phmap::parallel_flat_hash_map_6,151683072
random,memory,7304267,phmap::parallel_flat_hash_map_6,158388224
random,memory,7306423,phmap::parallel_flat_hash_map_6,158388224
random,memory,7306424,phmap::parallel_flat_hash_map_6,167325696
random,memory,7307845,phmap::parallel_flat_hash_map_6,167325696
random,memory,7307846,phmap::parallel_flat_hash_map_6,165093376
random,memory,7313817,phmap::parallel_flat_hash_map_6,167325696
random,memory,7317898,phmap::parallel_flat_hash_map_6,167325696
random,memory,7317899,phmap::parallel_flat_hash_map_6,174026752
random,memory,7321356,phmap::parallel_flat_hash_map_6,178499584
random,memory,7324610,phmap::parallel_flat_hash_map_6,178503680
random,memory,7324611,phmap::parallel_flat_hash_map_6,185208832
random,memory,7324981,phmap::parallel_flat_hash_map_6,189681664
random,memory,7329399,phmap::parallel_flat_hash_map_6,191909888
random,memory,7330096,phmap::parallel_flat_hash_map_6,194138112
random,memory,7330493,phmap::parallel_flat_hash_map_6,194138112
random,memory,7330494,phmap::parallel_flat_hash_map_6,200835072
random,memory,7330662,phmap::parallel_flat_hash_map_6,203063296
random,memory,7331146,phmap::parallel_flat_hash_map_6,203063296
random,memory,7331147,phmap::parallel_flat_hash_map_6,200830976
random,memory,7333567,phmap::parallel_flat_hash_map_6,200830976
random,memory,7333568,phmap::parallel_flat_hash_map_6,207536128
random,memory,7334082,phmap::parallel_flat_hash_map_6,212000768
random,memory,7339042,phmap::parallel_flat_hash_map_6,214237184
random,memory,7339605,phmap::parallel_flat_hash_map_6,216465408
random,memory,7340722,phmap::parallel_flat_hash_map_6,218705920
random,memory,7341125,phmap::parallel_flat_hash_map_6,220938240
random,memory,7342276,phmap::parallel_flat_hash_map_6,223170560
random,memory,7342941,phmap::parallel_flat_hash_map_6,223170560
random,memory,7342942,phmap::parallel_flat_hash_map_6,229871616
random,memory,7346101,phmap::parallel_flat_hash_map_6,238796800
random,memory,7350910,phmap::parallel_flat_hash_map_6,252190720
random,memory,7351597,phmap::parallel_flat_hash_map_6,256651264
random,memory,7353724,phmap::parallel_flat_hash_map_6,263344128
random,memory,7356932,phmap::parallel_flat_hash_map_6,267808768
random,memory,7365358,phmap::parallel_flat_hash_map_6,278974464
random,memory,7367048,phmap::parallel_flat_hash_map_6,285671424
random,memory,7381268,phmap::parallel_flat_hash_map_6,292360192
random,time,10000000,phmap::parallel_flat_hash_map_6,0.625000
random,memory,10048265,phmap::parallel_flat_hash_map_6,290181120
random,memory,14624411,phmap::parallel_flat_hash_map_6,290181120
random,memory,14624412,phmap::parallel_flat_hash_map_6,299114496
random,memory,14629443,phmap::parallel_flat_hash_map_6,303583232
random,memory,14631641,phmap::parallel_flat_hash_map_6,308051968
random,memory,14634044,phmap::parallel_flat_hash_map_6,312520704
random,memory,14636495,phmap::parallel_flat_hash_map_6,312520704
random,memory,14636496,phmap::parallel_flat_hash_map_6,325926912
random,memory,14643433,phmap::parallel_flat_hash_map_6,325914624
random,memory,14643434,phmap::parallel_flat_hash_map_6,339308544
random,memory,14646091,phmap::parallel_flat_hash_map_6,348241920
random,memory,14653553,phmap::parallel_flat_hash_map_6,352714752
random,memory,14654529,phmap::parallel_flat_hash_map_6,357175296
random,memory,14655407,phmap::parallel_flat_hash_map_6,361639936
random,memory,14658190,phmap::parallel_flat_hash_map_6,366100480
random,memory,14658689,phmap::parallel_flat_hash_map_6,366100480
random,memory,14658907,phmap::parallel_flat_hash_map_6,361635840
random,memory,14658907,phmap::parallel_flat_hash_map_6,370573312
random,memory,14659991,phmap::parallel_flat_hash_map_6,375033856
random,memory,14665883,phmap::parallel_flat_hash_map_6,379498496
random,memory,14667814,phmap::parallel_flat_hash_map_6,383963136
random,memory,14669160,phmap::parallel_flat_hash_map_6,388435968
random,memory,14671676,phmap::parallel_flat_hash_map_6,392896512
random,memory,14673074,phmap::parallel_flat_hash_map_6,397361152
random,memory,14675455,phmap::parallel_flat_hash_map_6,401829888
random,memory,14676709,phmap::parallel_flat_hash_map_6,406294528
random,memory,14678913,phmap::parallel_flat_hash_map_6,410755072
random,memory,14680761,phmap::parallel_flat_hash_map_6,415219712
random,memory,14682022,phmap::parallel_flat_hash_map_6,415219712
random,memory,14682023,phmap::parallel_flat_hash_map_6,428617728
random,memory,14682463,phmap::parallel_flat_hash_map_6,437538816
random,memory,14685126,phmap::parallel_flat_hash_map_6,437534720
random,memory,14685127,phmap::parallel_flat_hash_map_6,450936832
random,memory,14686842,phmap::parallel_flat_hash_map_6,455397376
random,memory,14690779,phmap::parallel_flat_hash_map_6,473251840
random,memory,14692933,phmap::parallel_flat_hash_map_6,491126784
random,memory,14696606,phmap::parallel_flat_hash_map_6,508981248
random,memory,14700141,phmap::parallel_flat_hash_map_6,526839808
random,memory,14711382,phmap::parallel_flat_hash_map_6,544669696
random,memory,14716503,phmap::parallel_flat_hash_map_6,562524160
random,memory,14754604,phmap::parallel_flat_hash_map_6,580382720
random,time,20000000,phmap::parallel_flat_hash_map_6,1.270000
random,memory,20169331,phmap::parallel_flat_hash_map_6,575909888
random,memory,29250365,phmap::parallel_flat_hash_map_6,575909888
random,memory,29250366,phmap::parallel_flat_hash_map_6,593772544
random,memory,29252297,phmap::parallel_flat_hash_map_6,593772544
random,memory,29252377,phmap::parallel_flat_hash_map_6,584843264
random,memory,29295606,phmap::parallel_flat_hash_map_6,584843264
random,memory,29295607,phmap::parallel_flat_hash_map_6,620572672
random,memory,29295923,phmap::parallel_flat_hash_map_6,620572672
random,memory,29295924,phmap::parallel_flat_hash_map_6,611643392
random,memory,29298230,phmap::parallel_flat_hash_map_6,611643392
random,memory,29298231,phmap::parallel_flat_hash_map_6,638443520
random,memory,29301877,phmap::parallel_flat_hash_map_6,647368704
random,memory,29307581,phmap::parallel_flat_hash_map_6,656306176
random,memory,29311094,phmap::parallel_flat_hash_map_6,656306176
random,memory,29311198,phmap::parallel_flat_hash_map_6,647376896
random,memory,29318505,phmap::parallel_flat_hash_map_6,647376896
random,memory,29318506,phmap::parallel_flat_hash_map_6,683106304
random,memory,29324837,phmap::parallel_flat_hash_map_6,692023296
random,memory,29328401,phmap::parallel_flat_hash_map_6,700956672
random,memory,29328874,phmap::parallel_flat_hash_map_6,709894144
random,memory,29330147,phmap::parallel_flat_hash_map_6,709894144
random,memory,29330451,phmap::parallel_flat_hash_map_6,700964864
random,memory,29330597,phmap::parallel_flat_hash_map_6,718827520
random,memory,29333160,phmap::parallel_flat_hash_map_6,727752704
random,memory,29336160,phmap::parallel_flat_hash_map_6,727752704
random,memory,29336161,phmap::parallel_flat_hash_map_6,754544640
random,memory,29344925,phmap::parallel_flat_hash_map_6,763461632
random,memory,29345974,phmap::parallel_flat_hash_map_6,772395008
random,memory,29346343,phmap::parallel_flat_hash_map_6,781320192
random,memory,29348045,phmap::parallel_flat_hash_map_6,790245376
random,memory,29352980,phmap::parallel_flat_hash_map_6,790245376
random,memory,29352981,phmap::parallel_flat_hash_map_6,817045504
random,memory,29357735,phmap::parallel_flat_hash_map_6,825970688
random,memory,29359312,phmap::parallel_flat_hash_map_6,834904064
random,memory,29360390,phmap::parallel_flat_hash_map_6,843833344
random,memory,29361898,phmap::parallel_flat_hash_map_6,852766720
random,memory,29363938,phmap::parallel_flat_hash_map_6,852766720
random,memory,29363939,phmap::parallel_flat_hash_map_6,879566848
random,memory,29366353,phmap::parallel_flat_hash_map_6,888500224
random,memory,29366942,phmap::parallel_flat_hash_map_6,888500224
random,memory,29366943,phmap::parallel_flat_hash_map_6,915296256
random,memory,29370042,phmap::parallel_flat_hash_map_6,951009280
random,memory,29373396,phmap::parallel_flat_hash_map_6,977809408
random,memory,29378157,phmap::parallel_flat_hash_map_6,986734592
random,memory,29378158,phmap::parallel_flat_hash_map_6,1022464000
random,memory,29382962,phmap::parallel_flat_hash_map_6,1022464000
random,memory,29382991,phmap::parallel_flat_hash_map_6,1004597248
random,memory,29383516,phmap::parallel_flat_hash_map_6,1022435328
random,memory,29395727,phmap::parallel_flat_hash_map_6,1067077632
random,memory,29400644,phmap::parallel_flat_hash_map_6,1076006912
random,memory,29411954,phmap::parallel_flat_hash_map_6,1111728128
random,memory,29443826,phmap::parallel_flat_hash_map_6,1138507776
random,time,30000000,phmap::parallel_flat_hash_map_6,2.204000
random,memory,30001149,phmap::parallel_flat_hash_map_6,1147379712
random,time,40000000,phmap::parallel_flat_hash_map_6,2.689000
random,memory,40030313,phmap::parallel_flat_hash_map_6,1147482112
random,time,50000000,phmap::parallel_flat_hash_map_6,3.140000
random,memory,50107035,phmap::parallel_flat_hash_map_6,1147482112
random,memory,58567867,phmap::parallel_flat_hash_map_6,1147482112
random,memory,58567868,phmap::parallel_flat_hash_map_6,1183207424
random,memory,58618664,phmap::parallel_flat_hash_map_6,1183207424
random,memory,58618684,phmap::parallel_flat_hash_map_6,1165344768
random,memory,58633951,phmap::parallel_flat_hash_map_6,1165344768
random,memory,58633952,phmap::parallel_flat_hash_map_6,1201070080
random,memory,58638135,phmap::parallel_flat_hash_map_6,1218936832
random,memory,58641806,phmap::parallel_flat_hash_map_6,1218936832
random,memory,58641908,phmap::parallel_flat_hash_map_6,1201074176
random,memory,58644567,phmap::parallel_flat_hash_map_6,1236799488
random,memory,58654398,phmap::parallel_flat_hash_map_6,1254662144
random,memory,58661628,phmap::parallel_flat_hash_map_6,1272520704
random,memory,58663366,phmap::parallel_flat_hash_map_6,1290387456
random,memory,58664512,phmap::parallel_flat_hash_map_6,1308254208
random,memory,58666679,phmap::parallel_flat_hash_map_6,1308254208
random,memory,58666680,phmap::parallel_flat_hash_map_6,1361838080
random,memory,58673711,phmap::parallel_flat_hash_map_6,1379696640
random,memory,58680789,phmap::parallel_flat_hash_map_6,1397563392
random,memory,58684297,phmap::parallel_flat_hash_map_6,1415430144
random,memory,58688420,phmap::parallel_flat_hash_map_6,1433292800
random,memory,58688990,phmap::parallel_flat_hash_map_6,1451155456
random,memory,58690080,phmap::parallel_flat_hash_map_6,1469009920
random,memory,58692416,phmap::parallel_flat_hash_map_6,1469009920
random,memory,58692417,phmap::parallel_flat_hash_map_6,1522601984
random,memory,58696961,phmap::parallel_flat_hash_map_6,1522597888
random,memory,58696962,phmap::parallel_flat_hash_map_6,1576189952
random,memory,58701807,phmap::parallel_flat_hash_map_6,1611915264
random,memory,58702134,phmap::parallel_flat_hash_map_6,1611915264
random,memory,58702166,phmap::parallel_flat_hash_map_6,1594044416
random,memory,58702606,phmap::parallel_flat_hash_map_6,1611902976
random,memory,58705250,phmap::parallel_flat_hash_map_6,1629765632
random,memory,58706394,phmap::parallel_flat_hash_map_6,1647628288
random,memory,58709861,phmap::parallel_flat_hash_map_6,1665486848
random,memory,58710992,phmap::parallel_flat_hash_map_6,1683341312
random,memory,58718600,phmap::parallel_flat_hash_map_6,1683341312
random,memory,58718601,phmap::parallel_flat_hash_map_6,1736929280
random,memory,58718836,phmap::parallel_flat_hash_map_6,1736929280
random,memory,58718837,phmap::parallel_flat_hash_map_6,1719058432
random,memory,58719131,phmap::parallel_flat_hash_map_6,1736916992
random,memory,58721235,phmap::parallel_flat_hash_map_6,1754771456
random,memory,58722232,phmap::parallel_flat_hash_map_6,1772634112
random,memory,58723234,phmap::parallel_flat_hash_map_6,1790488576
random,memory,58726963,phmap::parallel_flat_hash_map_6,1861939200
random,memory,58740972,phmap::parallel_flat_hash_map_6,1933361152
random,memory,58745109,phmap::parallel_flat_hash_map_6,2022670336
random,memory,58754148,phmap::parallel_flat_hash_map_6,2058383360
random,memory,58765822,phmap::parallel_flat_hash_map_6,2147696640
random,memory,58786363,phmap::parallel_flat_hash_map_6,2201272320
random,memory,58826606,phmap::parallel_flat_hash_map_6,2272714752
random,time,60000000,phmap::parallel_flat_hash_map_6,4.560000
random,memory,60000411,phmap::parallel_flat_hash_map_6,2290417664
random,time,70000000,phmap::parallel_flat_hash_map_6,5.082000
random,memory,70138168,phmap::parallel_flat_hash_map_6,2290565120
random,time,80000000,phmap::parallel_flat_hash_map_6,5.576000
random,memory,80036567,phmap::parallel_flat_hash_map_6,2290556928
random,time,90000000,phmap::parallel_flat_hash_map_6,6.062000
random,memory,90013913,phmap::parallel_flat_hash_map_6,2290528256
random,time,100000000,phmap::parallel_flat_hash_map_6,6.613000

View File

@ -1,15 +0,0 @@
cmake_minimum_required(VERSION 3.8)
project(googletest-download NONE)
include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)

View File

@ -1,8 +0,0 @@
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/parallel_hashmap/phmap_config.h" _PHMAP_H_CONTENTS)
string(REGEX REPLACE ".*#define PHMAP_VERSION_MAJOR ([0-9]+).*" "\\1" DETECTED_PHMAP_VERSION_MAJOR "${_PHMAP_H_CONTENTS}")
string(REGEX REPLACE ".*#define PHMAP_VERSION_MINOR ([0-9]+).*" "\\1" DETECTED_PHMAP_VERSION_MINOR "${_PHMAP_H_CONTENTS}")
string(REGEX REPLACE ".*#define PHMAP_VERSION_PATCH ([0-9]+).*" "\\1" DETECTED_PHMAP_VERSION_PATCH "${_PHMAP_H_CONTENTS}")
set(DETECTED_PHMAP_VERSION "${DETECTED_PHMAP_VERSION_MAJOR}.${DETECTED_PHMAP_VERSION_MINOR}.${DETECTED_PHMAP_VERSION_PATCH}")
message(STATUS "Detected PHMAP Version - ${DETECTED_PHMAP_VERSION}")

View File

@ -1,34 +0,0 @@
# Downloads and unpacks googletest at configure time. Based on the instructions
# at https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project
# Download the latest googletest from Github master
configure_file(
${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in
${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt
)
# Configure and build the downloaded googletest source
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
# Prevent overriding the parent project's compiler/linker settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This defines the gtest and gtest_main
# targets.
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)

View File

@ -1,60 +0,0 @@
#set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(PHMAP_IDE_FOLDER phmap)
# -------------------------------------------------------------
# phmap_cc_test(NAME awesome_test
# SRCS "awesome_test.cc"
# DEPS phmap::awesome gmock gtest_main)
# -------------------------------------------------------------
function(phmap_cc_test)
cmake_parse_arguments(PHMAP_CC_TEST
""
"NAME"
"SRCS;COPTS;CWOPTS;CLOPTS;DEFINES;LINKOPTS;DEPS"
${ARGN}
)
set(_NAME "test_${PHMAP_CC_TEST_NAME}")
add_executable(${_NAME} "")
target_sources(${_NAME} PRIVATE ${PHMAP_CC_TEST_SRCS})
target_include_directories(${_NAME}
PUBLIC ${PHMAP_COMMON_INCLUDE_DIRS}
PRIVATE ${GMOCK_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
)
target_compile_definitions(${_NAME}
PUBLIC ${PHMAP_CC_TEST_DEFINES}
)
if(MSVC)
target_compile_options(${_NAME}
PRIVATE ${PHMAP_CC_TEST_CWOPTS} /W4 /Zc:__cplusplus /std:c++latest
)
else()
target_compile_options(${_NAME}
PRIVATE ${PHMAP_CC_TEST_CLOPTS}
)
endif()
target_compile_options(${_NAME}
PRIVATE ${PHMAP_CC_TEST_COPTS}
)
target_link_libraries(${_NAME}
PUBLIC ${PHMAP_CC_TEST_DEPS}
PRIVATE ${PHMAP_CC_TEST_LINKOPTS}
)
# Add all Abseil targets to a a folder in the IDE for organization.
set_property(TARGET ${_NAME} PROPERTY FOLDER ${PHMAP_IDE_FOLDER}/test)
set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${PHMAP_CXX_STANDARD})
set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
add_test(NAME ${_NAME} COMMAND ${_NAME})
endfunction()
# -------------------------------------------------------------
function(check_target my_target)
if(NOT TARGET ${my_target})
message(FATAL_ERROR " PHMAP: compiling phmap tests requires a ${my_target} CMake target in your project,
see CMake/README.md for more details")
endif(NOT TARGET ${my_target})
endfunction()

View File

@ -1,42 +0,0 @@
# ---------------------------------------------------------------------------
# Copyright (c) 2019, Gregory Popovitch - greg7mdp@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Includes work from abseil-cpp (https://github.com/abseil/abseil-cpp)
# with modifications.
#
# Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
include(CMakeParseArguments)
function(check_target my_target)
if(NOT TARGET ${my_target})
message(FATAL_ERROR " ABSL: compiling absl requires a ${my_target} CMake target in your project,
see CMake/README.md for more details")
endif(NOT TARGET ${my_target})
endfunction()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,302 +0,0 @@
/***
colors.css v2.0.0
http://clrs.cc
@mrmrs
MIT License
***/
/*
SKINS
- Backgrounds
- Colors
- Border colors
- SVG fills
- SVG Strokes
*/
/* Backgrounds */
.bg-navy {
background-color: #001F3F; }
.bg-blue {
background-color: #0074D9; }
.bg-aqua {
background-color: #7FDBFF; }
.bg-teal {
background-color: #39CCCC; }
.bg-olive {
background-color: #3D9970; }
.bg-green {
background-color: #2ECC40; }
.bg-lime {
background-color: #01FF70; }
.bg-yellow {
background-color: #FFDC00; }
.bg-orange {
background-color: #FF851B; }
.bg-red {
background-color: #FF4136; }
.bg-fuchsia {
background-color: #F012BE; }
.bg-purple {
background-color: #B10DC9; }
.bg-maroon {
background-color: #85144B; }
.bg-white {
background-color: #fff; }
.bg-gray {
background-color: #aaa; }
.bg-silver {
background-color: #ddd; }
.bg-black {
background-color: #111; }
/* Colors */
.navy {
color: #001F3F; }
.blue {
color: #0074D9; }
.aqua {
color: #7FDBFF; }
.teal {
color: #39CCCC; }
.olive {
color: #3D9970; }
.green {
color: #2ECC40; }
.lime {
color: #01FF70; }
.yellow {
color: #FFDC00; }
.orange {
color: #FF851B; }
.red {
color: #FF4136; }
.fuchsia {
color: #F012BE; }
.purple {
color: #B10DC9; }
.maroon {
color: #85144B; }
.white {
color: #fff; }
.silver {
color: #ddd; }
.gray {
color: #aaa; }
.black {
color: #111; }
/* Border colors
Use with another border utility that sets border-width and style
i.e .border { border-width: 1px; border-style: solid; }
*/
.border--navy {
border-color: #001F3F; }
.border--blue {
border-color: #0074D9; }
.border--aqua {
border-color: #7FDBFF; }
.border--teal {
border-color: #39CCCC; }
.border--olive {
border-color: #3D9970; }
.border--green {
border-color: #2ECC40; }
.border--lime {
border-color: #01FF70; }
.border--yellow {
border-color: #FFDC00; }
.border--orange {
border-color: #FF851B; }
.border--red {
border-color: #FF4136; }
.border--fuchsia {
border-color: #F012BE; }
.border--purple {
border-color: #B10DC9; }
.border--maroon {
border-color: #85144B; }
.border--white {
border-color: #fff; }
.border--gray {
border-color: #aaa; }
.border--silver {
border-color: #ddd; }
.border--black {
border-color: #111; }
/* Fills for SVG */
.fill-navy {
fill: #001F3F; }
.fill-blue {
fill: #0074D9; }
.fill-aqua {
fill: #7FDBFF; }
.fill-teal {
fill: #39CCCC; }
.fill-olive {
fill: #3D9970; }
.fill-green {
fill: #2ECC40; }
.fill-lime {
fill: #01FF70; }
.fill-yellow {
fill: #FFDC00; }
.fill-orange {
fill: #FF851B; }
.fill-red {
fill: #FF4136; }
.fill-fuchsia {
fill: #F012BE; }
.fill-purple {
fill: #B10DC9; }
.fill-maroon {
fill: #85144B; }
.fill-white {
fill: #fff; }
.fill-gray {
fill: #aaa; }
.fill-silver {
fill: #ddd; }
.fill-black {
fill: #111; }
/* Strokes for SVG */
.stroke-navy {
stroke: #001F3F; }
.stroke-blue {
stroke: #0074D9; }
.stroke-aqua {
stroke: #7FDBFF; }
.stroke-teal {
stroke: #39CCCC; }
.stroke-olive {
stroke: #3D9970; }
.stroke-green {
stroke: #2ECC40; }
.stroke-lime {
stroke: #01FF70; }
.stroke-yellow {
stroke: #FFDC00; }
.stroke-orange {
stroke: #FF851B; }
.stroke-red {
stroke: #FF4136; }
.stroke-fuchsia {
stroke: #F012BE; }
.stroke-purple {
stroke: #B10DC9; }
.stroke-maroon {
stroke: #85144B; }
.stroke-white {
stroke: #fff; }
.stroke-gray {
stroke: #aaa; }
.stroke-silver {
stroke: #ddd; }
.stroke-black {
stroke: #111; }
/* PRETTIER LINKS */
a {
text-decoration: none;
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }
a:link {
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }
a:visited { }
a:hover {
color: #001F3F;
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }
a:active {
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }

View File

@ -1,271 +0,0 @@
/* main stylesheet */
@import url(http://fonts.googleapis.com/css?family=Signika);
html {
overflow-y: scroll;
}
body {
font-size: 15px;
font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #332;
}
h1, h2, h3, h4, h5 {
color: #332;
font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 400;
font-size: 1.4em;
line-height: 1.1;
margin-top: 30px;
}
pre code {
font: 14px/19px Inconsolata, Monaco,"Lucida Console",Terminal,"Courier New",Courier;
}
.figure {
text-align: center;
}
.small .figure img {
height: 200px;
}
.pagetitle .figure {
text-align: left !important;
}
.pagetitle .figure img {
height: 36px;
}
table{
background:#fff;
border:1px solid #ccc;
border-width:2px;
border-collapse:collapse;
margin:5px 0 10px;
margin-top: 20px;
margin-bottom: 20px;
}
th, td{
border:1px solid #ccc;
padding:3px 10px;
text-align:left;
vertical-align:top;
}
tr.even td{
background:#f7f7f7;
}
th{
background:#edeff0;
}
td code {
border: 0px;
}
img {
max-width: 100%;
height: auto;
}
hr {
border: 0px;
height: 0;
border-bottom: 1px solid #ccc;
margin-bottom: 100px;
}
/* Logo */
.logo {
text-align: center;
}
.tagline {
font-family: Georgia;
font-size: 18px;
font-style: italic;
line-height: 1.45;
color: #383838;
}
.author {
}
.halfbreak {
padding-bottom: 100px;
}
.break {
padding-bottom: 200px;
}
/* TOC Links */
a {
color: #111111;
text-decoration: none;
}
.body li a {
text-decoration: underline;
}
/* Math */
.MathJax_Display {
padding-top: 20px;
padding-bottom: 20px;
}
/* Body Links */
p a {
text-decoration: underline;
}
li code, p code {
font-size: 12px;
border: 1px solid #ccc;
margin-left: 3px;
margin-right: 3px;
padding-left: 2px;
padding-right: 2px;
}
/* */
.center {
text-align: center;
}
.bigger img {
width: 120%;
height: 120%;
}
pre {
font-size: 0.9em;
margin-bottom: 18px;
margin-top: 18px;
border-left: 1px solid #ccc;
}
h1 {
margin-top: 0px;
}
.annotation {
font-size: 10pt;
}
.annotation pre {
display: block;
margin: 0;
padding: 7px 10px;
overflow-x: auto;
}
.annotation.span2 {
/* Override bootstrap */
margin-left: 0px !important;
margin-top: 18px !important;
}
.annotation pre code {
border: 0;
padding: 0;
background: transparent;
}
blockquote {
border-left: 1px solid #ccc;
font-family: Georgia, serif;
font-size: 14px;
font-style: italic;
margin: 0.25em 0;
padding-left: 10px;
line-height: 1.45;
color: #383838;
left: 20px;
}
blockquote cite {
color: #999999;
font-size: 14px;
display: block;
margin-top: 5px;
}
ul.sections {
list-style: none;
padding:0 0 5px 0;
margin:0;
}
code.sourceCode {
padding: 0;
background: inherit;
}
pre.sourceCode {
padding: 10px;
}
ul.sections > li > div {
-moz-box-sizing: border-box; /* firefox */
-ms-box-sizing: border-box; /* ie */
-webkit-box-sizing: border-box; /* webkit */
-khtml-box-sizing: border-box; /* konqueror */
box-sizing: border-box; /* css3 */
}
/* Make the naviation centered and larger on small screens */
/*---------------------- (> 481px) ---------------------*/
@media only screen and (max-width: 481px) {
}
@media only screen and (min-width: 1025px) {
body {
padding: 10px;
}
.side {
position: fixed;
width: 120px !important;
margin-left: 0px;
z-index: 1000;
}
.side ul ul {
display: none;
}
.side ul ul.active {
display: block;
}
.side .active {
font-weight: bold;
}
.body {
margin-left: 120px !important;
}
}

View File

@ -1,75 +0,0 @@
// Silly program just to test the natvis file for Visual Studio
// ------------------------------------------------------------
#include <string>
#include "parallel_hashmap/phmap.h"
template<class Set, class F>
void test_set(const F &f)
{
Set s;
typename Set::iterator it;
for (int i=0; i<100; ++i)
s.insert(f(i));
it = s.begin();
++it;
it = s.end();
it = s.begin();
while(it != s.end())
++it;
it = s.begin();
}
int main(int, char **)
{
using namespace std;
auto make_int = [](int i) { return i; };
auto make_string = [](int i) { return std::to_string(i); };
auto make_2int = [](int i) { return std::make_pair(i, i); };
auto make_2string = [](int i) { return std::make_pair(std::to_string(i), std::to_string(i)); };
test_set<phmap::flat_hash_set<int>>(make_int);
test_set<phmap::flat_hash_set<string>>(make_string);
test_set<phmap::node_hash_set<int>>(make_int);
test_set<phmap::node_hash_set<string>>(make_string);
test_set<phmap::flat_hash_map<int, int>>(make_2int);
test_set<phmap::flat_hash_map<string, string>>(make_2string);
test_set<phmap::node_hash_map<int, int>>(make_2int);
test_set<phmap::node_hash_map<string, string>>(make_2string);
test_set<phmap::parallel_flat_hash_set<int>>(make_int);
test_set<phmap::parallel_flat_hash_set<string>>(make_string);
test_set<phmap::parallel_node_hash_set<int>>(make_int);
test_set<phmap::parallel_node_hash_set<string>>(make_string);
test_set<phmap::parallel_flat_hash_map<int, int>>(make_2int);
test_set<phmap::parallel_flat_hash_map<string, string>>(make_2string);
test_set<phmap::parallel_node_hash_map<int, int>>(make_2int);
test_set<phmap::parallel_node_hash_map<string, string>>(make_2string);
// example of using default parameters in order to specify the mutex type.
//
// Please be aware that the iterators returned (by find for example) cannot
// be safely read in a multithreaded environment. Instead use if_contains(),
// which passes a reference value to the callback while holding the submap lock.
// Similarly, write access can be done safely using modify_if, try_emplace_l
// or lazy_emplace_l.
// ----------------------------------------------------------------------------
using Map = phmap::parallel_flat_hash_map<std::size_t, std::size_t,
std::hash<size_t>,
std::equal_to<size_t>,
std::allocator<std::pair<const size_t, size_t>>,
4,
std::mutex>;
auto make_2size_t = [](size_t i) { return std::make_pair(i, i); };
test_set<Map>(make_2size_t);
}

View File

@ -1,23 +0,0 @@
#include <iostream>
#include <string>
#include <parallel_hashmap/phmap.h>
using phmap::flat_hash_map;
int main()
{
// Create an unordered_map of three strings (that map to strings)
flat_hash_map<std::string, std::string> email;
// Iterate and print keys and values
for (const auto& n : email)
std::cout << n.first << "'s email is: " << n.second << "\n";
// Add a new entry
email["bill"] = "bg@whatever.com";
// and print it
std::cout << "bill's email is: " << email["bill"] << "\n";
return 0;
}

View File

@ -1,480 +0,0 @@
#include <inttypes.h>
#ifdef STL_UNORDERED
#include <unordered_map>
#define MAPNAME std::unordered_map
#define EXTRAARGS
#elif defined(PHMAP_FLAT)
#include "parallel_hashmap/phmap.h"
#define MAPNAME phmap::flat_hash_map
#define NMSP phmap
#define EXTRAARGS
#else
#if 1
#include <mutex>
#define MTX std::mutex
#elif 0
// Abseil's mutexes are very efficient (at least on windows)
#include "absl/synchronization/mutex.h"
#define MTX absl::Mutex
#elif 1
#include <boost/thread/locks.hpp>
#if 1
#include <boost/thread/mutex.hpp>
#define MTX boost::mutex // faster if all we do is exclusive locks like this bench
#else
#include <boost/thread/shared_mutex.hpp>
#define MTX boost::upgrade_mutex
#endif
#elif 1
#include <windows.h>
class srwlock {
SRWLOCK _lock;
public:
srwlock() { InitializeSRWLock(&_lock); }
void lock() { AcquireSRWLockExclusive(&_lock); }
void unlock() { ReleaseSRWLockExclusive(&_lock); }
};
#define MTX srwlock
#else
// spinlocks - slow!
#include <atomic>
class spinlock {
std::atomic_flag flag = ATOMIC_FLAG_INIT;
public:
void lock() { while(flag.test_and_set(std::memory_order_acquire)); }
void unlock() { flag.clear(std::memory_order_release); }
};
#define MTX spinlock
#endif
#include "parallel_hashmap/phmap.h"
#define MAPNAME phmap::parallel_flat_hash_map
#define NMSP phmap
#define MT_SUPPORT 1
#if MT_SUPPORT == 1
// create the parallel_flat_hash_map without internal mutexes, for when
// we programatically ensure that each thread uses different internal submaps
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, NMSP::NullMutex
#elif MT_SUPPORT == 2
// create the parallel_flat_hash_map with internal mutexes, for when
// we read/write the same parallel_flat_hash_map from multiple threads,
// without any special precautions.
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, MTX
#else
#define EXTRAARGS
#endif
#endif
#define xstr(s) str(s)
#define str(s) #s
template <class K, class V>
using HashT = MAPNAME<K, V EXTRAARGS>;
using hash_t = HashT<int64_t, int64_t>;
using str_hash_t = HashT<const char *, int64_t>;
const char *program_slug = xstr(MAPNAME); // "_4";
#include <cassert>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <thread>
#include <chrono>
#include <ostream>
#include "parallel_hashmap/meminfo.h"
#include <vector>
using std::vector;
int64_t _abs(int64_t x) { return (x < 0) ? -x : x; }
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif // _MSC_VER
// --------------------------------------------------------------------------
class Timer
{
typedef std::chrono::high_resolution_clock high_resolution_clock;
typedef std::chrono::milliseconds milliseconds;
public:
explicit Timer(bool run = false) { if (run) reset(); }
void reset() { _start = high_resolution_clock::now(); }
milliseconds elapsed() const
{
return std::chrono::duration_cast<milliseconds>(high_resolution_clock::now() - _start);
}
private:
high_resolution_clock::time_point _start;
};
// --------------------------------------------------------------------------
// from: https://github.com/preshing/RandomSequence
// --------------------------------------------------------------------------
class RSU
{
private:
unsigned int m_index;
unsigned int m_intermediateOffset;
static unsigned int permuteQPR(unsigned int x)
{
static const unsigned int prime = 4294967291u;
if (x >= prime)
return x; // The 5 integers out of range are mapped to themselves.
unsigned int residue = ((unsigned long long) x * x) % prime;
return (x <= prime / 2) ? residue : prime - residue;
}
public:
RSU(unsigned int seedBase, unsigned int seedOffset)
{
m_index = permuteQPR(permuteQPR(seedBase) + 0x682f0161);
m_intermediateOffset = permuteQPR(permuteQPR(seedOffset) + 0x46790905);
}
unsigned int next()
{
return permuteQPR((permuteQPR(m_index++) + m_intermediateOffset) ^ 0x5bf03635);
}
};
// --------------------------------------------------------------------------
char * new_string_from_integer(uint64_t num)
{
int ndigits = num == 0 ? 1 : (int)log10(num) + 1;
char * str = (char *)malloc(ndigits + 1);
sprintf(str, "%u", (unsigned int)num);
return str;
}
// --------------------------------------------------------------------------
template <class T>
void _fill(vector<T> &v)
{
srand(1); // for a fair/deterministic comparison
for (size_t i = 0, sz = v.size(); i < sz; ++i)
v[i] = (T)(i * 10 + rand() % 10);
}
// --------------------------------------------------------------------------
template <class T>
void _shuffle(vector<T> &v)
{
for (size_t n = v.size(); n >= 2; --n)
std::swap(v[n - 1], v[static_cast<unsigned>(rand()) % n]);
}
// --------------------------------------------------------------------------
template <class T, class HT>
Timer _fill_random(vector<T> &v, HT &hash)
{
_fill<T>(v);
_shuffle<T>(v);
Timer timer(true);
for (size_t i = 0, sz = v.size(); i < sz; ++i)
hash.insert(typename HT::value_type(v[i], 0));
return timer;
}
// --------------------------------------------------------------------------
void out(const char* test, int64_t cnt, const Timer &t, bool = false)
{
printf("%s,time,%u,%s,%f\n", test, (unsigned int)cnt, program_slug,
(float)((double)t.elapsed().count() / 1000));
}
// --------------------------------------------------------------------------
void outmem(const char*, int64_t cnt, uint64_t mem, bool final = false)
{
static uint64_t max_mem = 0;
static uint64_t max_keys = 0;
if (final)
printf("peak memory usage for %u values: %.2f GB\n", (unsigned int)max_keys,
max_mem / ((double)1000 * 1000 * 1000));
else {
if (mem > max_mem)
max_mem = mem;
if ((uint64_t)cnt > max_keys)
max_keys = cnt;
}
}
static bool all_done = false;
static int64_t s_num_keys[16] = { 0 };
static int64_t loop_idx = 0;
static int64_t inner_cnt = 0;
static const char *test = "random";
// --------------------------------------------------------------------------
template <class HT>
void _fill_random_inner(int64_t cnt, HT &hash, RSU &rsu)
{
for (int64_t i=0; i<cnt; ++i)
{
hash.insert(typename HT::value_type(rsu.next(), 0));
++s_num_keys[0];
}
}
// --------------------------------------------------------------------------
template <class HT>
void _fill_random_inner_mt(int64_t cnt, HT &hash, RSU &rsu)
{
constexpr int64_t num_threads = 8; // has to be a power of two
std::unique_ptr<std::thread> threads[num_threads];
auto thread_fn = [&hash, cnt, num_threads](size_t thread_idx, RSU rsu_) {
#if MT_SUPPORT
size_t modulo = hash.subcnt() / num_threads; // subcnt() returns the number of submaps
for (int64_t i=0; i<cnt; ++i) // iterate over all values
{
unsigned int key = rsu_.next(); // get next key to insert
#if MT_SUPPORT == 1
size_t hashval = hash.hash(key); // compute its hash
size_t idx = hash.subidx(hashval); // compute the submap index for this hash
if (idx / modulo == thread_idx) // if the submap is suitable for this thread
#elif MT_SUPPORT == 2
if (i % num_threads == thread_idx)
#endif
{
hash.insert(typename HT::value_type(key, 0)); // insert the value
++(s_num_keys[thread_idx]); // increment count of inserted values
}
}
#endif
};
// create and start 8 threads - each will insert in their own submaps
// thread 0 will insert the keys whose hash direct them to submap0 or submap1
// thread 1 will insert the keys whose hash direct them to submap2 or submap3
// --------------------------------------------------------------------------
for (size_t i=0; i<num_threads; ++i)
threads[i].reset(new std::thread(thread_fn, i, rsu));
// rsu passed by value to threads... we need to increment the reference object
for (int64_t i=0; i<cnt; ++i)
rsu.next();
// wait for the threads to finish their work and exit
for (size_t i=0; i<num_threads; ++i)
threads[i]->join();
}
// --------------------------------------------------------------------------
size_t total_num_keys()
{
size_t n = 0;
for (int i=0; i<16; ++i)
n += s_num_keys[i];
return n;
}
// --------------------------------------------------------------------------
template <class HT>
Timer _fill_random2(int64_t cnt, HT &hash)
{
test = "random";
unsigned int seed = 76687;
RSU rsu(seed, seed + 1);
Timer timer(true);
const int64_t num_loops = 10;
inner_cnt = cnt / num_loops;
for (int i=0; i<16; ++i)
s_num_keys[i] = 0;
for (loop_idx=0; loop_idx<num_loops; ++loop_idx)
{
#if 1 && MT_SUPPORT
// multithreaded insert
_fill_random_inner_mt(inner_cnt, hash, rsu);
#else
_fill_random_inner(inner_cnt, hash, rsu);
#endif
out(test, total_num_keys(), timer);
}
fprintf(stderr, "inserted %.2lfM\n", (double)hash.size() / 1000000);
outmem(test, total_num_keys(), spp::GetProcessMemoryUsed());
return timer;
}
// --------------------------------------------------------------------------
template <class T, class HT>
Timer _lookup(vector<T> &v, HT &hash, size_t &num_present)
{
_fill_random(v, hash);
num_present = 0;
size_t max_val = v.size() * 10;
Timer timer(true);
for (size_t i = 0, sz = v.size(); i < sz; ++i)
{
num_present += (size_t)(hash.find(v[i]) != hash.end());
num_present += (size_t)(hash.find((T)(rand() % max_val)) != hash.end());
}
return timer;
}
// --------------------------------------------------------------------------
template <class T, class HT>
Timer _delete(vector<T> &v, HT &hash)
{
_fill_random(v, hash);
_shuffle(v); // don't delete in insertion order
Timer timer(true);
for(size_t i = 0, sz = v.size(); i < sz; ++i)
hash.erase(v[i]);
return timer;
}
// --------------------------------------------------------------------------
void memlog()
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
uint64_t nbytes_old_out = spp::GetProcessMemoryUsed();
uint64_t nbytes_old = spp::GetProcessMemoryUsed(); // last non outputted mem measurement
outmem(test, 0, nbytes_old);
int64_t last_loop = 0;
while (!all_done)
{
uint64_t nbytes = spp::GetProcessMemoryUsed();
if ((double)_abs(nbytes - nbytes_old_out) / nbytes_old_out > 0.03 ||
(double)_abs(nbytes - nbytes_old) / nbytes_old > 0.01)
{
if ((double)(nbytes - nbytes_old) / nbytes_old > 0.03)
outmem(test, total_num_keys() - 1, nbytes_old);
outmem(test, total_num_keys(), nbytes);
nbytes_old_out = nbytes;
last_loop = loop_idx;
}
else if (loop_idx > last_loop)
{
outmem(test, total_num_keys(), nbytes);
nbytes_old_out = nbytes;
last_loop = loop_idx;
}
nbytes_old = nbytes;
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
// --------------------------------------------------------------------------
int main(int argc, char ** argv)
{
int64_t num_keys = 100000000;
const char *bench_name = "random";
int64_t i, value = 0;
if(argc > 2)
{
num_keys = atoi(argv[1]);
bench_name = argv[2];
}
hash_t hash;
str_hash_t str_hash;
srand(1); // for a fair/deterministic comparison
Timer timer(true);
#if MT_SUPPORT
if (!strcmp(program_slug,"absl::parallel_flat_hash_map") ||
!strcmp(program_slug,"phmap::parallel_flat_hash_map"))
program_slug = xstr(MAPNAME) "_mt";
#endif
std::thread t1(memlog);
try
{
if(!strcmp(bench_name, "sequential"))
{
for(i = 0; i < num_keys; i++)
hash.insert(hash_t::value_type(i, value));
}
#if 0
else if(!strcmp(bench_name, "random"))
{
vector<int64_t> v(num_keys);
timer = _fill_random(v, hash);
out("random", num_keys, timer);
}
#endif
else if(!strcmp(bench_name, "random"))
{
fprintf(stderr, "size = %zu\n", sizeof(hash));
timer = _fill_random2(num_keys, hash);
}
else if(!strcmp(bench_name, "lookup"))
{
vector<int64_t> v(num_keys);
size_t num_present;
timer = _lookup(v, hash, num_present);
//fprintf(stderr, "found %zu\n", num_present);
}
else if(!strcmp(bench_name, "delete"))
{
vector<int64_t> v(num_keys);
timer = _delete(v, hash);
}
else if(!strcmp(bench_name, "sequentialstring"))
{
for(i = 0; i < num_keys; i++)
str_hash.insert(str_hash_t::value_type(new_string_from_integer(i), value));
}
else if(!strcmp(bench_name, "randomstring"))
{
for(i = 0; i < num_keys; i++)
str_hash.insert(str_hash_t::value_type(new_string_from_integer((int)rand()), value));
}
else if(!strcmp(bench_name, "deletestring"))
{
for(i = 0; i < num_keys; i++)
str_hash.insert(str_hash_t::value_type(new_string_from_integer(i), value));
timer.reset();
for(i = 0; i < num_keys; i++)
str_hash.erase(new_string_from_integer(i));
}
//printf("%f\n", (float)((double)timer.elapsed().count() / 1000));
fflush(stdout);
//std::this_thread::sleep_for(std::chrono::seconds(1000));
}
catch (...)
{
}
all_done = true;
outmem(test, 0, 0, true);
t1.join();
return 0;
}

View File

@ -1,49 +0,0 @@
#include <iostream>
#include "btree_fwd.h"
#include <parallel_hashmap/btree.h>
int main()
{
// initialise map with some values using an initializer_list
phmap::btree_map<std::string, int> map =
{ { "John", 35 },
{ "Jane", 32 },
{ "Joe", 30 },
};
// add a couple more values using operator[]()
map["lucy"] = 18;
map["Andre"] = 20;
auto it = map.find("Joe");
map.erase(it);
map.insert(std::make_pair("Alex", 16));
map.emplace("Emily", 18); // emplace uses pair template constructor
for (auto& p: map)
std::cout << p.first << ", " << p.second << '\n';
IntString map2; // IntString is declared in btree_fwd.h
map2.emplace(std::piecewise_construct, std::forward_as_tuple(0), std::forward_as_tuple(10, 'c'));
map2.try_emplace(1, 10, 'a'); // phmap::btree_map supports c++17 API
for (auto& p: map2)
std::cout << p.first << ", " << p.second << '\n';
// create a btree_set of tuples
using X = std::tuple<float, std::string>;
phmap::btree_set<X> set;
for (int i=0; i<10; ++i)
set.insert(X((float)i, std::to_string(i)));
set.emplace(15.0f, "15");
set.erase(X(1.0f, "1"));
for (auto& e: set)
std::cout << std::get<0>(e) << ", \"" << std::get<1>(e) << "\" \n";
return 0;
}

View File

@ -1,6 +0,0 @@
#include <string>
#include <parallel_hashmap/phmap_fwd_decl.h>
using IntString = phmap::btree_map<int, std::string>;

View File

@ -1,53 +0,0 @@
#include <iostream>
#include <parallel_hashmap/phmap_dump.h>
void dump_load_uint64_uint32() {
phmap::flat_hash_map<uint64_t, uint32_t> mp1 = { {100, 99}, {300, 299} };
for (const auto& n : mp1)
std::cout << n.first << "'s value is: " << n.second << "\n";
{
phmap::BinaryOutputArchive ar_out("./dump.data");
mp1.phmap_dump(ar_out);
}
phmap::flat_hash_map<uint64_t, uint32_t> mp2;
{
phmap::BinaryInputArchive ar_in("./dump.data");
mp2.phmap_load(ar_in);
}
for (const auto& n : mp2)
std::cout << n.first << "'s value is: " << n.second << "\n";
}
void dump_load_parallel_flat_hash_map() {
phmap::parallel_flat_hash_map<uint64_t, uint32_t> mp1 = {
{100, 99}, {300, 299}, {101, 992} };
for (const auto& n : mp1)
std::cout << "key: " << n.first << ", value: " << n.second << "\n";
{
phmap::BinaryOutputArchive ar_out("./dump.data");
mp1.phmap_dump(ar_out);
}
phmap::parallel_flat_hash_map<uint64_t, uint32_t> mp2;
{
phmap::BinaryInputArchive ar_in("./dump.data");
mp2.phmap_load(ar_in);
}
for (const auto& n : mp2)
std::cout << "key: " << n.first << ", value: " << n.second << "\n";
}
int main()
{
dump_load_uint64_uint32();
dump_load_parallel_flat_hash_map();
return 0;
}

View File

@ -1,88 +0,0 @@
/*
*
* Example of dumping a map, containing values which are phmap maps or sets
* building this requires c++17 support
*
*/
#include <iostream>
#include <parallel_hashmap/phmap_dump.h>
template <class K, class V>
class MyMap : public phmap::flat_hash_map<K, phmap::flat_hash_set<V>>
{
public:
using Set = phmap::flat_hash_set<V>;
void dump(const std::string &filename)
{
phmap::BinaryOutputArchive ar_out (filename.c_str());
ar_out.dump(this->size());
for (auto& [k, v] : *this)
{
ar_out.dump(k);
v.dump(ar_out);
}
}
void load(const std::string & filename)
{
phmap::BinaryInputArchive ar_in(filename.c_str());
size_t size;
ar_in.load(&size);
this->reserve(size);
while (size--)
{
K k;
Set v;
ar_in.load(&k);
v.load(ar_in);
this->insert_or_assign(std::move(k), std::move(v));
}
}
void insert(K k, V v)
{
Set &set = (*this)[k];
set.insert(v);
}
friend std::ostream& operator<<(std::ostream& os, const MyMap& map)
{
for (const auto& [k, m] : map)
{
os << k << ": [";
for (const auto& x : m)
os << x << ", ";
os << "]\n";
}
return os;
}
};
int main()
{
MyMap<size_t, size_t> m;
m.insert(1, 5);
m.insert(1, 8);
m.insert(2, 3);
m.insert(1, 15);
m.insert(1, 27);
m.insert(2, 10);
m.insert(2, 13);
std::cout << m << "\n";
m.dump("test_archive");
m.clear();
m.load("test_archive");
std::cout << m << "\n";
return 0;
}

View File

@ -1,166 +0,0 @@
#include <map>
#include <unordered_map>
#include <string>
#include <iostream>
#include <chrono>
#include <vector>
#include <parallel_hashmap/phmap.h>
#include <sstream>
template <typename T>
using milliseconds = std::chrono::duration<T, std::milli>;
// type containing std::string. Seems to take a long time to construct (and maybe move)
// ------------------------------------------------------------------------------------
class custom_type
{
std::string one = "one";
std::string two = "two";
std::uint32_t three = 3;
std::uint64_t four = 4;
std::uint64_t five = 5;
public:
custom_type() = default;
// Make object movable and non-copyable
custom_type(custom_type &&) = default;
custom_type& operator=(custom_type &&) = default;
// should be automatically deleted per http://www.slideshare.net/ripplelabs/howard-hinnant-accu2014
//custom_type(custom_type const&) = delete;
//custom_type& operator=(custom_type const&) = delete;
};
// type containing only integrals. should be faster to create.
// -----------------------------------------------------------
class custom_type_2
{
std::uint32_t three = 3;
std::uint64_t four = 4;
std::uint64_t five = 5;
std::uint64_t six = 6;
public:
custom_type_2() = default;
// Make object movable and non-copyable
custom_type_2(custom_type_2 &&) = default;
custom_type_2& operator=(custom_type_2 &&) = default;
// should be automatically deleted per http://www.slideshare.net/ripplelabs/howard-hinnant-accu2014
//custom_type_2(custom_type_2 const&) = delete;
//custom_type_2& operator=(custom_type_2 const&) = delete;
};
// convert std::size_t to appropriate key
// --------------------------------------
template <class K>
struct GenKey
{
K operator()(std::size_t j);
};
template <>
struct GenKey<std::string>
{
std::string operator()(std::size_t j) {
std::ostringstream stm;
stm << j;
return stm.str();
}
};
template <>
struct GenKey<int>
{
int operator()(std::size_t j) {
return (int)j;
}
};
// emplace key + large struct
// --------------------------
template <class Map, class K, class V, class T> struct _emplace
{
void operator()(Map &m, std::size_t j);
};
// "void" template parameter -> use emplace
template <class Map, class K, class V> struct _emplace<Map, K, V, void>
{
void operator()(Map &m, std::size_t j)
{
m.emplace(GenKey<K>()(j), V());
}
};
// "int" template parameter -> use emplace_back for std::vector
template <class Map, class K, class V> struct _emplace<Map, K, V, int>
{
void operator()(Map &m, std::size_t j)
{
m.emplace_back(GenKey<K>()(j), V());
}
};
// The test itself
// ---------------
template <class Map, class K, class V, class T, template <class, class, class, class> class INSERT>
void _test(std::size_t iterations, std::size_t container_size, const char *map_name)
{
std::size_t count = 0;
auto t1 = std::chrono::high_resolution_clock::now();
INSERT<Map, K, V, T> insert;
for (std::size_t i=0; i<iterations; ++i)
{
Map m;
for (std::size_t j=0; j<container_size; ++j)
insert(m, j);
count += m.size();
}
auto t2 = std::chrono::high_resolution_clock::now();
auto elapsed = milliseconds<double>(t2 - t1).count();
if (count != iterations*container_size)
std::clog << " invalid count: " << count << "\n";
std::clog << map_name << std::fixed << int(elapsed) << " ms\n";
}
template <class K, class V, template <class, class, class, class> class INSERT>
void test(std::size_t iterations, std::size_t container_size)
{
std::clog << "bench: iterations: " << iterations << " / container_size: " << container_size << "\n";
_test<std::map<K, V>, K, V, void, INSERT>(iterations, container_size, " std::map: ");
_test<std::unordered_map<K, V>, K, V, void, INSERT>(iterations, container_size, " std::unordered_map: ");
_test<phmap::flat_hash_map<K, V>, K, V, void, INSERT>(iterations, container_size, " phmap::flat_hash_map: ");
_test<std::vector<std::pair<K, V>>, K, V, int, INSERT> (iterations, container_size, " std::vector<std::pair>: ");
std::clog << "\n";
}
int main()
{
std::size_t iterations = 100000;
// test with custom_type_2 (int key + 32 byte value). This is representative
// of the hash table insertion speed.
// -------------------------------------------------------------------------
std::clog << "\n\n" << "testing with <int, custom_type_2>" "\n";
std::clog << "---------------------------------" "\n";
test<int, custom_type_2, _emplace>(iterations,10);
test<int, custom_type_2, _emplace>(iterations,100);
test<int, custom_type_2, _emplace>(iterations,500);
// test with custom_type, which contains two std::string values, and use
// a generated string key. This is not very indicative of the speed of the
// hash itself, as a good chunk of the time is spent creating the keys and
// values (as shown by the long times even for std::vector).
// -----------------------------------------------------------------------
std::clog << "\n" << "testing with <string, custom_type>" "\n";
std::clog << "---------------------------------" "\n";
test<std::string, custom_type, _emplace>(iterations,1);
test<std::string, custom_type, _emplace>(iterations,10);
test<std::string, custom_type, _emplace>(iterations,50);
}

View File

@ -1,25 +0,0 @@
/*
* Make sure that the phmap.h header builds fine when included in two separate
* source files
*/
#include <string>
#include <parallel_hashmap/phmap.h>
using phmap::flat_hash_map;
int main()
{
// Create an unordered_map of three strings (that map to strings)
using Map = flat_hash_map<std::string, std::string>;
Map email =
{
{ "tom", "tom@gmail.com"},
{ "jeff", "jk@gmail.com"},
{ "jim", "jimg@microsoft.com"}
};
extern void f2(Map&);
f2(email);
return 0;
}

View File

@ -1,23 +0,0 @@
/*
* Make sure that the phmap.h header builds fine when included in two separate
* source files
*/
#include <iostream>
#include <string>
#include <parallel_hashmap/phmap.h>
using phmap::flat_hash_map;
using Map = flat_hash_map<std::string, std::string>;
void f2(Map& email)
{
// Iterate and print keys and values
for (const auto& n : email)
std::cout << n.first << "'s email is: " << n.second << "\n";
// Add a new entry
email["bill"] = "bg@whatever.com";
// and print it
std::cout << "bill's email is: " << email["bill"] << "\n";
}

View File

@ -1,20 +0,0 @@
#include "hash_std.h" // defines Person with std::hash specialization
#include <iostream>
#include <parallel_hashmap/phmap.h>
int main()
{
// As we have defined a specialization of std::hash() for Person,
// we can now create sparse_hash_set or sparse_hash_map of Persons
// ----------------------------------------------------------------
phmap::flat_hash_set<Person> persons =
{ { "John", "Mitchell", 35 },
{ "Jane", "Smith", 32 },
{ "Jane", "Smith", 30 },
};
for (auto& p: persons)
std::cout << p._first << ' ' << p._last << " (" << p._age << ")" << '\n';
}

View File

@ -1,34 +0,0 @@
#ifndef phmap_example_hash_std_
#define phmap_example_hash_std_
#include <parallel_hashmap/phmap_utils.h> // minimal header providing phmap::HashState()
#include <string>
using std::string;
struct Person
{
bool operator==(const Person &o) const
{
return _first == o._first && _last == o._last && _age == o._age;
}
string _first;
string _last;
int _age;
};
namespace std
{
// inject specialization of std::hash for Person into namespace std
// An alternative is to provide a hash_value() friend function (see hash_value.h)
// ------------------------------------------------------------------------------
template<> struct hash<Person>
{
std::size_t operator()(Person const &p) const
{
return phmap::HashState().combine(0, p._first, p._last, p._age);
}
};
}
#endif // phmap_example_hash_std_

View File

@ -1,20 +0,0 @@
#include "hash_value.h" // defines Person with std::hash specialization
#include <iostream>
#include <parallel_hashmap/phmap.h>
int main()
{
// As we have defined a specialization of std::hash() for Person,
// we can now create sparse_hash_set or sparse_hash_map of Persons
// ----------------------------------------------------------------
phmap::flat_hash_set<Person> persons =
{ { "John", "Mitchell", 35 },
{ "Jane", "Smith", 32 },
{ "Jane", "Smith", 30 },
};
for (auto& p: persons)
std::cout << p._first << ' ' << p._last << " (" << p._age << ")" << '\n';
}

View File

@ -1,28 +0,0 @@
#ifndef phmap_example_hash_value_
#define phmap_example_hash_value_
#include <parallel_hashmap/phmap_utils.h> // minimal header providing phmap::HashState()
#include <string>
using std::string;
struct Person
{
bool operator==(const Person &o) const
{
return _first == o._first && _last == o._last && _age == o._age;
}
// Demonstrates how to provide the hash function as a friend member function of the class
// This can be used as an alternative to providing a std::hash<Person> specialization
// --------------------------------------------------------------------------------------
friend size_t hash_value(const Person &p)
{
return phmap::HashState().combine(0, p._first, p._last, p._age);
}
string _first;
string _last;
int _age;
};
#endif // phmap_example_hash_value_

View File

@ -1,143 +0,0 @@
#include <string>
#include <array>
#include <cstdint>
#include <limits>
#include <random>
#include <utility>
#define PHMAP_ALLOCATOR_NOTHROW 1
#include <parallel_hashmap/phmap.h>
// this is probably the fastest high quality 64bit random number generator that exists.
// Implements Small Fast Counting v4 RNG from PractRand.
class sfc64 {
public:
using result_type = uint64_t;
// no copy ctors so we don't accidentally get the same random again
sfc64(sfc64 const&) = delete;
sfc64& operator=(sfc64 const&) = delete;
sfc64(sfc64&&) = default;
sfc64& operator=(sfc64&&) = default;
sfc64(std::array<uint64_t, 4> const& _state)
: m_a(_state[0])
, m_b(_state[1])
, m_c(_state[2])
, m_counter(_state[3]) {}
static constexpr uint64_t(min)() {
return (std::numeric_limits<uint64_t>::min)();
}
static constexpr uint64_t(max)() {
return (std::numeric_limits<uint64_t>::max)();
}
sfc64()
: sfc64(UINT64_C(0x853c49e6748fea9b)) {}
sfc64(uint64_t _seed)
: m_a(_seed)
, m_b(_seed)
, m_c(_seed)
, m_counter(1) {
for (int i = 0; i < 12; ++i) {
operator()();
}
}
void seed() {
*this = sfc64{std::random_device{}()};
}
uint64_t operator()() noexcept {
auto const tmp = m_a + m_b + m_counter++;
m_a = m_b ^ (m_b >> right_shift);
m_b = m_c + (m_c << left_shift);
m_c = rotl(m_c, rotation) + tmp;
return tmp;
}
// this is a bit biased, but for our use case that's not important.
uint64_t operator()(uint64_t boundExcluded) noexcept {
#ifdef PHMAP_HAS_UMUL128
uint64_t h;
(void)umul128(operator()(), boundExcluded, &h);
return h;
#else
return 0;
#endif
}
std::array<uint64_t, 4> state() const {
return {{m_a, m_b, m_c, m_counter}};
}
void state(std::array<uint64_t, 4> const& s) {
m_a = s[0];
m_b = s[1];
m_c = s[2];
m_counter = s[3];
}
private:
template <typename T>
T rotl(T const x, int k) {
return (x << k) | (x >> (8 * sizeof(T) - k));
}
static constexpr int rotation = 24;
static constexpr int right_shift = 11;
static constexpr int left_shift = 3;
uint64_t m_a;
uint64_t m_b;
uint64_t m_c;
uint64_t m_counter;
};
int main()
{
// Create an unordered_map of three strings (that map to strings)
using Map = phmap::parallel_node_hash_map<int, int>;
static size_t const n = 50000000;
sfc64 rng(123);
size_t checksum = 0;
if (0)
{
size_t const max_rng = n / 20;
Map map;
for (size_t i = 0; i < n; ++i) {
checksum += ++map[static_cast<int>(rng(max_rng))];
}
}
if (0)
{
size_t const max_rng = n / 4;
Map map;
for (size_t i = 0; i < n; ++i) {
checksum += ++map[static_cast<int>(rng(max_rng))];
}
}
if (1)
{
size_t const max_rng = n / 2;
Map map;
for (size_t i = 0; i < n; ++i) {
checksum += ++map[static_cast<int>(rng(max_rng))];
}
}
if (0)
{
Map map;
for (size_t i = 0; i < n; ++i) {
checksum += ++map[static_cast<int>(rng())];
}
}
printf("%zu\n", checksum);
}

View File

@ -1,171 +0,0 @@
>ONE Homo sapiens alu
GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGA
TCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACT
AAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAG
GCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCG
CCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGT
GGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCA
GGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAA
TTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAG
AATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCA
GCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGT
AATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACC
AGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTG
GTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACC
CGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAG
AGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTT
TGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACA
TGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCT
GTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGG
TTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGT
CTCAAAAAGGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGG
CGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCG
TCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTA
CTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCG
AGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCG
GGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACC
TGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAA
TACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGA
GGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACT
GCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAAGGCCGGGCGCGGTGGCTC
ACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGT
TCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGC
CGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCG
CTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTG
GGCGACAGAGCGAGACTCCG
>TWO IUB ambiguity codes
cttBtatcatatgctaKggNcataaaSatgtaaaDcDRtBggDtctttataattcBgtcg
tactDtDagcctatttSVHtHttKtgtHMaSattgWaHKHttttagacatWatgtRgaaa
NtactMcSMtYtcMgRtacttctWBacgaaatatagScDtttgaagacacatagtVgYgt
cattHWtMMWcStgttaggKtSgaYaaccWStcgBttgcgaMttBYatcWtgacaYcaga
gtaBDtRacttttcWatMttDBcatWtatcttactaBgaYtcttgttttttttYaaScYa
HgtgttNtSatcMtcVaaaStccRcctDaataataStcYtRDSaMtDttgttSagtRRca
tttHatSttMtWgtcgtatSSagactYaaattcaMtWatttaSgYttaRgKaRtccactt
tattRggaMcDaWaWagttttgacatgttctacaaaRaatataataaMttcgDacgaSSt
acaStYRctVaNMtMgtaggcKatcttttattaaaaagVWaHKYagtttttatttaacct
tacgtVtcVaattVMBcttaMtttaStgacttagattWWacVtgWYagWVRctDattBYt
gtttaagaagattattgacVatMaacattVctgtBSgaVtgWWggaKHaatKWcBScSWa
accRVacacaaactaccScattRatatKVtactatatttHttaagtttSKtRtacaaagt
RDttcaaaaWgcacatWaDgtDKacgaacaattacaRNWaatHtttStgttattaaMtgt
tgDcgtMgcatBtgcttcgcgaDWgagctgcgaggggVtaaScNatttacttaatgacag
cccccacatYScaMgtaggtYaNgttctgaMaacNaMRaacaaacaKctacatagYWctg
ttWaaataaaataRattagHacacaagcgKatacBttRttaagtatttccgatctHSaat
actcNttMaagtattMtgRtgaMgcataatHcMtaBSaRattagttgatHtMttaaKagg
YtaaBataSaVatactWtataVWgKgttaaaacagtgcgRatatacatVtHRtVYataSa
KtWaStVcNKHKttactatccctcatgWHatWaRcttactaggatctataDtDHBttata
aaaHgtacVtagaYttYaKcctattcttcttaataNDaaggaaaDYgcggctaaWSctBa
aNtgctggMBaKctaMVKagBaactaWaDaMaccYVtNtaHtVWtKgRtcaaNtYaNacg
gtttNattgVtttctgtBaWgtaattcaagtcaVWtactNggattctttaYtaaagccgc
tcttagHVggaYtgtNcDaVagctctctKgacgtatagYcctRYHDtgBattDaaDgccK
tcHaaStttMcctagtattgcRgWBaVatHaaaataYtgtttagMDMRtaataaggatMt
ttctWgtNtgtgaaaaMaatatRtttMtDgHHtgtcattttcWattRSHcVagaagtacg
ggtaKVattKYagactNaatgtttgKMMgYNtcccgSKttctaStatatNVataYHgtNa
BKRgNacaactgatttcctttaNcgatttctctataScaHtataRagtcRVttacDSDtt
aRtSatacHgtSKacYagttMHtWataggatgactNtatSaNctataVtttRNKtgRacc
tttYtatgttactttttcctttaaacatacaHactMacacggtWataMtBVacRaSaatc
cgtaBVttccagccBcttaRKtgtgcctttttRtgtcagcRttKtaaacKtaaatctcac
aattgcaNtSBaaccgggttattaaBcKatDagttactcttcattVtttHaaggctKKga
tacatcBggScagtVcacattttgaHaDSgHatRMaHWggtatatRgccDttcgtatcga
aacaHtaagttaRatgaVacttagattVKtaaYttaaatcaNatccRttRRaMScNaaaD
gttVHWgtcHaaHgacVaWtgttScactaagSgttatcttagggDtaccagWattWtRtg
ttHWHacgattBtgVcaYatcggttgagKcWtKKcaVtgaYgWctgYggVctgtHgaNcV
taBtWaaYatcDRaaRtSctgaHaYRttagatMatgcatttNattaDttaattgttctaa
ccctcccctagaWBtttHtBccttagaVaatMcBHagaVcWcagBVttcBtaYMccagat
gaaaaHctctaacgttagNWRtcggattNatcRaNHttcagtKttttgWatWttcSaNgg
gaWtactKKMaacatKatacNattgctWtatctaVgagctatgtRaHtYcWcttagccaa
tYttWttaWSSttaHcaaaaagVacVgtaVaRMgattaVcDactttcHHggHRtgNcctt
tYatcatKgctcctctatVcaaaaKaaaagtatatctgMtWtaaaacaStttMtcgactt
taSatcgDataaactaaacaagtaaVctaggaSccaatMVtaaSKNVattttgHccatca
cBVctgcaVatVttRtactgtVcaattHgtaaattaaattttYtatattaaRSgYtgBag
aHSBDgtagcacRHtYcBgtcacttacactaYcgctWtattgSHtSatcataaatataHt
cgtYaaMNgBaatttaRgaMaatatttBtttaaaHHKaatctgatWatYaacttMctctt
ttVctagctDaaagtaVaKaKRtaacBgtatccaaccactHHaagaagaaggaNaaatBW
attccgStaMSaMatBttgcatgRSacgttVVtaaDMtcSgVatWcaSatcttttVatag
ttactttacgatcaccNtaDVgSRcgVcgtgaacgaNtaNatatagtHtMgtHcMtagaa
attBgtataRaaaacaYKgtRccYtatgaagtaataKgtaaMttgaaRVatgcagaKStc
tHNaaatctBBtcttaYaBWHgtVtgacagcaRcataWctcaBcYacYgatDgtDHccta
>THREE Homo sapiens frequency
aacacttcaccaggtatcgtgaaggctcaagattacccagagaacctttgcaatataaga
atatgtatgcagcattaccctaagtaattatattctttttctgactcaaagtgacaagcc
ctagtgtatattaaatcggtatatttgggaaattcctcaaactatcctaatcaggtagcc
atgaaagtgatcaaaaaagttcgtacttataccatacatgaattctggccaagtaaaaaa
tagattgcgcaaaattcgtaccttaagtctctcgccaagatattaggatcctattactca
tatcgtgtttttctttattgccgccatccccggagtatctcacccatccttctcttaaag
gcctaatattacctatgcaaataaacatatattgttgaaaattgagaacctgatcgtgat
tcttatgtgtaccatatgtatagtaatcacgcgactatatagtgctttagtatcgcccgt
gggtgagtgaatattctgggctagcgtgagatagtttcttgtcctaatatttttcagatc
gaatagcttctatttttgtgtttattgacatatgtcgaaactccttactcagtgaaagtc
atgaccagatccacgaacaatcttcggaatcagtctcgttttacggcggaatcttgagtc
taacttatatcccgtcgcttactttctaacaccccttatgtatttttaaaattacgttta
ttcgaacgtacttggcggaagcgttattttttgaagtaagttacattgggcagactcttg
acattttcgatacgactttctttcatccatcacaggactcgttcgtattgatatcagaag
ctcgtgatgattagttgtcttctttaccaatactttgaggcctattctgcgaaatttttg
ttgccctgcgaacttcacataccaaggaacacctcgcaacatgccttcatatccatcgtt
cattgtaattcttacacaatgaatcctaagtaattacatccctgcgtaaaagatggtagg
ggcactgaggatatattaccaagcatttagttatgagtaatcagcaatgtttcttgtatt
aagttctctaaaatagttacatcgtaatgttatctcgggttccgcgaataaacgagatag
attcattatatatggccctaagcaaaaacctcctcgtattctgttggtaattagaatcac
acaatacgggttgagatattaattatttgtagtacgaagagatataaaaagatgaacaat
tactcaagtcaagatgtatacgggatttataataaaaatcgggtagagatctgctttgca
attcagacgtgccactaaatcgtaatatgtcgcgttacatcagaaagggtaactattatt
aattaataaagggcttaatcactacatattagatcttatccgatagtcttatctattcgt
tgtatttttaagcggttctaattcagtcattatatcagtgctccgagttctttattattg
ttttaaggatgacaaaatgcctcttgttataacgctgggagaagcagactaagagtcgga
gcagttggtagaatgaggctgcaaaagacggtctcgacgaatggacagactttactaaac
caatgaaagacagaagtagagcaaagtctgaagtggtatcagcttaattatgacaaccct
taatacttccctttcgccgaatactggcgtggaaaggttttaaaagtcgaagtagttaga
ggcatctctcgctcataaataggtagactactcgcaatccaatgtgactatgtaatactg
ggaacatcagtccgcgatgcagcgtgtttatcaaccgtccccactcgcctggggagacat
gagaccacccccgtggggattattagtccgcagtaatcgactcttgacaatccttttcga
ttatgtcatagcaatttacgacagttcagcgaagtgactactcggcgaaatggtattact
aaagcattcgaacccacatgaatgtgattcttggcaatttctaatccactaaagcttttc
cgttgaatctggttgtagatatttatataagttcactaattaagatcacggtagtatatt
gatagtgatgtctttgcaagaggttggccgaggaatttacggattctctattgatacaat
ttgtctggcttataactcttaaggctgaaccaggcgtttttagacgacttgatcagctgt
tagaatggtttggactccctctttcatgtcagtaacatttcagccgttattgttacgata
tgcttgaacaatattgatctaccacacacccatagtatattttataggtcatgctgttac
ctacgagcatggtattccacttcccattcaatgagtattcaacatcactagcctcagaga
tgatgacccacctctaataacgtcacgttgcggccatgtgaaacctgaacttgagtagac
gatatcaagcgctttaaattgcatataacatttgagggtaaagctaagcggatgctttat
ataatcaatactcaataataagatttgattgcattttagagttatgacacgacatagttc
actaacgagttactattcccagatctagactgaagtactgatcgagacgatccttacgtc
gatgatcgttagttatcgacttaggtcgggtctctagcggtattggtacttaaccggaca
ctatactaataacccatgatcaaagcataacagaatacagacgataatttcgccaacata
tatgtacagaccccaagcatgagaagctcattgaaagctatcattgaagtcccgctcaca
atgtgtcttttccagacggtttaactggttcccgggagtcctggagtttcgacttacata
aatggaaacaatgtattttgctaatttatctatagcgtcatttggaccaatacagaatat
tatgttgcctagtaatccactataacccgcaagtgctgatagaaaatttttagacgattt
ataaatgccccaagtatccctcccgtgaatcctccgttatactaattagtattcgttcat
acgtataccgcgcatatatgaacatttggcgataaggcgcgtgaattgttacgtgacaga
gatagcagtttcttgtgatatggttaacagacgtacatgaagggaaactttatatctata
gtgatgcttccgtagaaataccgccactggtctgccaatgatgaagtatgtagctttagg
tttgtactatgaggctttcgtttgtttgcagagtataacagttgcgagtgaaaaaccgac
gaatttatactaatacgctttcactattggctacaaaatagggaagagtttcaatcatga
gagggagtatatggatgctttgtagctaaaggtagaacgtatgtatatgctgccgttcat
tcttgaaagatacataagcgataagttacgacaattataagcaacatccctaccttcgta
acgatttcactgttactgcgcttgaaatacactatggggctattggcggagagaagcaga
tcgcgccgagcatatacgagacctataatgttgatgatagagaaggcgtctgaattgata
catcgaagtacactttctttcgtagtatctctcgtcctctttctatctccggacacaaga
attaagttatatatatagagtcttaccaatcatgttgaatcctgattctcagagttcttt
ggcgggccttgtgatgactgagaaacaatgcaatattgctccaaatttcctaagcaaatt
ctcggttatgttatgttatcagcaaagcgttacgttatgttatttaaatctggaatgacg
gagcgaagttcttatgtcggtgtgggaataattcttttgaagacagcactccttaaataa
tatcgctccgtgtttgtatttatcgaatgggtctgtaaccttgcacaagcaaatcggtgg
tgtatatatcggataacaattaatacgatgttcatagtgacagtatactgatcgagtcct
ctaaagtcaattacctcacttaacaatctcattgatgttgtgtcattcccggtatcgccc
gtagtatgtgctctgattgaccgagtgtgaaccaaggaacatctactaatgcctttgtta
ggtaagatctctctgaattccttcgtgccaacttaaaacattatcaaaatttcttctact
tggattaactacttttacgagcatggcaaattcccctgtggaagacggttcattattatc
ggaaaccttatagaaattgcgtgttgactgaaattagatttttattgtaagagttgcatc
tttgcgattcctctggtctagcttccaatgaacagtcctcccttctattcgacatcgggt
ccttcgtacatgtctttgcgatgtaataattaggttcggagtgtggccttaatgggtgca
actaggaatacaacgcaaatttgctgacatgatagcaaatcggtatgccggcaccaaaac
gtgctccttgcttagcttgtgaatgagactcagtagttaaataaatccatatctgcaatc
gattccacaggtattgtccactatctttgaactactctaagagatacaagcttagctgag
accgaggtgtatatgactacgctgatatctgtaaggtaccaatgcaggcaaagtatgcga
gaagctaataccggctgtttccagctttataagattaaaatttggctgtcctggcggcct
cagaattgttctatcgtaatcagttggttcattaattagctaagtacgaggtacaactta
tctgtcccagaacagctccacaagtttttttacagccgaaacccctgtgtgaatcttaat
atccaagcgcgttatctgattagagtttacaactcagtattttatcagtacgttttgttt
ccaacattacccggtatgacaaaatgacgccacgtgtcgaataatggtctgaccaatgta
ggaagtgaaaagataaatat

File diff suppressed because it is too large Load Diff

View File

@ -1,236 +0,0 @@
// ------------------------------------------------------------------
// run with: knucleotide 0 < ../examples/knucleotide-input.txt
// ------------------------------------------------------------------
//
// output should be:
//
// T 31.520
// A 29.600
// C 19.480
// G 19.400
//
// AT 9.922
// TT 9.602
// TA 9.402
// AA 8.402
// GA 6.321
// TC 6.301
// TG 6.201
// GT 6.041
// CT 5.961
// AG 5.841
// CA 5.461
// AC 5.441
// CC 4.041
// CG 4.021
// GC 3.701
// GG 3.341
//
// 54 GGT
// 24 GGTA
// 4 GGTATT
// 0 GGTATTTTAATT
// 0 GGTATTTTAATTTATAGT
// ------------------------------------------------------------------
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <string>
#include <algorithm>
#include <map>
#include <thread>
#include <type_traits>
#include <cstring>
#include <array>
#include <vector>
#include <cassert>
#include <parallel_hashmap/phmap.h>
// ------------------------------------------------------------------
constexpr size_t thread_count = 4;
struct Cfg {
unsigned char *to_char;
unsigned char to_num[128];
using Data = std::vector<unsigned char>;
Cfg() {
static unsigned char __tochar[] = {'A', 'C', 'T', 'G'};
to_char = __tochar;
to_num[static_cast<unsigned char>('A')] = to_num[static_cast<unsigned char>('a')] = 0;
to_num[static_cast<unsigned char>('C')] = to_num[static_cast<unsigned char>('c')] = 1;
to_num[static_cast<unsigned char>('T')] = to_num[static_cast<unsigned char>('t')] = 2;
to_num[static_cast<unsigned char>('G')] = to_num[static_cast<unsigned char>('g')] = 3;
}
} const cfg;
// ------------------------------------------------------------------
template <size_t size>
struct Key
{
// select type to use for 'data', if hash key can fit on 32-bit integer
// then use uint32_t else use uint64_t.
using Data = typename std::conditional<size<=16, uint32_t, uint64_t>::type;
struct Hash {
Data operator()(const Key& t)const{ return t._data; }
};
Key() : _data(0) {
}
Key(const char *str) {
_data = 0;
for(unsigned i = 0; i < size; ++i){
_data <<= 2;
_data |= cfg.to_num[unsigned(str[i])];
}
}
// initialize hash from input data
void InitKey(const unsigned char *data) {
for(unsigned i = 0; i < size; ++i){
_data <<= 2;
_data |= data[i];
}
}
// updates the key with 1 byte
void UpdateKey(const unsigned char data) {
_data <<= 2;
_data |= data;
}
// masks out excess information
void MaskKey() {
_data &= _mask;
}
// implicit casting operator to string
operator std::string() const {
std::string tmp;
Data data = _data;
for(size_t i = 0; i != size; ++i, data >>= 2)
tmp += cfg.to_char[data & 3ull];
std::reverse(tmp.begin(), tmp.end());
return tmp;
}
bool operator== (const Key& in) const {
return _data == in._data;
}
private:
static constexpr Data _mask = ~(Data(-1) << (2 * size));
Data _data;
};
// ------------------------------------------------------------------
template <size_t size, typename K = Key<size> >
using HashTable = phmap::flat_hash_map<K, unsigned, typename K::Hash>;
// ------------------------------------------------------------------
template <size_t size>
void Calculate(const Cfg::Data& input, size_t begin, HashTable<size>& table)
{
// original implementation fully recomputes the hash key for each
// insert to the hash table. This implementation only partially
// updates the hash, this is the same with C GCC, Rust #6 and Rust #4
Key<size> key;
// initialize key
key.InitKey(input.data() + begin);
// use key to increment value
++table[key];
auto itr_begin = input.data() + begin + thread_count;
auto itr_end = (input.data() + input.size() + 1) - size;
size_t nsize = std::min(size, thread_count);
for(;itr_begin < itr_end; itr_begin += thread_count) {
// update the key 1 byte at a time
for(unsigned i = 0; i < nsize; ++i)
key.UpdateKey( itr_begin[i] );
// then finally mask out excess information
key.MaskKey();
// then use key to increment value
++table[key];
}
}
// ------------------------------------------------------------------
template <size_t size>
HashTable<size> CalculateInThreads(const Cfg::Data& input)
{
HashTable<size> hash_tables[thread_count];
std::thread threads[thread_count];
auto invoke = [&](unsigned begin) {
Calculate<size>(input, begin, hash_tables[begin]);
};
for(unsigned i = 0; i < thread_count; ++i)
threads[i] = std::thread(invoke, i);
for(auto& i : threads)
i.join();
auto& frequencies = hash_tables[0];
for(unsigned i = 1 ; i < thread_count; ++i)
for(auto& j : hash_tables[i])
frequencies[j.first] += j.second;
// return the 'frequency' by move instead of copy.
return std::move(frequencies);
}
// ------------------------------------------------------------------
template <unsigned size>
void WriteFrequencies(const Cfg::Data& input)
{
// we "receive" the returned object by move instead of copy.
auto&& frequencies = CalculateInThreads<size>(input);
std::map<unsigned, std::string, std::greater<unsigned>> freq;
for(const auto& i: frequencies)
freq.insert({i.second, i.first});
const unsigned sum = static_cast<unsigned>(input.size()) + 1 - size;
for(const auto& i : freq)
std::cout << i.second << ' ' << (sum ? double(100 * i.first) / sum : 0.0) << '\n';
std::cout << '\n';
}
// ------------------------------------------------------------------
template <unsigned size>
void WriteCount( const Cfg::Data& input, const char *text ) {
// we "receive" the returned object by move instead of copy.
auto&& frequencies = CalculateInThreads<size>(input);
std::cout << frequencies[Key<size>(text)] << '\t' << text << '\n';
}
// ------------------------------------------------------------------
int main()
{
Cfg::Data data;
std::array<char, 256> buf;
while(fgets(buf.data(), static_cast<int>(buf.size()), stdin) && memcmp(">THREE", buf.data(), 6));
while(fgets(buf.data(), static_cast<int>(buf.size()), stdin) && buf.front() != '>') {
if(buf.front() != ';'){
auto i = std::find(buf.begin(), buf.end(), '\n');
data.insert(data.end(), buf.begin(), i);
}
}
std::transform(data.begin(), data.end(), data.begin(), [](unsigned char c){
return cfg.to_num[c];
});
std::cout << std::setprecision(3) << std::setiosflags(std::ios::fixed);
WriteFrequencies<1>(data);
WriteFrequencies<2>(data);
// value at left is the length of the passed string.
WriteCount<3>(data, "GGT");
WriteCount<4>(data, "GGTA");
WriteCount<6>(data, "GGTATT");
WriteCount<12>(data, "GGTATTTTAATT");
WriteCount<18>(data, "GGTATTTTAATTTATAGT");
}

View File

@ -1,54 +0,0 @@
// ------------------------
// Windows specific example
// curtesy of @kanonka
// ------------------------
#include <windows.h>
#include "parallel_hashmap/phmap.h"
#include <cstring>
#include <vector>
#include <ppl.h>
class srwlock {
SRWLOCK _lock;
public:
srwlock() { InitializeSRWLock(&_lock); }
void lock() { AcquireSRWLockExclusive(&_lock); }
void unlock() { ReleaseSRWLockExclusive(&_lock); }
};
using Map = phmap::parallel_flat_hash_map<std::string, int, phmap::priv::hash_default_hash<std::string>,
phmap::priv::hash_default_eq<std::string>,
std::allocator<std::pair<const std::string, int>>, 8, srwlock>;
class Dict
{
Map m_stringsMap;
public:
int addParallel(std::string&& str, volatile long* curIdx)
{
int newIndex = -1;
m_stringsMap.lazy_emplace_l(std::move(str),
[&](int& v) { newIndex = v; }, // called only when key was already present
[&](const Map::constructor& ctor) // construct value_type in place when key not present
{ newIndex = InterlockedIncrement(curIdx); ctor(std::move(str), newIndex); });
return newIndex;
}
};
int main()
{
size_t totalSize = 6000000;
std::vector<int> values(totalSize);
Dict dict;
volatile long index = 0;
concurrency::parallel_for(size_t(0), size_t(totalSize),
[&](size_t i) {
std::string s = "ab_uu_" + std::to_string(i % 1000000);
values[i] = dict.addParallel(std::move(s), &index);
});
return 0;
}

View File

@ -1,139 +0,0 @@
#include <chrono>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <random>
#include <parallel_hashmap/phmap.h>
#include <parallel_hashmap/btree.h>
// -------------------------------------------------------------------
// -------------------------------------------------------------------
class Timer
{
public:
Timer(std::string name) : _name(name), _start(std::chrono::high_resolution_clock::now()) {}
~Timer()
{
std::chrono::duration<float> elapsed_seconds = std::chrono::high_resolution_clock::now() - _start;
printf("%s: %.3fs\n", _name.c_str(), elapsed_seconds.count());
}
private:
std::string _name;
std::chrono::high_resolution_clock::time_point _start;
};
// --------------------------------------------------------------------------
// from: https://github.com/preshing/RandomSequence
// --------------------------------------------------------------------------
class RSU
{
private:
uint32_t m_index;
uint32_t m_intermediateOffset;
static uint32_t permuteQPR(uint32_t x)
{
static const uint32_t prime = 4294967291u;
if (x >= prime)
return x; // The 5 integers out of range are mapped to themselves.
uint32_t residue = ((unsigned long long) x * x) % prime;
return (x <= prime / 2) ? residue : prime - residue;
}
public:
RSU(uint32_t seedBase, uint32_t seedOffset)
{
m_index = permuteQPR(permuteQPR(seedBase) + 0x682f0161);
m_intermediateOffset = permuteQPR(permuteQPR(seedOffset) + 0x46790905);
}
uint32_t next()
{
return permuteQPR((permuteQPR(m_index++) + m_intermediateOffset) ^ 0x5bf03635);
}
};
using Perturb = std::function<void (std::vector<uint64_t> &)>;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
template<class Set, size_t N>
void test(const char *name, Perturb perturb1, Perturb /* perturb2 */)
{
//phmap::btree_set<uint64_t> s;
Set s;
unsigned int seed = 76687;
RSU rsu(seed, seed + 1);
for (uint32_t i=0; i<N; ++i)
s.insert(rsu.next());
std::vector<uint64_t> order(s.begin(), s.end()); // contains sorted, randomly generated keys (when using phmap::btree_set)
// or keys in the final order of a Set (when using Set).
perturb1(order); // either keep them in same order, or shuffle them
#if 0
order.resize(N/4);
perturb2(order);
#endif
Timer t(name); // start timer
Set c;
//c.reserve(order.size()); // whether this "reserve()" is present or not makes a huge difference
c.insert(order.begin(), order.end()); // time for inserting the same keys into the set
// should not depend on them being sorted or not.
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
template <class T, size_t N>
using pset = phmap::parallel_flat_hash_set<T,
phmap::priv::hash_default_hash<T>,
phmap::priv::hash_default_eq<T>,
phmap::priv::Allocator<T>, // alias for std::allocator
N>;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
int main()
{
auto shuffle = [](std::vector<uint64_t> &order) {
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(order.begin(), order.end(), g);
};
auto noop = [](std::vector<uint64_t> &) {};
auto perturb2 = noop;
constexpr uint32_t num_keys = 10000000;
using T = uint64_t;
test<phmap::flat_hash_set<T>, num_keys>("flat_hash_set ordered ", noop, perturb2);
test<phmap::flat_hash_set<T>, num_keys>("flat_hash_set shuffled", shuffle, perturb2);
test<pset<T, 4>, num_keys>("parallel (16) ordered ", noop, perturb2);
test<pset<T, 4>, num_keys>("parallel (16) shuffled", shuffle, perturb2);
test<pset<T, 6>, num_keys>("parallel (64) ordered ", noop, perturb2);
test<pset<T, 6>, num_keys>("parallel (64) shuffled", shuffle, perturb2);
test<pset<T, 8>, num_keys>("parallel (256) ordered ", noop, perturb2);
test<pset<T, 8>, num_keys>("parallel (256) shuffled", shuffle, perturb2);
}

View File

@ -1,204 +0,0 @@
#include <iostream>
#include <bitset>
#include <cinttypes>
#define USE_CEREAL 0
#if USE_CEREAL
#include "cereal/types/unordered_map.hpp"
#include "cereal/types/memory.hpp"
#include "cereal/types/bitset.hpp"
#include "cereal/archives/binary.hpp"
#include <fstream>
#endif
#include "parallel_hashmap/phmap_dump.h"
#include <chrono>
#include <functional>
#include <cstdio>
using phmap::flat_hash_map;
using namespace std;
template <typename T> using milliseconds = std::chrono::duration<T, std::milli>;
// --------------------------------------------------------------------------
// from: https://github.com/preshing/RandomSequence
// --------------------------------------------------------------------------
class RSU
{
private:
unsigned int m_index;
unsigned int m_intermediateOffset;
static unsigned int permuteQPR(unsigned int x)
{
static const unsigned int prime = 4294967291u;
if (x >= prime)
return x; // The 5 integers out of range are mapped to themselves.
unsigned int residue = ((unsigned long long) x * x) % prime;
return (x <= prime / 2) ? residue : prime - residue;
}
public:
RSU(unsigned int seedBase, unsigned int seedOffset)
{
m_index = permuteQPR(permuteQPR(seedBase) + 0x682f0161);
m_intermediateOffset = permuteQPR(permuteQPR(seedOffset) + 0x46790905);
}
unsigned int next()
{
return permuteQPR((permuteQPR(m_index++) + m_intermediateOffset) ^ 0x5bf03635);
}
};
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
void showtime(const char *name, std::function<void ()> doit)
{
auto t1 = std::chrono::high_resolution_clock::now();
doit();
auto t2 = std::chrono::high_resolution_clock::now();
auto elapsed = milliseconds<double>(t2 - t1).count();
printf("%s: %.3fs\n", name, (int)elapsed / 1000.0f);
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
template <class MapType>
void testMapSerialization(const char *maptype, const char *fname)
{
MapType table;
const int num_items = 100000000;
printf("Building test %s\n", maptype);
// Iterate and add keys and values
// -------------------------------
showtime("build time", [&table, num_items]() {
unsigned int seed = 76687;
RSU rsu(seed, seed + 1);
table.reserve(num_items);
for (int i=0; i < num_items; ++i)
table.insert(typename MapType::value_type(rsu.next(), i));
});
// cerealize and save data
// -----------------------
showtime("serialize", [&]() {
#if !USE_CEREAL
phmap::BinaryOutputArchive ar_out(fname);
table.phmap_dump(ar_out);
#else
ofstream os(fname, std::ofstream::out | std::ofstream::trunc | std::ofstream::binary);
cereal::BinaryOutputArchive archive(os);
archive(table.size());
archive(table);
#endif
});
MapType table_in;
// deserialize
// -----------
showtime("deserialize", [&]() {
#if !USE_CEREAL
phmap::BinaryInputArchive ar_in(fname);
table_in.phmap_load(ar_in);
#else
ifstream is(fname, std::ofstream::in | std::ofstream::binary);
cereal::BinaryInputArchive archive_in(is);
size_t table_size;
archive_in(table_size);
table_in.reserve(table_size);
archive_in(table_in); // deserialize from file out.cereal into table_in
#endif
});
if (table == table_in)
printf("All checks out, table size: %zu\n\n", table_in.size());
else
printf("FAILURE\n");
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
template <class SetType>
void testSetSerialization(const char *settype, const char *fname)
{
SetType table;
const int num_items = 100000000;
printf("Building test %s\n", settype);
// Iterate and add keys and values
// -------------------------------
showtime("build time", [&]() {
unsigned int seed = 76687;
RSU rsu(seed, seed + 1);
table.reserve(num_items);
for (int i=0; i < num_items; ++i)
table.insert(typename SetType::value_type(rsu.next()));
});
// cerealize and save data
// -----------------------
showtime("serialize", [&]() {
#if !USE_CEREAL
phmap::BinaryOutputArchive ar_out(fname);
table.phmap_dump(ar_out);
#else
ofstream os(fname, std::ofstream::out | std::ofstream::trunc | std::ofstream::binary);
cereal::BinaryOutputArchive archive(os);
archive(table.size());
archive(table);
#endif
});
SetType table_in;
// deserialize
// -----------
showtime("deserialize", [&]() {
#if !USE_CEREAL
phmap::BinaryInputArchive ar_in(fname);
table_in.phmap_load(ar_in);
#else
ifstream is(fname, std::ofstream::in | std::ofstream::binary);
cereal::BinaryInputArchive archive_in(is);
size_t table_size;
archive_in(table_size);
table_in.reserve(table_size);
archive_in(table_in); // deserialize from file out.cereal into table_in
#endif
});
if (table == table_in)
printf("All checks out, table size: %zu\n\n", table_in.size());
else
printf("FAILURE\n");
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
int main()
{
testSetSerialization<phmap::flat_hash_set<unsigned int>>("flat_hash_set", "dump1.bin");
#if 0
testSetSerialization<phmap::parallel_flat_hash_set<unsigned int>>("parallel_flat_hash_set", "dump1.bin");
testMapSerialization<phmap::flat_hash_map<unsigned int, int>>("flat_hash_map", "dump1.bin");
testMapSerialization<phmap::parallel_flat_hash_map<unsigned int, int>>("parallel_flat_hash_map", "dump1.bin");
#endif
return 0;
}

View File

@ -1,48 +0,0 @@
PANDOC = stack exec pandoc --
MATHJAX = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
FLAGS = --standalone --toc --toc-depth=2 --mathjax=$(MATHJAX) --highlight-style pygments
PNG_IMAGES = $(patsubst %.pdf,%.png,$(wildcard img/*.pdf))
IFORMAT = -f gfm
FILTER = includes.exe
FILTER_OPT = --filter=${FILTER} # includes.hs
############################### html
STYLE = css/style.css
TEMPLATE_HTML = template.html
HTML_OPT = -c ${STYLE} --template ${TEMPLATE_HTML} -t html
PGTITLE = --metadata pagetitle="The Parallel Hashmap"
############################### pdf
TEMPLATE_TEX = template.latex
TEX_OPT = --template $(TEMPLATE_TEX) --pdf-engine=xelatex
############################### epub
EPUB_COVER = --epub-cover-image=img/cover-kindle.jpg
SRC = parallel_hashmap.md
OBJ = $(SRC:.md=.html)
all: html
includes.exe: includes.hs
stack exec ghc -- -o $@ -no-keep-hi-files -no-keep-o-files includes.hs
html: parallel_hashmap.md $(FILTER) ${TEMPLATE_HTML} ${STYLE}
$(PANDOC) ${FILTER_OPT} ${IFORMAT} ${HTML_OPT} $(FLAGS) ${PGTITLE} -o ../index.html parallel_hashmap.md
%.pdf: %.md $(FILTER) ${TEMPLATE_TEX}
$(PANDOC) ${FILTER_OPT} ${IFORMAT} ${TEX_OPT} $(FLAGS) -o $@ $<
pdf: $(FILTER) ${TEMPLATE_TEX}
rm -f parallel_hashmap.pdf; $(PANDOC) ${FILTER_OPT} ${IFORMAT} ${TEX_OPT} $(FLAGS) -o parallel_hashmap.pdf title.md $(SRC)
native:
$(PANDOC) -s -t native $(SRC)
native_filt: $(FILTER)
$(PANDOC) ${FILTER_OPT} -s -t native $(SRC)
clean:
-rm -f *.html *.pdf cppi.epub

View File

@ -1,69 +0,0 @@
<html><head></head><body>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id="id_ebc96fe0" style="height:250em"></div>
<script>
var colors = Plotly.d3.scale.category10().range();
var m0y = [ "eastl::hash_map", "std::unordered_map", "boost::unordered_map 1_58", "phmap::<br>parallel_node_hash_map", "boost::multi_index::<br>hashed_unique", "absl::node_hash_map", "phmap::node_hash_map", "spp::sparse_hash_map", "<b>tsl::sparse_map</b>", "folly::F14NodeMap", "robin_hood::<br>unordered_node_map", "folly::F14ValueMap", "<b>phmap::<br>parallel_flat_hash_map</b>", "absl::flat_hash_map", "tsl::hopscotch_map", "ska::bytell_hash_map", "<b>phmap::flat_hash_map</b>", "emilib1::HashMap", "<b>robin_hood::<br>unordered_flat_map</b>", "<b>tsl::robin_map</b>"];
var m1y = [ "eastl::hash_map", "boost::unordered_map 1_58", "std::unordered_map", "phmap::<br>parallel_node_hash_map", "boost::multi_index::<br>hashed_unique", "phmap::node_hash_map", "absl::node_hash_map", "spp::sparse_hash_map", "<b>tsl::sparse_map</b>", "folly::F14NodeMap", "robin_hood::<br>unordered_node_map", "folly::F14ValueMap", "absl::flat_hash_map", "<b>phmap::<br>parallel_flat_hash_map</b>", "phmap::flat_hash_map", "tsl::hopscotch_map", "ska::bytell_hash_map", "emilib1::HashMap", "<b>robin_hood::<br>unordered_flat_map</b>", "<b>tsl::robin_map</b>"];
var m2y = [ "eastl::hash_map", "std::unordered_map", "boost::unordered_map 1_58", "phmap::<br>parallel_node_hash_map", "boost::multi_index::<br>hashed_unique", "absl::node_hash_map", "phmap::node_hash_map", "spp::sparse_hash_map", "<b>tsl::sparse_map</b>", "folly::F14NodeMap", "robin_hood::<br>unordered_node_map", "folly::F14ValueMap", "<b>phmap::<br>parallel_flat_hash_map</b>", "absl::flat_hash_map", "tsl::hopscotch_map", "emilib1::HashMap", "phmap::flat_hash_map", "<b>ska::bytell_hash_map</b>", "<b>robin_hood::<br>unordered_flat_map</b>", "<b>tsl::robin_map</b>"];
var m3y = [ "absl::node_hash_map", "absl::flat_hash_map", "boost::unordered_map 1_58", "std::unordered_map", "eastl::hash_map", "phmap::<br>parallel_node_hash_map", "boost::multi_index::<br>hashed_unique", "phmap::node_hash_map", "spp::sparse_hash_map", "<b>tsl::sparse_map</b>", "folly::F14NodeMap", "robin_hood::<br>unordered_node_map", "folly::F14ValueMap", "<b>phmap::<br>parallel_flat_hash_map</b>", "phmap::flat_hash_map", "tsl::hopscotch_map", "<b>ska::bytell_hash_map</b>", "emilib1::HashMap", "<b>robin_hood::<br>unordered_flat_map</b>", "<b>tsl::robin_map</b>"];
var m4y = [ "absl::node_hash_map", "absl::flat_hash_map", "std::unordered_map", "boost::unordered_map 1_58", "eastl::hash_map", "phmap::<br>parallel_node_hash_map", "boost::multi_index::<br>hashed_unique", "phmap::node_hash_map", "spp::sparse_hash_map", "<b>tsl::sparse_map</b>", "folly::F14NodeMap", "robin_hood::<br>unordered_node_map", "<b>phmap::<br>parallel_flat_hash_map</b>", "<b>folly::F14ValueMap</b>", "<b>phmap::flat_hash_map</b>", "ska::bytell_hash_map", "emilib1::HashMap", "tsl::hopscotch_map", "<b>robin_hood::<br>unordered_flat_map</b>", "<b>tsl::robin_map</b>"];
var measurement_names = [ "insert 100M int" ];
var data = [
{ x: [ 48.0243, 46.5861, 45.9632, 40.5576, 37.6103, 31.3413, 30.9575, 27.1914, 24.8357, 22.0214, 20.3446, 15.2266, 13.8475, 13.7777, 12.2028, 12.0487, 11.1835, 10.9024, 9.23316, 6.46943 ],
y: m0y, name: measurement_names[0] + ' (absl::Hash)', type: 'bar', orientation: 'h', yaxis: 'y', marker: { color: colors[0], },
textposition: 'outside',
text: [ "48.0s<br>4156MB", "46.6s<br>3989MB", "46.0s<br>3777MB", "40.6s<br>4161MB", "37.6s<br>3777MB", "31.3s<br>4161MB", "31.0s<br>4161MB", "27.2s<br>1233MB", "<b>24.8s<br>1060MB</b>", "22.0s<br>4033MB", "20.3s<br>2296MB", "15.2s<br>1537MB", "<b>13.8s<br>1180MB</b>", "13.8s<br>1721MB", "12.2s<br>3064MB", "12.0s<br>1721MB", "<b>11.2s<br>1720MB</b>", "10.9s<br>2296MB", "<b>9.23s<br>1720MB</b>", "<b>6.47s<br>4600MB</b>" ],
},
{ x: [ 47.2099, 46.459, 45.9743, 40.3984, 37.8695, 32.6551, 30.9481, 26.997, 24.7551, 22.2447, 20.2678, 15.2371, 13.8187, 13.5773, 13.1002, 12.4352, 11.5716, 10.8488, 8.66035, 6.54138 ],
y: m1y, name: measurement_names[0] + ' (robin_hood::hash)', type: 'bar', orientation: 'h', yaxis: 'y2', marker: { color: colors[0], },
textposition: 'outside',
text: [ "47.2s<br>4156MB", "46.5s<br>3777MB", "46.0s<br>3989MB", "40.4s<br>4161MB", "37.9s<br>3776MB", "32.7s<br>4161MB", "30.9s<br>4161MB", "27.0s<br>1233MB", "<b>24.8s<br>1060MB</b>", "22.2s<br>4034MB", "20.3s<br>2296MB", "15.2s<br>1537MB", "13.8s<br>1721MB", "<b>13.6s<br>1180MB</b>", "13.1s<br>1721MB", "12.4s<br>3064MB", "11.6s<br>1721MB", "10.8s<br>2296MB", "<b>8.66s<br>1720MB</b>", "<b>6.54s<br>4601MB</b>" ],
},
{ x: [ 47.4464, 46.6774, 46.5407, 41.3329, 38.0029, 33.5645, 32.8472, 27.6975, 24.856, 22.4334, 21.0759, 15.6409, 15.0877, 13.0797, 12.4225, 11.8954, 11.5608, 11.4623, 8.98865, 7.1118 ],
y: m2y, name: measurement_names[0] + ' (FNV1a)', type: 'bar', orientation: 'h', yaxis: 'y3', marker: { color: colors[0], },
textposition: 'outside',
text: [ "47.4s<br>4156MB", "46.7s<br>3989MB", "46.5s<br>3777MB", "41.3s<br>4161MB", "38.0s<br>3777MB", "33.6s<br>4161MB", "32.8s<br>4160MB", "27.7s<br>1233MB", "<b>24.9s<br>1060MB</b>", "22.4s<br>4033MB", "21.1s<br>2297MB", "15.6s<br>1537MB", "<b>15.1s<br>1181MB</b>", "13.1s<br>1720MB", "12.4s<br>3064MB", "11.9s<br>2296MB", "11.6s<br>1720MB", "<b>11.5s<br>1720MB</b>", "<b>8.99s<br>1720MB</b>", "<b>7.11s<br>4600MB</b>" ],
},
{ x: [ 0, 0, 46.7195, 45.8197, 43.3253, 39.7176, 37.2546, 30.3592, 26.6751, 24.2579, 21.7569, 20.2528, 15.0232, 13.9146, 13.091, 11.9234, 10.9833, 10.4468, 8.26594, 5.9112 ],
y: m3y, name: measurement_names[0] + ' (Identity)', type: 'bar', orientation: 'h', yaxis: 'y4', marker: { color: colors[0], },
textposition: 'outside',
text: [ "timeout", "timeout", "46.7s<br>3777MB", "45.8s<br>3989MB", "43.3s<br>4156MB", "39.7s<br>4161MB", "37.3s<br>3776MB", "30.4s<br>4160MB", "26.7s<br>1233MB", "<b>24.3s<br>1060MB</b>", "21.8s<br>4033MB", "20.3s<br>2297MB", "15.0s<br>1536MB", "<b>13.9s<br>1181MB</b>", "13.1s<br>1721MB", "11.9s<br>3064MB", "<b>11.0s<br>1720MB</b>", "10.4s<br>2296MB", "<b>8.27s<br>1720MB</b>", "<b>5.91s<br>4600MB</b>" ],
},
{ x: [ 0, 0, 46.2752, 45.6408, 44.4415, 40.7703, 40.6562, 31.647, 27.6576, 24.8331, 22.714, 21.0315, 16.516, 15.5407, 12.0583, 11.9637, 11.4148, 10.9306, 9.04966, 7.0222 ],
y: m4y, name: measurement_names[0] + ' (folly::hasher)', type: 'bar', orientation: 'h', yaxis: 'y5', marker: { color: colors[0], },
textposition: 'outside',
text: [ "timeout", "timeout", "46.3s<br>3989MB", "45.6s<br>3777MB", "44.4s<br>4156MB", "40.8s<br>4160MB", "40.7s<br>3777MB", "31.6s<br>4161MB", "27.7s<br>1233MB", "<b>24.8s<br>1060MB</b>", "22.7s<br>4034MB", "21.0s<br>2296MB", "<b>16.5s<br>1181MB</b>", "<b>15.5s<br>1537MB</b>", "<b>12.1s<br>1720MB</b>", "12.0s<br>1720MB", "11.4s<br>2297MB", "10.9s<br>3064MB", "<b>9.05s<br>1720MB</b>", "<b>7.02s<br>4600MB</b>" ],
},
];
var layout = {
// title: { text: 'InsertManyInt'},
grid: {
ygap: 0.1,
subplots: [
['xy'],
['xy2'],
['xy3'],
['xy4'],
['xy5'],
] },
barmode: 'stack',
yaxis: { title: 'absl::Hash', automargin: true, },
yaxis2: { title: 'robin_hood::hash', automargin: true, },
yaxis3: { title: 'FNV1a', automargin: true, },
yaxis4: { title: 'Identity', automargin: true, },
yaxis5: { title: 'folly::hasher', automargin: true, },
xaxis: { automargin: true, },
legend: { traceorder: 'normal' },
margin: { pad: 0, l:0, r:0, t:0, b:0, },
showlegend:false,
};
Plotly.newPlot('id_ebc96fe0', data, layout);
</script>
</body></html>

View File

@ -1,84 +0,0 @@
<html><head></head><body>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id="id_ceec23e8" style="height:250em"></div>
<script>
var colors = Plotly.d3.scale.category10().range();
var m0y = [ "std::unordered_map", "boost::unordered_map 1_58", "eastl::hash_map", "boost::multi_index::<br>hashed_unique", "phmap::<br>parallel_node_hash_map", "folly::F14NodeMap", "spp::sparse_hash_map", "folly::F14ValueMap", "phmap::<br>parallel_flat_hash_map", "<b>tsl::sparse_map</b>", "phmap::node_hash_map", "<b>ska::bytell_hash_map</b>", "absl::node_hash_map", "tsl::hopscotch_map", "tsl::robin_map", "emilib1::HashMap", "absl::flat_hash_map", "<b>phmap::flat_hash_map</b>", "robin_hood::<br>unordered_node_map", "<b>robin_hood::<br>unordered_flat_map</b>"];
var m1y = [ "std::unordered_map", "boost::unordered_map 1_58", "eastl::hash_map", "boost::multi_index::<br>hashed_unique", "phmap::<br>parallel_node_hash_map", "spp::sparse_hash_map", "folly::F14NodeMap", "folly::F14ValueMap", "phmap::<br>parallel_flat_hash_map", "<b>tsl::sparse_map</b>", "phmap::node_hash_map", "ska::bytell_hash_map", "tsl::robin_map", "tsl::hopscotch_map", "absl::node_hash_map", "emilib1::HashMap", "phmap::flat_hash_map", "absl::flat_hash_map", "robin_hood::<br>unordered_node_map", "<b>robin_hood::<br>unordered_flat_map</b>"];
var m2y = [ "std::unordered_map", "boost::unordered_map 1_58", "eastl::hash_map", "boost::multi_index::<br>hashed_unique", "phmap::<br>parallel_node_hash_map", "spp::sparse_hash_map", "folly::F14NodeMap", "folly::F14ValueMap", "<b>tsl::sparse_map</b>", "<b>phmap::<br>parallel_flat_hash_map</b>", "<b>ska::bytell_hash_map</b>", "phmap::node_hash_map", "tsl::hopscotch_map", "tsl::robin_map", "absl::node_hash_map", "emilib1::HashMap", "<b>phmap::flat_hash_map</b>", "absl::flat_hash_map", "robin_hood::<br>unordered_node_map", "<b>robin_hood::<br>unordered_flat_map</b>"];
var m3y = [ "std::unordered_map", "boost::unordered_map 1_58", "eastl::hash_map", "boost::multi_index::<br>hashed_unique", "phmap::<br>parallel_node_hash_map", "folly::F14NodeMap", "spp::sparse_hash_map", "folly::F14ValueMap", "phmap::<br>parallel_flat_hash_map", "<b>tsl::sparse_map</b>", "absl::node_hash_map", "<b>ska::bytell_hash_map</b>", "tsl::robin_map", "tsl::hopscotch_map", "phmap::node_hash_map", "emilib1::HashMap", "phmap::flat_hash_map", "absl::flat_hash_map", "robin_hood::<br>unordered_node_map", "<b>robin_hood::<br>unordered_flat_map</b>"];
var m4y = [ "std::unordered_map", "boost::unordered_map 1_58", "eastl::hash_map", "boost::multi_index::<br>hashed_unique", "phmap::<br>parallel_node_hash_map", "folly::F14NodeMap", "spp::sparse_hash_map", "folly::F14ValueMap", "phmap::<br>parallel_flat_hash_map", "<b>tsl::sparse_map</b>", "tsl::hopscotch_map", "phmap::node_hash_map", "ska::bytell_hash_map", "tsl::robin_map", "emilib1::HashMap", "absl::node_hash_map", "<b>phmap::flat_hash_map</b>", "absl::flat_hash_map", "robin_hood::<br>unordered_node_map", "<b>robin_hood::<br>unordered_flat_map</b>"];
var measurement_names = [ "Lookup 100m ints, all present", "Lookup 100m ints, few present" ];
var data = [
{ x: [ 6.09273, 5.59661, 4.45374, 3.21348, 3.21045, 4.5991, 3.05524, 4.11665, 3.09899, 2.24369, 2.58126, 1.85537, 2.4263, 1.79238, 1.69386, 1.63569, 2.40407, 2.30709, 2.03579, 1.84841 ],
y: m0y, name: measurement_names[0] + ' (Identity)', type: 'bar', orientation: 'h', yaxis: 'y', marker: { color: colors[0], },
},
{ x: [ 10.2008, 9.1466, 6.37539, 4.5774, 3.99865, 2.13146, 3.32416, 1.86786, 2.3017, 2.32003, 1.25903, 1.83202, 1.17546, 1.78976, 1.83893, 1.58476, 0.780565, 0.84493, 0.862883, 0.647773 ],
y: m0y, name: measurement_names[1] + ' (Identity)', type: 'bar', orientation: 'h', yaxis: 'y', marker: { color: colors[1], },
textposition: 'outside',
text: [ "16.3s<br>30MB", "14.7s<br>34MB", "10.8s<br>30MB", "7.79s<br>34MB", "7.21s<br>40MB", "6.73s<br>39MB", "6.38s<br>3.0MB", "5.98s<br>7.8MB", "5.40s<br>9.7MB", "<b>4.56s<br>1.6MB</b>", "3.84s<br>40MB", "<b>3.69s<br>9.5MB</b>", "3.60s<br>41MB", "3.58s<br>23MB", "3.53s<br>16MB", "3.22s<br>28MB", "3.18s<br>10MB", "<b>3.15s<br>9.6MB</b>", "2.90s<br>18MB", "<b>2.50s<br>9.7MB</b>" ],
},
{ x: [ 6.65363, 5.69525, 4.7806, 3.47087, 3.3872, 3.3091, 4.48918, 4.11998, 2.8847, 2.63458, 2.8573, 2.16055, 2.05412, 2.02524, 2.72429, 1.91438, 2.59933, 2.32844, 2.17994, 1.94799 ],
y: m1y, name: measurement_names[0] + ' (robin_hood::hash)', type: 'bar', orientation: 'h', yaxis: 'y2', marker: { color: colors[0], },
},
{ x: [ 10.9964, 9.38402, 6.89724, 4.71998, 4.10179, 3.44095, 2.25682, 1.94596, 2.33889, 2.58169, 1.34897, 2.02432, 2.12016, 2.11878, 1.24275, 1.94923, 0.824703, 0.849779, 0.891153, 0.703689 ],
y: m1y, name: measurement_names[1] + ' (robin_hood::hash)', type: 'bar', orientation: 'h', yaxis: 'y2', marker: { color: colors[1], },
textposition: 'outside',
text: [ "17.7s<br>30MB", "15.1s<br>34MB", "11.7s<br>30MB", "8.19s<br>34MB", "7.49s<br>40MB", "6.75s<br>3.1MB", "6.75s<br>39MB", "6.07s<br>8.0MB", "5.22s<br>9.6MB", "<b>5.22s<br>1.7MB</b>", "4.21s<br>40MB", "4.18s<br>9.5MB", "4.17s<br>16MB", "4.14s<br>23MB", "3.97s<br>41MB", "3.86s<br>28MB", "3.42s<br>9.7MB", "3.18s<br>9.8MB", "3.07s<br>18MB", "<b>2.65s<br>9.5MB</b>" ],
},
{ x: [ 6.66338, 6.24015, 5.07543, 3.44506, 3.73155, 3.5035, 4.4533, 4.31187, 2.83837, 3.06711, 2.47329, 3.0799, 2.11329, 2.05225, 2.82426, 1.91895, 2.79399, 2.46331, 2.2786, 2.24025 ],
y: m2y, name: measurement_names[0] + ' (absl::Hash)', type: 'bar', orientation: 'h', yaxis: 'y3', marker: { color: colors[0], },
},
{ x: [ 10.722, 9.76758, 6.71071, 4.95828, 4.62927, 3.57077, 2.24758, 2.05518, 2.82352, 2.39904, 2.51172, 1.36964, 2.0896, 2.14932, 1.31154, 2.03569, 0.887126, 0.869671, 0.980009, 0.792403 ],
y: m2y, name: measurement_names[1] + ' (absl::Hash)', type: 'bar', orientation: 'h', yaxis: 'y3', marker: { color: colors[1], },
textposition: 'outside',
text: [ "17.4s<br>30MB", "16.0s<br>34MB", "11.8s<br>30MB", "8.40s<br>34MB", "8.36s<br>40MB", "7.07s<br>3.3MB", "6.70s<br>39MB", "6.37s<br>8.1MB", "<b>5.66s<br>2.0MB</b>", "<b>5.47s<br>9.6MB</b>", "<b>4.99s<br>9.7MB</b>", "4.45s<br>40MB", "4.20s<br>24MB", "4.20s<br>16MB", "4.14s<br>40MB", "3.95s<br>27MB", "<b>3.68s<br>9.7MB</b>", "3.33s<br>10.0MB", "3.26s<br>17MB", "<b>3.03s<br>9.8MB</b>" ],
},
{ x: [ 6.95211, 6.09279, 5.31459, 4.08509, 4.24607, 4.97288, 3.77825, 4.76691, 3.66088, 2.77892, 3.655, 2.56675, 2.43673, 2.40619, 3.29471, 2.14408, 3.10058, 2.8998, 2.6087, 2.47888 ],
y: m3y, name: measurement_names[0] + ' (FNV1a)', type: 'bar', orientation: 'h', yaxis: 'y4', marker: { color: colors[0], },
},
{ x: [ 11.2277, 9.58056, 7.07844, 5.85105, 4.86657, 2.78663, 3.83655, 2.59393, 2.73211, 2.78004, 1.48876, 2.36505, 2.46462, 2.43899, 1.47182, 2.26155, 1.01941, 0.979579, 1.03254, 0.826174 ],
y: m3y, name: measurement_names[1] + ' (FNV1a)', type: 'bar', orientation: 'h', yaxis: 'y4', marker: { color: colors[1], },
textposition: 'outside',
text: [ "18.2s<br>30MB", "15.7s<br>34MB", "12.4s<br>30MB", "9.94s<br>34MB", "9.11s<br>41MB", "7.76s<br>39MB", "7.61s<br>3.1MB", "7.36s<br>8.2MB", "6.39s<br>9.5MB", "<b>5.56s<br>1.9MB</b>", "5.14s<br>41MB", "<b>4.93s<br>9.5MB</b>", "4.90s<br>15MB", "4.85s<br>24MB", "4.77s<br>40MB", "4.41s<br>28MB", "4.12s<br>9.7MB", "3.88s<br>9.8MB", "3.64s<br>18MB", "<b>3.31s<br>9.6MB</b>" ],
},
{ x: [ 7.35645, 6.25722, 5.32267, 3.85399, 4.15846, 4.89069, 3.79757, 4.62627, 3.91166, 3.07408, 2.77335, 3.92735, 2.74664, 2.55085, 2.54922, 3.36016, 3.48198, 3.14594, 2.66844, 2.67578 ],
y: m4y, name: measurement_names[0] + ' (folly::hasher)', type: 'bar', orientation: 'h', yaxis: 'y5', marker: { color: colors[0], },
},
{ x: [ 13.2899, 9.94186, 7.02841, 5.70523, 4.86622, 2.84434, 3.79266, 2.61543, 2.87419, 2.96693, 2.80997, 1.65029, 2.75361, 2.6665, 2.51803, 1.53568, 1.08902, 1.03741, 1.0671, 0.939645 ],
y: m4y, name: measurement_names[1] + ' (folly::hasher)', type: 'bar', orientation: 'h', yaxis: 'y5', marker: { color: colors[1], },
textposition: 'outside',
text: [ "20.6s<br>30MB", "16.2s<br>34MB", "12.4s<br>30MB", "9.56s<br>34MB", "9.02s<br>40MB", "7.74s<br>39MB", "7.59s<br>3.2MB", "7.24s<br>7.9MB", "6.79s<br>9.6MB", "<b>6.04s<br>1.6MB</b>", "5.58s<br>24MB", "5.58s<br>40MB", "5.50s<br>9.6MB", "5.22s<br>16MB", "5.07s<br>28MB", "4.90s<br>41MB", "<b>4.57s<br>9.3MB</b>", "4.18s<br>10.0MB", "3.74s<br>18MB", "<b>3.62s<br>9.8MB</b>" ],
},
];
var layout = {
// title: { text: 'Lookup'},
grid: {
ygap: 0.1,
subplots: [
['xy'],
['xy2'],
['xy3'],
['xy4'],
['xy5'],
] },
barmode: 'stack',
yaxis: { title: 'Identity', automargin: true, },
yaxis2: { title: 'robin_hood::hash', automargin: true, },
yaxis3: { title: 'absl::Hash', automargin: true, },
yaxis4: { title: 'FNV1a', automargin: true, },
yaxis5: { title: 'folly::hasher', automargin: true, },
xaxis: { automargin: true, },
legend: { traceorder: 'normal' },
margin: { pad: 0, l:0, r:0, t:0, b:0, },
showlegend:false,
};
Plotly.newPlot('id_ceec23e8', data, layout);
</script>
</body></html>

View File

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<h2>Benchmark Results</h2>
<a href="InsertManyInt.html">insert 100m values in map<int, int></a> <p>
<a href="Lookup.html">Lookup 100m ints, all present | Lookup 100m ints, few present</a> <p>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,302 +0,0 @@
/***
colors.css v2.0.0
http://clrs.cc
@mrmrs
MIT License
***/
/*
SKINS
- Backgrounds
- Colors
- Border colors
- SVG fills
- SVG Strokes
*/
/* Backgrounds */
.bg-navy {
background-color: #001F3F; }
.bg-blue {
background-color: #0074D9; }
.bg-aqua {
background-color: #7FDBFF; }
.bg-teal {
background-color: #39CCCC; }
.bg-olive {
background-color: #3D9970; }
.bg-green {
background-color: #2ECC40; }
.bg-lime {
background-color: #01FF70; }
.bg-yellow {
background-color: #FFDC00; }
.bg-orange {
background-color: #FF851B; }
.bg-red {
background-color: #FF4136; }
.bg-fuchsia {
background-color: #F012BE; }
.bg-purple {
background-color: #B10DC9; }
.bg-maroon {
background-color: #85144B; }
.bg-white {
background-color: #fff; }
.bg-gray {
background-color: #aaa; }
.bg-silver {
background-color: #ddd; }
.bg-black {
background-color: #111; }
/* Colors */
.navy {
color: #001F3F; }
.blue {
color: #0074D9; }
.aqua {
color: #7FDBFF; }
.teal {
color: #39CCCC; }
.olive {
color: #3D9970; }
.green {
color: #2ECC40; }
.lime {
color: #01FF70; }
.yellow {
color: #FFDC00; }
.orange {
color: #FF851B; }
.red {
color: #FF4136; }
.fuchsia {
color: #F012BE; }
.purple {
color: #B10DC9; }
.maroon {
color: #85144B; }
.white {
color: #fff; }
.silver {
color: #ddd; }
.gray {
color: #aaa; }
.black {
color: #111; }
/* Border colors
Use with another border utility that sets border-width and style
i.e .border { border-width: 1px; border-style: solid; }
*/
.border--navy {
border-color: #001F3F; }
.border--blue {
border-color: #0074D9; }
.border--aqua {
border-color: #7FDBFF; }
.border--teal {
border-color: #39CCCC; }
.border--olive {
border-color: #3D9970; }
.border--green {
border-color: #2ECC40; }
.border--lime {
border-color: #01FF70; }
.border--yellow {
border-color: #FFDC00; }
.border--orange {
border-color: #FF851B; }
.border--red {
border-color: #FF4136; }
.border--fuchsia {
border-color: #F012BE; }
.border--purple {
border-color: #B10DC9; }
.border--maroon {
border-color: #85144B; }
.border--white {
border-color: #fff; }
.border--gray {
border-color: #aaa; }
.border--silver {
border-color: #ddd; }
.border--black {
border-color: #111; }
/* Fills for SVG */
.fill-navy {
fill: #001F3F; }
.fill-blue {
fill: #0074D9; }
.fill-aqua {
fill: #7FDBFF; }
.fill-teal {
fill: #39CCCC; }
.fill-olive {
fill: #3D9970; }
.fill-green {
fill: #2ECC40; }
.fill-lime {
fill: #01FF70; }
.fill-yellow {
fill: #FFDC00; }
.fill-orange {
fill: #FF851B; }
.fill-red {
fill: #FF4136; }
.fill-fuchsia {
fill: #F012BE; }
.fill-purple {
fill: #B10DC9; }
.fill-maroon {
fill: #85144B; }
.fill-white {
fill: #fff; }
.fill-gray {
fill: #aaa; }
.fill-silver {
fill: #ddd; }
.fill-black {
fill: #111; }
/* Strokes for SVG */
.stroke-navy {
stroke: #001F3F; }
.stroke-blue {
stroke: #0074D9; }
.stroke-aqua {
stroke: #7FDBFF; }
.stroke-teal {
stroke: #39CCCC; }
.stroke-olive {
stroke: #3D9970; }
.stroke-green {
stroke: #2ECC40; }
.stroke-lime {
stroke: #01FF70; }
.stroke-yellow {
stroke: #FFDC00; }
.stroke-orange {
stroke: #FF851B; }
.stroke-red {
stroke: #FF4136; }
.stroke-fuchsia {
stroke: #F012BE; }
.stroke-purple {
stroke: #B10DC9; }
.stroke-maroon {
stroke: #85144B; }
.stroke-white {
stroke: #fff; }
.stroke-gray {
stroke: #aaa; }
.stroke-silver {
stroke: #ddd; }
.stroke-black {
stroke: #111; }
/* PRETTIER LINKS */
a {
text-decoration: none;
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }
a:link {
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }
a:visited { }
a:hover {
color: #001F3F;
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }
a:active {
-webkit-transition: color .3s ease-in-out;
transition: color .3s ease-in-out; }

View File

@ -1,271 +0,0 @@
/* main stylesheet */
@import url(http://fonts.googleapis.com/css?family=Signika);
html {
overflow-y: scroll;
}
body {
font-size: 15px;
font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #332;
}
h1, h2, h3, h4, h5 {
color: #332;
font-family: "Signika";
font-weight: 400;
font-size: 1.4em;
line-height: 1.1;
margin-top: 30px;
}
pre code {
font: 14px/19px Inconsolata, Monaco,"Lucida Console",Terminal,"Courier New",Courier;
}
.figure {
text-align: center;
}
.small .figure img {
height: 200px;
}
.pagetitle .figure {
text-align: left !important;
}
.pagetitle .figure img {
height: 36px;
}
table{
background:#fff;
border:1px solid #ccc;
border-width:2px;
border-collapse:collapse;
margin:5px 0 10px;
margin-top: 20px;
margin-bottom: 20px;
}
th, td{
border:1px solid #ccc;
padding:3px 10px;
text-align:left;
vertical-align:top;
}
tr.even td{
background:#f7f7f7;
}
th{
background:#edeff0;
}
td code {
border: 0px;
}
img {
max-width: 100%;
height: auto;
}
hr {
border: 0px;
height: 0;
border-bottom: 1px solid #ccc;
margin-bottom: 100px;
}
/* Logo */
.logo {
text-align: center;
}
.tagline {
font-family: Georgia;
font-size: 18px;
font-style: italic;
line-height: 1.45;
color: #383838;
}
.author {
}
.halfbreak {
padding-bottom: 100px;
}
.break {
padding-bottom: 200px;
}
/* TOC Links */
a {
color: #111111;
text-decoration: none;
}
.body li a {
text-decoration: underline;
}
/* Math */
.MathJax_Display {
padding-top: 20px;
padding-bottom: 20px;
}
/* Body Links */
p a {
text-decoration: underline;
}
li code, p code {
font-size: 12px;
border: 1px solid #ccc;
margin-left: 3px;
margin-right: 3px;
padding-left: 2px;
padding-right: 2px;
}
/* */
.center {
text-align: center;
}
.bigger img {
width: 120%;
height: 120%;
}
pre {
font-size: 0.9em;
margin-bottom: 18px;
margin-top: 18px;
border-left: 1px solid #ccc;
}
h1 {
margin-top: 0px;
}
.annotation {
font-size: 10pt;
}
.annotation pre {
display: block;
margin: 0;
padding: 7px 10px;
overflow-x: auto;
}
.annotation.span2 {
/* Override bootstrap */
margin-left: 0px !important;
margin-top: 18px !important;
}
.annotation pre code {
border: 0;
padding: 0;
background: transparent;
}
blockquote {
border-left: 1px solid #ccc;
font-family: Georgia, serif;
font-size: 14px;
font-style: italic;
margin: 0.25em 0;
padding-left: 10px;
line-height: 1.45;
color: #383838;
left: 20px;
}
blockquote cite {
color: #999999;
font-size: 14px;
display: block;
margin-top: 5px;
}
ul.sections {
list-style: none;
padding:0 0 5px 0;
margin:0;
}
code.sourceCode {
padding: 0;
background: inherit;
}
pre.sourceCode {
padding: 10px;
}
ul.sections > li > div {
-moz-box-sizing: border-box; /* firefox */
-ms-box-sizing: border-box; /* ie */
-webkit-box-sizing: border-box; /* webkit */
-khtml-box-sizing: border-box; /* konqueror */
box-sizing: border-box; /* css3 */
}
/* Make the naviation centered and larger on small screens */
/*---------------------- (> 481px) ---------------------*/
@media only screen and (max-width: 481px) {
}
@media only screen and (min-width: 1025px) {
body {
padding: 10px;
}
.side {
position: fixed;
width: 120px !important;
margin-left: 0px;
z-index: 1000;
}
.side ul ul {
display: none;
}
.side ul ul.active {
display: block;
}
.side .active {
font-weight: bold;
}
.body {
margin-left: 120px !important;
}
}

View File

@ -1,28 +0,0 @@
+----------------+
|"(keyi, valuei)"| "(key, value) pairs are stored directly"
+----+-----------+ "into the array (no pointers)"
| +--------+---------------------+
| | | |
| | | |
| | | |
| | | |
| | | |
| +--------+---------------------+
+---------------> | keyi | valuei |
hasher(keyi) +--------+---------------------+
| | |
| | |
| | |
+--------+---------------------+
| | |
+--------+---------------------+
| | |
| | |
| | |
+--------+---------------------+
absl::flat_hash_map

View File

@ -1,133 +0,0 @@
<svg class="bob" font-family="arial" font-size="14" height="448" width="560" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="triangle" markerHeight="8" markerWidth="8" orient="auto" refX="4" refY="2" viewBox="0 0 8 4">
<polygon fill="black" points="0,0 0,4 8,2 0,0"/>
</marker>
<marker id="clear_triangle" markerHeight="10" markerWidth="10" orient="auto" refX="1" refY="7" viewBox="0 0 20 14">
<polygon fill="none" points="2,2 2,12 18,7 2,2" stroke="black" stroke-width="2"/>
</marker>
<marker id="circle" markerHeight="5" markerWidth="5" orient="auto" refX="10" refY="10" viewBox="0 0 20 20">
<circle cx="10" cy="10" fill="black" r="8"/>
</marker>
<marker id="square" markerHeight="5" markerWidth="5" orient="auto" refX="10" refY="10" viewBox="0 0 20 20">
<rect fill="black" height="20" width="20" x="0" y="0"/>
</marker>
<marker id="open_circle" markerHeight="10" markerWidth="10" orient="auto" refX="10" refY="10" viewBox="0 0 20 20">
<circle cx="10" cy="10" fill="white" r="4" stroke="black" stroke-width="2"/>
</marker>
<marker id="big_open_circle" markerHeight="20" markerWidth="20" orient="auto" refX="20" refY="20" viewBox="0 0 40 40">
<circle cx="20" cy="20" fill="white" r="6" stroke="black" stroke-width="2"/>
</marker>
</defs>
<style type="text/css">
line,path {
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
line.dashed {
stroke-dasharray: 5;
}
circle.solid {
fill:black;
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
circle.open {
fill:none;
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
tspan.head{
fill: none;
stroke: none;
}
</style>
<rect fill="white" height="448" width="560" x="0" y="0"/>
<g>
<line x1="52" x2="52" y1="56" y2="88"/>
<line x1="52" x2="188" y1="56" y2="56"/>
<line x1="52" x2="92" y1="88" y2="88"/>
<line x1="92" x2="92" y1="88" y2="216"/>
<line x1="92" x2="188" y1="88" y2="88"/>
<line marker-end="url(#triangle)" x1="92" x2="220" y1="216" y2="216"/>
<line x1="188" x2="188" y1="56" y2="88"/>
</g>
<g>
<line x1="236" x2="236" y1="104" y2="200"/>
<line x1="236" x2="308" y1="104" y2="104"/>
<line x1="236" x2="236" y1="200" y2="232"/>
<line x1="236" x2="308" y1="200" y2="200"/>
<line x1="236" x2="236" y1="232" y2="296"/>
<line x1="236" x2="308" y1="232" y2="232"/>
<line x1="236" x2="236" y1="296" y2="328"/>
<line x1="236" x2="308" y1="296" y2="296"/>
<line x1="236" x2="236" y1="328" y2="392"/>
<line x1="236" x2="308" y1="328" y2="328"/>
<line x1="236" x2="308" y1="392" y2="392"/>
<line x1="308" x2="308" y1="104" y2="200"/>
<line x1="308" x2="484" y1="104" y2="104"/>
<line x1="308" x2="308" y1="200" y2="232"/>
<line x1="308" x2="484" y1="200" y2="200"/>
<line x1="308" x2="308" y1="232" y2="296"/>
<line x1="308" x2="484" y1="232" y2="232"/>
<line x1="308" x2="308" y1="296" y2="328"/>
<line x1="308" x2="484" y1="296" y2="296"/>
<line x1="308" x2="308" y1="328" y2="392"/>
<line x1="308" x2="484" y1="328" y2="328"/>
<line x1="308" x2="484" y1="392" y2="392"/>
<line x1="484" x2="484" y1="104" y2="200"/>
<line x1="484" x2="484" y1="200" y2="232"/>
<line x1="484" x2="484" y1="232" y2="296"/>
<line x1="484" x2="484" y1="296" y2="328"/>
<line x1="484" x2="484" y1="328" y2="392"/>
</g>
<g>
<text x="57" y="76">
(keyi, valuei)
</text>
</g>
<g>
<text x="97" y="236">
hasher(keyi)
</text>
</g>
<g>
<text x="193" y="428">
absl::flat_hash_map
</text>
</g>
<g>
<text x="241" y="76">
(key, value) pairs are stored directly
</text>
</g>
<g>
<text x="241" y="92">
into the array (no pointers)
</text>
</g>
<g>
<text x="249" y="220">
keyi
</text>
</g>
<g>
<text x="321" y="220">
valuei
</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -1,29 +0,0 @@
+----------------+
|"(keyi, valuei)"|
+------+---------+
|
| hasher(keyi) "Parallel Hash Map"
v "(with 8 submaps)"
+--------+-------------+ +----------------+
| h=0x7d84ea13707f4657 | | submap0 |
+---------+------------+ +----------------+
| | submap1 |
| "(h ^ (h >> 3)) & 0x7" +----------------+
v | submap2 |
+----+----+ +----------------+
|"idx = 5"| | submap3 |
+----+----+ +----------------+
| | submap4 |
| +----------------+
+------------------------------->| submap5 |
+----------------+
| submap6 |
+----------------+
| submap7 |
+----------------+
"parallel_hash_map with 8 submaps, each submap is an absl::flat_hash_map"

View File

@ -1,196 +0,0 @@
<svg class="bob" font-family="arial" font-size="14" height="464" width="640" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="triangle" markerHeight="8" markerWidth="8" orient="auto" refX="4" refY="2" viewBox="0 0 8 4">
<polygon fill="black" points="0,0 0,4 8,2 0,0"/>
</marker>
<marker id="clear_triangle" markerHeight="10" markerWidth="10" orient="auto" refX="1" refY="7" viewBox="0 0 20 14">
<polygon fill="none" points="2,2 2,12 18,7 2,2" stroke="black" stroke-width="2"/>
</marker>
<marker id="circle" markerHeight="5" markerWidth="5" orient="auto" refX="10" refY="10" viewBox="0 0 20 20">
<circle cx="10" cy="10" fill="black" r="8"/>
</marker>
<marker id="square" markerHeight="5" markerWidth="5" orient="auto" refX="10" refY="10" viewBox="0 0 20 20">
<rect fill="black" height="20" width="20" x="0" y="0"/>
</marker>
<marker id="open_circle" markerHeight="10" markerWidth="10" orient="auto" refX="10" refY="10" viewBox="0 0 20 20">
<circle cx="10" cy="10" fill="white" r="4" stroke="black" stroke-width="2"/>
</marker>
<marker id="big_open_circle" markerHeight="20" markerWidth="20" orient="auto" refX="20" refY="20" viewBox="0 0 40 40">
<circle cx="20" cy="20" fill="white" r="6" stroke="black" stroke-width="2"/>
</marker>
</defs>
<style type="text/css">
line,path {
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
line.dashed {
stroke-dasharray: 5;
}
circle.solid {
fill:black;
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
circle.open {
fill:none;
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
tspan.head{
fill: none;
stroke: none;
}
</style>
<rect fill="white" height="464" width="640" x="0" y="0"/>
<g>
<line x1="52" x2="52" y1="152" y2="184"/>
<line x1="52" x2="124" y1="152" y2="152"/>
<line x1="52" x2="132" y1="184" y2="184"/>
<line x1="124" x2="236" y1="152" y2="152"/>
<line marker-end="url(#triangle)" x1="132" x2="132" y1="184" y2="236"/>
<line x1="132" x2="236" y1="184" y2="184"/>
<line x1="236" x2="236" y1="152" y2="184"/>
</g>
<g>
<line x1="68" x2="68" y1="56" y2="88"/>
<line x1="68" x2="204" y1="56" y2="56"/>
<line x1="68" x2="124" y1="88" y2="88"/>
<line x1="124" x2="204" y1="88" y2="88"/>
<line x1="204" x2="204" y1="56" y2="88"/>
</g>
<g>
<line x1="92" x2="92" y1="248" y2="280"/>
<line x1="92" x2="132" y1="248" y2="248"/>
<line x1="92" x2="132" y1="280" y2="280"/>
<line x1="132" x2="172" y1="248" y2="248"/>
<line x1="132" x2="132" y1="280" y2="328"/>
<line x1="132" x2="172" y1="280" y2="280"/>
<line marker-end="url(#triangle)" x1="132" x2="388" y1="328" y2="328"/>
<line x1="172" x2="172" y1="248" y2="280"/>
</g>
<g>
<line marker-end="url(#triangle)" x1="132" x2="132" y1="96" y2="140"/>
</g>
<g>
<line x1="396" x2="396" y1="152" y2="184"/>
<line x1="396" x2="532" y1="152" y2="152"/>
<line x1="396" x2="396" y1="184" y2="216"/>
<line x1="396" x2="532" y1="184" y2="184"/>
<line x1="396" x2="396" y1="216" y2="248"/>
<line x1="396" x2="532" y1="216" y2="216"/>
<line x1="396" x2="396" y1="248" y2="280"/>
<line x1="396" x2="532" y1="248" y2="248"/>
<line x1="396" x2="396" y1="280" y2="312"/>
<line x1="396" x2="532" y1="280" y2="280"/>
<line x1="396" x2="396" y1="312" y2="344"/>
<line x1="396" x2="532" y1="312" y2="312"/>
<line x1="396" x2="396" y1="344" y2="376"/>
<line x1="396" x2="532" y1="344" y2="344"/>
<line x1="396" x2="396" y1="376" y2="408"/>
<line x1="396" x2="532" y1="376" y2="376"/>
<line x1="396" x2="532" y1="408" y2="408"/>
<line x1="532" x2="532" y1="152" y2="184"/>
<line x1="532" x2="532" y1="184" y2="216"/>
<line x1="532" x2="532" y1="216" y2="248"/>
<line x1="532" x2="532" y1="248" y2="280"/>
<line x1="532" x2="532" y1="280" y2="312"/>
<line x1="532" x2="532" y1="312" y2="344"/>
<line x1="532" x2="532" y1="344" y2="376"/>
<line x1="532" x2="532" y1="376" y2="408"/>
</g>
<g>
<text x="57" y="444">
parallel_hash_map with 8 submaps, each submap is an absl::flat_hash_map
</text>
</g>
<g>
<text x="65" y="172">
h=0x7d84ea13707f4657
</text>
</g>
<g>
<text x="73" y="76">
(keyi, valuei)
</text>
</g>
<g>
<text x="97" y="268">
idx = 5
</text>
</g>
<g>
<text x="145" y="220">
(h ^ (h &gt;&gt; 3)) &amp; 0x7
</text>
</g>
<g>
<text x="153" y="124">
hasher(keyi)
</text>
</g>
<g>
<text x="401" y="124">
Parallel Hash Map
</text>
</g>
<g>
<text x="401" y="140">
(with 8 submaps)
</text>
</g>
<g>
<text x="417" y="172">
submap0
</text>
</g>
<g>
<text x="417" y="204">
submap1
</text>
</g>
<g>
<text x="417" y="236">
submap2
</text>
</g>
<g>
<text x="417" y="268">
submap3
</text>
</g>
<g>
<text x="417" y="300">
submap4
</text>
</g>
<g>
<text x="417" y="332">
submap5
</text>
</g>
<g>
<text x="417" y="364">
submap6
</text>
</g>
<g>
<text x="417" y="396">
submap7
</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Some files were not shown because too many files have changed in this diff Show More