koffi 2.3.6-beta.6 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/cnoke/cnoke.js +3 -7
- package/src/cnoke/src/builder.js +9 -6
- package/src/cnoke/src/index.js +2 -2
- package/src/koffi/build/2.3.7/koffi_darwin_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_darwin_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_freebsd_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_freebsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_freebsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_arm32hf/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_linux_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_openbsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_openbsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_win32_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_win32_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.7/koffi_win32_x64/koffi.node +0 -0
- package/src/koffi/src/ffi.cc +2 -2
- package/src/koffi/src/index.d.ts +2 -2
- package/src/koffi/src/index.js +1 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_darwin_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_darwin_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_arm32hf/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_linux_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_openbsd_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_openbsd_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_arm64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_arm64/koffi.pdb +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_ia32/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_ia32/koffi.pdb +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_x64/koffi.node +0 -0
- package/src/koffi/build/2.3.6-beta.6/koffi_win32_x64/koffi.pdb +0 -0
- package/vendor/brotli/BUILD +0 -144
- package/vendor/brotli/CMakeLists.txt +0 -421
- package/vendor/brotli/CONTRIBUTING.md +0 -27
- package/vendor/brotli/LICENSE +0 -19
- package/vendor/brotli/MANIFEST.in +0 -17
- package/vendor/brotli/Makefile +0 -55
- package/vendor/brotli/Makefile.am +0 -38
- package/vendor/brotli/README +0 -15
- package/vendor/brotli/README.md +0 -104
- package/vendor/brotli/WORKSPACE +0 -21
- package/vendor/brotli/bootstrap +0 -35
- package/vendor/brotli/c/common/constants.c +0 -15
- package/vendor/brotli/c/common/constants.h +0 -200
- package/vendor/brotli/c/common/context.c +0 -156
- package/vendor/brotli/c/common/context.h +0 -113
- package/vendor/brotli/c/common/dictionary.c +0 -5914
- package/vendor/brotli/c/common/dictionary.h +0 -64
- package/vendor/brotli/c/common/platform.c +0 -22
- package/vendor/brotli/c/common/platform.h +0 -596
- package/vendor/brotli/c/common/transform.c +0 -291
- package/vendor/brotli/c/common/transform.h +0 -85
- package/vendor/brotli/c/common/version.h +0 -26
- package/vendor/brotli/c/dec/bit_reader.c +0 -76
- package/vendor/brotli/c/dec/bit_reader.h +0 -351
- package/vendor/brotli/c/dec/decode.c +0 -2608
- package/vendor/brotli/c/dec/huffman.c +0 -339
- package/vendor/brotli/c/dec/huffman.h +0 -121
- package/vendor/brotli/c/dec/prefix.h +0 -732
- package/vendor/brotli/c/dec/state.c +0 -159
- package/vendor/brotli/c/dec/state.h +0 -365
- package/vendor/brotli/c/enc/backward_references.c +0 -145
- package/vendor/brotli/c/enc/backward_references.h +0 -39
- package/vendor/brotli/c/enc/backward_references_hq.c +0 -843
- package/vendor/brotli/c/enc/backward_references_hq.h +0 -95
- package/vendor/brotli/c/enc/backward_references_inc.h +0 -163
- package/vendor/brotli/c/enc/bit_cost.c +0 -35
- package/vendor/brotli/c/enc/bit_cost.h +0 -63
- package/vendor/brotli/c/enc/bit_cost_inc.h +0 -127
- package/vendor/brotli/c/enc/block_encoder_inc.h +0 -34
- package/vendor/brotli/c/enc/block_splitter.c +0 -194
- package/vendor/brotli/c/enc/block_splitter.h +0 -51
- package/vendor/brotli/c/enc/block_splitter_inc.h +0 -440
- package/vendor/brotli/c/enc/brotli_bit_stream.c +0 -1314
- package/vendor/brotli/c/enc/brotli_bit_stream.h +0 -84
- package/vendor/brotli/c/enc/cluster.c +0 -56
- package/vendor/brotli/c/enc/cluster.h +0 -48
- package/vendor/brotli/c/enc/cluster_inc.h +0 -320
- package/vendor/brotli/c/enc/command.c +0 -28
- package/vendor/brotli/c/enc/command.h +0 -190
- package/vendor/brotli/c/enc/compress_fragment.c +0 -790
- package/vendor/brotli/c/enc/compress_fragment.h +0 -61
- package/vendor/brotli/c/enc/compress_fragment_two_pass.c +0 -645
- package/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -54
- package/vendor/brotli/c/enc/dictionary_hash.c +0 -1846
- package/vendor/brotli/c/enc/dictionary_hash.h +0 -25
- package/vendor/brotli/c/enc/encode.c +0 -1927
- package/vendor/brotli/c/enc/encoder_dict.c +0 -33
- package/vendor/brotli/c/enc/encoder_dict.h +0 -43
- package/vendor/brotli/c/enc/entropy_encode.c +0 -503
- package/vendor/brotli/c/enc/entropy_encode.h +0 -122
- package/vendor/brotli/c/enc/entropy_encode_static.h +0 -539
- package/vendor/brotli/c/enc/fast_log.c +0 -105
- package/vendor/brotli/c/enc/fast_log.h +0 -66
- package/vendor/brotli/c/enc/find_match_length.h +0 -79
- package/vendor/brotli/c/enc/hash.h +0 -488
- package/vendor/brotli/c/enc/hash_composite_inc.h +0 -125
- package/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +0 -293
- package/vendor/brotli/c/enc/hash_longest_match64_inc.h +0 -267
- package/vendor/brotli/c/enc/hash_longest_match_inc.h +0 -262
- package/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +0 -266
- package/vendor/brotli/c/enc/hash_rolling_inc.h +0 -212
- package/vendor/brotli/c/enc/hash_to_binary_tree_inc.h +0 -329
- package/vendor/brotli/c/enc/histogram.c +0 -100
- package/vendor/brotli/c/enc/histogram.h +0 -63
- package/vendor/brotli/c/enc/histogram_inc.h +0 -51
- package/vendor/brotli/c/enc/literal_cost.c +0 -175
- package/vendor/brotli/c/enc/literal_cost.h +0 -30
- package/vendor/brotli/c/enc/memory.c +0 -170
- package/vendor/brotli/c/enc/memory.h +0 -114
- package/vendor/brotli/c/enc/metablock.c +0 -663
- package/vendor/brotli/c/enc/metablock.h +0 -105
- package/vendor/brotli/c/enc/metablock_inc.h +0 -183
- package/vendor/brotli/c/enc/params.h +0 -46
- package/vendor/brotli/c/enc/prefix.h +0 -53
- package/vendor/brotli/c/enc/quality.h +0 -165
- package/vendor/brotli/c/enc/ringbuffer.h +0 -167
- package/vendor/brotli/c/enc/static_dict.c +0 -486
- package/vendor/brotli/c/enc/static_dict.h +0 -40
- package/vendor/brotli/c/enc/static_dict_lut.h +0 -5864
- package/vendor/brotli/c/enc/utf8_util.c +0 -85
- package/vendor/brotli/c/enc/utf8_util.h +0 -32
- package/vendor/brotli/c/enc/write_bits.h +0 -87
- package/vendor/brotli/c/include/brotli/decode.h +0 -344
- package/vendor/brotli/c/include/brotli/encode.h +0 -448
- package/vendor/brotli/c/include/brotli/port.h +0 -288
- package/vendor/brotli/c/include/brotli/types.h +0 -83
- package/vendor/brotli/c/tools/brotli.c +0 -1116
- package/vendor/brotli/c/tools/brotli.md +0 -107
- package/vendor/brotli/compiler_config_setting.bzl +0 -28
- package/vendor/brotli/configure +0 -8
- package/vendor/brotli/configure-cmake +0 -318
- package/vendor/brotli/configure.ac +0 -14
- package/vendor/brotli/docs/brotli.1 +0 -132
- package/vendor/brotli/docs/constants.h.3 +0 -47
- package/vendor/brotli/docs/decode.h.3 +0 -415
- package/vendor/brotli/docs/encode.h.3 +0 -586
- package/vendor/brotli/docs/types.h.3 +0 -117
- package/vendor/brotli/premake5.lua +0 -78
- package/vendor/brotli/python/Makefile +0 -57
- package/vendor/brotli/python/README.md +0 -54
- package/vendor/brotli/python/_brotli.cc +0 -753
- package/vendor/brotli/python/bro.py +0 -160
- package/vendor/brotli/python/brotli.py +0 -56
- package/vendor/brotli/python/tests/__init__.py +0 -0
- package/vendor/brotli/python/tests/_test_utils.py +0 -112
- package/vendor/brotli/python/tests/bro_test.py +0 -102
- package/vendor/brotli/python/tests/compress_test.py +0 -41
- package/vendor/brotli/python/tests/compressor_test.py +0 -94
- package/vendor/brotli/python/tests/decompress_test.py +0 -42
- package/vendor/brotli/python/tests/decompressor_test.py +0 -59
- package/vendor/brotli/scripts/libbrotlicommon.pc.in +0 -11
- package/vendor/brotli/scripts/libbrotlidec.pc.in +0 -12
- package/vendor/brotli/scripts/libbrotlienc.pc.in +0 -12
- package/vendor/brotli/scripts/sources.lst +0 -104
- package/vendor/brotli/setup.cfg +0 -5
- package/vendor/brotli/setup.py +0 -293
- package/vendor/brotli/tests/Makefile +0 -17
- package/vendor/brotli/tests/compatibility_test.sh +0 -25
- package/vendor/brotli/tests/roundtrip_test.sh +0 -36
- package/vendor/brotli/tests/run-compatibility-test.cmake +0 -31
- package/vendor/brotli/tests/run-roundtrip-test.cmake +0 -36
- package/vendor/brotli/tests/testdata/empty +0 -0
- package/vendor/brotli/tests/testdata/empty.compressed +0 -1
- package/vendor/brotli/tests/testdata/ukkonooa +0 -1
- package/vendor/brotli/tests/testdata/ukkonooa.compressed +0 -0
- package/vendor/dragonbox/CMakeLists.txt +0 -123
- package/vendor/dragonbox/LICENSE-Apache2-LLVM +0 -218
- package/vendor/dragonbox/LICENSE-Boost +0 -23
- package/vendor/dragonbox/README.md +0 -277
- package/vendor/dragonbox/cmake/dragonboxConfig.cmake +0 -1
- package/vendor/dragonbox/include/dragonbox/dragonbox.h +0 -2674
- package/vendor/dragonbox/include/dragonbox/dragonbox_to_chars.h +0 -108
- package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
- package/vendor/dragonbox/other_files/Dragonbox_old.pdf +0 -0
- package/vendor/dragonbox/other_files/milo_benchmark.png +0 -0
- package/vendor/dragonbox/other_files/unknown_win64_vc2019.html +0 -540
- package/vendor/dragonbox/other_files/unknown_win64_vc2019_randomdigit_time.png +0 -0
- package/vendor/dragonbox/source/dragonbox_to_chars.cpp +0 -303
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/CMakeLists.txt +0 -24
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.cpp +0 -238
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.h +0 -95
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/grisu_exact.h +0 -2666
- package/vendor/dragonbox/subproject/3rdparty/ryu/CMakeLists.txt +0 -16
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/common.h +0 -114
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s.c +0 -509
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_full_table.h +0 -367
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_intrinsics.h +0 -357
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/digit_table.h +0 -35
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s.c +0 -345
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_full_table.h +0 -55
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_intrinsics.h +0 -128
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/ryu.h +0 -46
- package/vendor/dragonbox/subproject/3rdparty/schubfach/CMakeLists.txt +0 -22
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.cc +0 -699
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.h +0 -31
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.cc +0 -1354
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.h +0 -31
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/example_shaded_plots.m +0 -68
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/license.txt +0 -25
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution.m +0 -92
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution_prctile.m +0 -121
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_histogram_shaded.m +0 -99
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_shaded.m +0 -93
- package/vendor/dragonbox/subproject/benchmark/CMakeLists.txt +0 -65
- package/vendor/dragonbox/subproject/benchmark/include/benchmark.h +0 -40
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_benchmarks.m +0 -22
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_digit_benchmark.m +0 -78
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_uniform_benchmark.m +0 -95
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/source/benchmark.cpp +0 -238
- package/vendor/dragonbox/subproject/benchmark/source/dragonbox.cpp +0 -30
- package/vendor/dragonbox/subproject/benchmark/source/grisu_exact.cpp +0 -36
- package/vendor/dragonbox/subproject/benchmark/source/ryu.cpp +0 -27
- package/vendor/dragonbox/subproject/benchmark/source/schubfach.cpp +0 -31
- package/vendor/dragonbox/subproject/common/CMakeLists.txt +0 -42
- package/vendor/dragonbox/subproject/common/include/best_rational_approx.h +0 -97
- package/vendor/dragonbox/subproject/common/include/big_uint.h +0 -218
- package/vendor/dragonbox/subproject/common/include/continued_fractions.h +0 -174
- package/vendor/dragonbox/subproject/common/include/good_rational_approx.h +0 -267
- package/vendor/dragonbox/subproject/common/include/random_float.h +0 -182
- package/vendor/dragonbox/subproject/common/include/rational_continued_fractions.h +0 -57
- package/vendor/dragonbox/subproject/common/source/big_uint.cpp +0 -602
- package/vendor/dragonbox/subproject/meta/CMakeLists.txt +0 -41
- package/vendor/dragonbox/subproject/meta/results/binary32_generated_cache.txt +0 -82
- package/vendor/dragonbox/subproject/meta/results/binary64_compressed_cache_error_table.txt +0 -10
- package/vendor/dragonbox/subproject/meta/results/binary64_generated_cache.txt +0 -623
- package/vendor/dragonbox/subproject/meta/source/generate_cache.cpp +0 -126
- package/vendor/dragonbox/subproject/meta/source/live_test.cpp +0 -81
- package/vendor/dragonbox/subproject/meta/source/perf_test.cpp +0 -104
- package/vendor/dragonbox/subproject/meta/source/sandbox.cpp +0 -20
- package/vendor/dragonbox/subproject/test/CMakeLists.txt +0 -70
- package/vendor/dragonbox/subproject/test/results/binary32.csv +0 -255
- package/vendor/dragonbox/subproject/test/results/binary64.csv +0 -2047
- package/vendor/dragonbox/subproject/test/results/plot_required_bits.m +0 -18
- package/vendor/dragonbox/subproject/test/source/test_all_shorter_interval_cases.cpp +0 -88
- package/vendor/dragonbox/subproject/test/source/uniform_random_test.cpp +0 -95
- package/vendor/dragonbox/subproject/test/source/verify_cache_precision.cpp +0 -338
- package/vendor/dragonbox/subproject/test/source/verify_compressed_cache.cpp +0 -154
- package/vendor/dragonbox/subproject/test/source/verify_fast_multiplication.cpp +0 -168
- package/vendor/dragonbox/subproject/test/source/verify_log_computation.cpp +0 -251
- package/vendor/dragonbox/subproject/test/source/verify_magic_division.cpp +0 -113
- package/vendor/miniz/ChangeLog.md +0 -239
- package/vendor/miniz/LICENSE +0 -22
- package/vendor/miniz/examples/example1.c +0 -105
- package/vendor/miniz/examples/example2.c +0 -164
- package/vendor/miniz/examples/example3.c +0 -269
- package/vendor/miniz/examples/example4.c +0 -102
- package/vendor/miniz/examples/example5.c +0 -327
- package/vendor/miniz/examples/example6.c +0 -166
- package/vendor/miniz/miniz.c +0 -7835
- package/vendor/miniz/miniz.h +0 -1422
- package/vendor/miniz/readme.md +0 -46
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_arm64/koffi.exp +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_arm64/koffi.lib +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_ia32/koffi.exp +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_ia32/koffi.lib +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_x64/koffi.exp +0 -0
- /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_x64/koffi.lib +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
% Copyright 2020-2021 Junekey Jeon
|
|
2
|
-
%
|
|
3
|
-
% The contents of this file may be used under the terms of
|
|
4
|
-
% the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
%
|
|
6
|
-
% (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
% https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
%
|
|
9
|
-
% Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
% the Boost Software License, Version 1.0.
|
|
11
|
-
% (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
% https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
%
|
|
14
|
-
% Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
% is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
% KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
function [avg] = plot_digit_benchmark( filename )
|
|
19
|
-
|
|
20
|
-
output_filename = replace(filename, '.csv', '.pdf');
|
|
21
|
-
|
|
22
|
-
samples_per_digits = csvread(filename,0,1,[0 1 0 1]);
|
|
23
|
-
table = readtable(filename);
|
|
24
|
-
max_digits = table{size(table,1),2};
|
|
25
|
-
number_of_algorithms = size(table,1) / samples_per_digits / max_digits;
|
|
26
|
-
names = string(zeros(number_of_algorithms, 1));
|
|
27
|
-
for i=1:number_of_algorithms
|
|
28
|
-
names(i) = string(table{samples_per_digits * i * max_digits,1});
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
% algorithm index, digits, measured_time
|
|
32
|
-
data = zeros(number_of_algorithms, max_digits, samples_per_digits);
|
|
33
|
-
for algorithm_idx=1:number_of_algorithms
|
|
34
|
-
for digits_idx=1:max_digits
|
|
35
|
-
offset = ((algorithm_idx-1) * max_digits + (digits_idx-1)) * samples_per_digits;
|
|
36
|
-
data(algorithm_idx, digits_idx,:) = table{offset+1:offset+samples_per_digits, 4};
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
color_array = {[.8 .06 .1],[.1 .7 .06],[.06 .1 .8],[.6 .2 .8],[.8 .9 0],[.5 .6 .7],[.8 .2 .6]};
|
|
41
|
-
avg = zeros(number_of_algorithms, max_digits);
|
|
42
|
-
for algorithm_idx=1:number_of_algorithms
|
|
43
|
-
for digits_idx=1:max_digits
|
|
44
|
-
avg(algorithm_idx,digits_idx) = mean(data(algorithm_idx,digits_idx,:));
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
% we will call this function stdshade
|
|
49
|
-
addpath(genpath('shaded_plots'));
|
|
50
|
-
|
|
51
|
-
% plot
|
|
52
|
-
fig = figure('Color','w');
|
|
53
|
-
fig_handles = zeros(number_of_algorithms,1);
|
|
54
|
-
hold on
|
|
55
|
-
for algorithm_idx=1:number_of_algorithms
|
|
56
|
-
fig_handles(algorithm_idx) = plot(1:max_digits,squeeze(avg(algorithm_idx,:)), ...
|
|
57
|
-
'Color', color_array{algorithm_idx}, 'LineWidth', 1.2);
|
|
58
|
-
end
|
|
59
|
-
for algorithm_idx=1:number_of_algorithms
|
|
60
|
-
plot_distribution_prctile(1:max_digits,squeeze(data(algorithm_idx,:,:))', ...
|
|
61
|
-
'Color', color_array{algorithm_idx}, 'Alpha', 0.05, ...
|
|
62
|
-
'Prctile', [30 50 70], 'LineWidth', 0.2);
|
|
63
|
-
end
|
|
64
|
-
legend(fig_handles,names);
|
|
65
|
-
axis([1 max_digits -Inf Inf]);
|
|
66
|
-
xlabel('Number of digits');
|
|
67
|
-
ylabel('Time (ns)');
|
|
68
|
-
h = gca;
|
|
69
|
-
h.XTick = 1:max_digits;
|
|
70
|
-
h.XGrid = 'on';
|
|
71
|
-
h.YGrid = 'on';
|
|
72
|
-
set(gca,'TickLabelInterpreter', 'latex');
|
|
73
|
-
set(gcf, 'Position', [100 100 1200 500]);
|
|
74
|
-
orient(fig,'landscape');
|
|
75
|
-
exportgraphics(fig, output_filename, 'BackgroundColor', 'none');
|
|
76
|
-
hold off
|
|
77
|
-
|
|
78
|
-
end
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
% Copyright 2020-2021 Junekey Jeon
|
|
2
|
-
%
|
|
3
|
-
% The contents of this file may be used under the terms of
|
|
4
|
-
% the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
%
|
|
6
|
-
% (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
% https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
%
|
|
9
|
-
% Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
% the Boost Software License, Version 1.0.
|
|
11
|
-
% (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
% https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
%
|
|
14
|
-
% Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
% is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
% KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
function [] = plot_uniform_benchmark( filename, bits )
|
|
19
|
-
|
|
20
|
-
output_filename = replace(filename, '.csv', '.pdf');
|
|
21
|
-
|
|
22
|
-
samples = csvread(filename,0,1,[0 1 0 1]);
|
|
23
|
-
table = readtable(filename);
|
|
24
|
-
number_of_algorithms = size(table,1) / samples;
|
|
25
|
-
names = string(zeros(number_of_algorithms, 1));
|
|
26
|
-
for i=1:number_of_algorithms
|
|
27
|
-
names(i) = string(table{samples * i,1});
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
% algorithm index, measured_time
|
|
31
|
-
measured_times = zeros(number_of_algorithms, samples);
|
|
32
|
-
for algorithm_idx=1:number_of_algorithms
|
|
33
|
-
offset = (algorithm_idx-1) * samples;
|
|
34
|
-
measured_times(algorithm_idx,:) = table{offset+1:offset+samples, 4};
|
|
35
|
-
end
|
|
36
|
-
bit_representations = sscanf(strjoin(string(table{1:samples, 3})', ' '), '%lu');
|
|
37
|
-
|
|
38
|
-
color_array = {[.8 .06 .1],[.1 .7 .06],[.06 .1 .8],[.6 .2 .8],[.8 .9 0],[.5 .6 .7],[.8 .2 .6]};
|
|
39
|
-
|
|
40
|
-
% compute statistics
|
|
41
|
-
av = mean(measured_times');
|
|
42
|
-
st = std(measured_times');
|
|
43
|
-
me = median(measured_times');
|
|
44
|
-
|
|
45
|
-
decorated_names = names;
|
|
46
|
-
for algorithm_idx=1:number_of_algorithms
|
|
47
|
-
decorated_names(algorithm_idx) = sprintf('%s (avg: %.2f, std: %.2f, med: %.2f)', ...
|
|
48
|
-
names(algorithm_idx), av(algorithm_idx), st(algorithm_idx), me(algorithm_idx));
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
% sample data for plot
|
|
52
|
-
maximum_plot_size = 10000;
|
|
53
|
-
if samples > maximum_plot_size
|
|
54
|
-
plot_size = maximum_plot_size;
|
|
55
|
-
unit = floor(samples / maximum_plot_size);
|
|
56
|
-
sampled_br = bit_representations(1:unit:unit*plot_size);
|
|
57
|
-
sampled_mt = measured_times(:,1:unit:unit*plot_size);
|
|
58
|
-
else
|
|
59
|
-
plot_size = samples;
|
|
60
|
-
sampled_br = bit_representations;
|
|
61
|
-
sampled_mt = measured_times;
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
% plot
|
|
65
|
-
fig = figure('Color','w');
|
|
66
|
-
fig_handles = zeros(number_of_algorithms,1);
|
|
67
|
-
hold on
|
|
68
|
-
sz = ones(plot_size, 1) * 0.4;
|
|
69
|
-
for algorithm_idx=1:number_of_algorithms
|
|
70
|
-
fig_handles(algorithm_idx) = scatter(sampled_br, ...
|
|
71
|
-
sampled_mt(algorithm_idx,:), sz, '+', ...
|
|
72
|
-
'MarkerEdgeColor', color_array{algorithm_idx}, 'LineWidth', 0.1);
|
|
73
|
-
end
|
|
74
|
-
legend(fig_handles,decorated_names);
|
|
75
|
-
xlabel('Bit representation');
|
|
76
|
-
ylabel('Time (ns)');
|
|
77
|
-
range = prctile(measured_times(:), 99.9);
|
|
78
|
-
axis([0 uint64(2)^bits 0 range(1)]);
|
|
79
|
-
if bits==32
|
|
80
|
-
xticks([0 uint64(2)^30 uint64(2)^31 3*uint64(2)^30 uint64(2)^32]);
|
|
81
|
-
xticklabels({'$0$','$2^{30}$','$2^{31}$','$3\times2^{30}$','$2^{32}$'});
|
|
82
|
-
elseif bits==64
|
|
83
|
-
xticks([0 uint64(2)^62 uint64(2)^63 3*uint64(2)^62 uint64(2)^64]);
|
|
84
|
-
xticklabels({'$0$','$2^{62}$','$2^{63}$','$3\times2^{62}$','$2^{64}$'});
|
|
85
|
-
end
|
|
86
|
-
h = gca;
|
|
87
|
-
h.XGrid = 'off';
|
|
88
|
-
h.YGrid = 'on';
|
|
89
|
-
set(gca,'TickLabelInterpreter', 'latex');
|
|
90
|
-
set(gcf, 'Position', [100 100 1200 500]);
|
|
91
|
-
orient(fig,'landscape');
|
|
92
|
-
exportgraphics(fig, output_filename, 'BackgroundColor', 'none');
|
|
93
|
-
hold off
|
|
94
|
-
|
|
95
|
-
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
// Copyright 2020-2021 Junekey Jeon
|
|
2
|
-
//
|
|
3
|
-
// The contents of this file may be used under the terms of
|
|
4
|
-
// the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
//
|
|
6
|
-
// (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
// https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
//
|
|
9
|
-
// Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
// the Boost Software License, Version 1.0.
|
|
11
|
-
// (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
// https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
//
|
|
14
|
-
// Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
// KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
#include "benchmark.h"
|
|
19
|
-
#include "random_float.h"
|
|
20
|
-
#include "dragonbox/dragonbox_to_chars.h"
|
|
21
|
-
#include <array>
|
|
22
|
-
#include <chrono>
|
|
23
|
-
#include <cstring>
|
|
24
|
-
#include <fstream>
|
|
25
|
-
#include <iomanip>
|
|
26
|
-
#include <iostream>
|
|
27
|
-
#include <string_view>
|
|
28
|
-
#include <utility>
|
|
29
|
-
#include <unordered_map>
|
|
30
|
-
#include <vector>
|
|
31
|
-
|
|
32
|
-
template <class Float>
|
|
33
|
-
class benchmark_holder {
|
|
34
|
-
public:
|
|
35
|
-
static constexpr auto max_digits = std::size_t(std::numeric_limits<Float>::max_digits10);
|
|
36
|
-
|
|
37
|
-
static benchmark_holder& get_instance() {
|
|
38
|
-
static benchmark_holder<Float> inst;
|
|
39
|
-
return inst;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Generate random samples
|
|
43
|
-
void prepare_samples(std::size_t number_of_general_samples,
|
|
44
|
-
std::size_t number_of_digits_samples_per_digits) {
|
|
45
|
-
samples_[0].resize(number_of_general_samples);
|
|
46
|
-
for (auto& sample : samples_[0])
|
|
47
|
-
sample = uniformly_randomly_generate_general_float<Float>(rg_);
|
|
48
|
-
|
|
49
|
-
for (unsigned int digits = 1; digits <= max_digits; ++digits) {
|
|
50
|
-
samples_[digits].resize(number_of_digits_samples_per_digits);
|
|
51
|
-
for (auto& sample : samples_[digits])
|
|
52
|
-
sample = randomly_generate_float_with_given_digits<Float>(digits, rg_);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// { "name" : [(digits, [(sample, measured_time)])] }
|
|
57
|
-
// Results for general samples is stored at the position digits=0
|
|
58
|
-
using output_type =
|
|
59
|
-
std::unordered_map<std::string,
|
|
60
|
-
std::array<std::vector<std::pair<Float, double>>, max_digits + 1>>;
|
|
61
|
-
void run(std::size_t number_of_iterations, std::string_view float_name, output_type& out) {
|
|
62
|
-
assert(number_of_iterations >= 1);
|
|
63
|
-
char buffer[40];
|
|
64
|
-
|
|
65
|
-
for (auto const& name_func_pair : name_func_pairs_) {
|
|
66
|
-
auto [result_array_itr, is_inserted] = out.insert_or_assign(
|
|
67
|
-
name_func_pair.first,
|
|
68
|
-
std::array<std::vector<std::pair<Float, double>>, max_digits + 1>{});
|
|
69
|
-
|
|
70
|
-
for (unsigned int digits = 0; digits <= max_digits; ++digits) {
|
|
71
|
-
(*result_array_itr).second[digits].resize(samples_[digits].size());
|
|
72
|
-
auto out_itr = (*result_array_itr).second[digits].begin();
|
|
73
|
-
|
|
74
|
-
if (digits == 0) {
|
|
75
|
-
std::cout << "Benchmarking " << name_func_pair.first
|
|
76
|
-
<< " with uniformly random " << float_name << "'s...\n";
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
std::cout << "Benchmarking " << name_func_pair.first
|
|
80
|
-
<< " with (approximately) uniformly random " << float_name << "'s of "
|
|
81
|
-
<< digits << " digits...\n";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
for (Float sample : samples_[digits]) {
|
|
85
|
-
auto from = std::chrono::high_resolution_clock::now();
|
|
86
|
-
for (std::size_t i = 0; i < number_of_iterations; ++i) {
|
|
87
|
-
name_func_pair.second(sample, buffer);
|
|
88
|
-
}
|
|
89
|
-
auto dur = std::chrono::high_resolution_clock::now() - from;
|
|
90
|
-
|
|
91
|
-
*out_itr = {
|
|
92
|
-
sample,
|
|
93
|
-
double(std::chrono::duration_cast<std::chrono::nanoseconds>(dur).count()) /
|
|
94
|
-
double(number_of_iterations)};
|
|
95
|
-
++out_itr;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
output_type run(std::size_t number_of_iterations, std::string_view float_name) {
|
|
102
|
-
output_type out;
|
|
103
|
-
run(number_of_iterations, float_name, out);
|
|
104
|
-
return out;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
void register_function(std::string_view name, void (*func)(Float, char*)) {
|
|
108
|
-
name_func_pairs_.emplace(name, func);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
private:
|
|
112
|
-
benchmark_holder() : rg_(generate_correctly_seeded_mt19937_64()) {}
|
|
113
|
-
|
|
114
|
-
// Digits samples for [1] ~ [max_digits], general samples for [0]
|
|
115
|
-
std::array<std::vector<Float>, max_digits + 1> samples_;
|
|
116
|
-
std::mt19937_64 rg_;
|
|
117
|
-
std::unordered_map<std::string, void (*)(Float, char*)> name_func_pairs_;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
register_function_for_benchmark::register_function_for_benchmark(std::string_view name,
|
|
121
|
-
void (*func_float)(float, char*)) {
|
|
122
|
-
benchmark_holder<float>::get_instance().register_function(name, func_float);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
register_function_for_benchmark::register_function_for_benchmark(std::string_view name,
|
|
126
|
-
void (*func_double)(double,
|
|
127
|
-
char*)) {
|
|
128
|
-
benchmark_holder<double>::get_instance().register_function(name, func_double);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
register_function_for_benchmark::register_function_for_benchmark(
|
|
132
|
-
std::string_view name, void (*func_float)(float, char*), void (*func_double)(double, char*)) {
|
|
133
|
-
benchmark_holder<float>::get_instance().register_function(name, func_float);
|
|
134
|
-
benchmark_holder<double>::get_instance().register_function(name, func_double);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
#define RUN_MATLAB
|
|
139
|
-
#ifdef RUN_MATLAB
|
|
140
|
-
#include <cstdlib>
|
|
141
|
-
|
|
142
|
-
void run_matlab() {
|
|
143
|
-
struct launcher {
|
|
144
|
-
~launcher() { std::system("matlab -nosplash -r \"cd('matlab'); plot_benchmarks\""); }
|
|
145
|
-
};
|
|
146
|
-
static launcher l;
|
|
147
|
-
}
|
|
148
|
-
#endif
|
|
149
|
-
|
|
150
|
-
template <class Float>
|
|
151
|
-
static void benchmark_test(std::string_view float_name, std::size_t number_of_uniform_samples,
|
|
152
|
-
std::size_t number_of_digits_samples_per_digits,
|
|
153
|
-
std::size_t number_of_iterations) {
|
|
154
|
-
auto& inst = benchmark_holder<Float>::get_instance();
|
|
155
|
-
std::cout << "Generating random samples...\n";
|
|
156
|
-
inst.prepare_samples(number_of_uniform_samples, number_of_digits_samples_per_digits);
|
|
157
|
-
auto out = inst.run(number_of_iterations, float_name);
|
|
158
|
-
|
|
159
|
-
std::cout << "Benchmarking done.\n"
|
|
160
|
-
<< "Now writing to files...\n";
|
|
161
|
-
|
|
162
|
-
// Write uniform benchmark results
|
|
163
|
-
auto filename = std::string("results/uniform_benchmark_");
|
|
164
|
-
filename += float_name;
|
|
165
|
-
filename += ".csv";
|
|
166
|
-
std::ofstream out_file{filename};
|
|
167
|
-
out_file << "number_of_samples," << number_of_uniform_samples << std::endl;
|
|
168
|
-
;
|
|
169
|
-
out_file << "name,sample,bit_representation,time\n";
|
|
170
|
-
|
|
171
|
-
char buffer[64];
|
|
172
|
-
typename jkj::dragonbox::default_float_traits<Float>::carrier_uint br;
|
|
173
|
-
for (auto& name_result_pair : out) {
|
|
174
|
-
for (auto const& data_time_pair : name_result_pair.second[0]) {
|
|
175
|
-
std::memcpy(&br, &data_time_pair.first, sizeof(Float));
|
|
176
|
-
jkj::dragonbox::to_chars(data_time_pair.first, buffer);
|
|
177
|
-
out_file << "\"" << name_result_pair.first << "\"," << buffer << ","
|
|
178
|
-
<< "0x" << std::hex << std::setfill('0');
|
|
179
|
-
if constexpr (sizeof(Float) == 4)
|
|
180
|
-
out_file << std::setw(8);
|
|
181
|
-
else
|
|
182
|
-
out_file << std::setw(16);
|
|
183
|
-
out_file << br << std::dec << "," << data_time_pair.second << "\n";
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
out_file.close();
|
|
187
|
-
|
|
188
|
-
// Write digits benchmark results
|
|
189
|
-
filename = std::string("results/digits_benchmark_");
|
|
190
|
-
filename += float_name;
|
|
191
|
-
filename += ".csv";
|
|
192
|
-
out_file.open(filename);
|
|
193
|
-
out_file << "number_of_samples_per_digits," << number_of_digits_samples_per_digits << std::endl;
|
|
194
|
-
;
|
|
195
|
-
out_file << "name,digits,sample,time\n";
|
|
196
|
-
|
|
197
|
-
for (auto& name_result_pair : out) {
|
|
198
|
-
for (unsigned int digits = 1; digits <= benchmark_holder<Float>::max_digits; ++digits) {
|
|
199
|
-
for (auto const& data_time_pair : name_result_pair.second[digits]) {
|
|
200
|
-
jkj::dragonbox::to_chars(data_time_pair.first, buffer);
|
|
201
|
-
out_file << "\"" << name_result_pair.first << "\"," << digits << "," << buffer
|
|
202
|
-
<< "," << data_time_pair.second << "\n";
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
out_file.close();
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
int main() {
|
|
210
|
-
constexpr bool benchmark_float = true;
|
|
211
|
-
constexpr std::size_t number_of_uniform_benchmark_samples_float = 1000000;
|
|
212
|
-
constexpr std::size_t number_of_digits_benchmark_samples_per_digits_float = 100000;
|
|
213
|
-
constexpr std::size_t number_of_benchmark_iterations_float = 1000;
|
|
214
|
-
|
|
215
|
-
constexpr bool benchmark_double = true;
|
|
216
|
-
constexpr std::size_t number_of_uniform_benchmark_samples_double = 1000000;
|
|
217
|
-
constexpr std::size_t number_of_digits_benchmark_samples_per_digits_double = 100000;
|
|
218
|
-
constexpr std::size_t number_of_benchmark_iterations_double = 1000;
|
|
219
|
-
|
|
220
|
-
if constexpr (benchmark_float) {
|
|
221
|
-
std::cout << "[Running benchmark for binary32...]\n";
|
|
222
|
-
benchmark_test<float>("binary32", number_of_uniform_benchmark_samples_float,
|
|
223
|
-
number_of_digits_benchmark_samples_per_digits_float,
|
|
224
|
-
number_of_benchmark_iterations_float);
|
|
225
|
-
std::cout << "Done.\n\n\n";
|
|
226
|
-
}
|
|
227
|
-
if constexpr (benchmark_double) {
|
|
228
|
-
std::cout << "[Running benchmark for binary64...]\n";
|
|
229
|
-
benchmark_test<double>("binary64", number_of_uniform_benchmark_samples_double,
|
|
230
|
-
number_of_digits_benchmark_samples_per_digits_double,
|
|
231
|
-
number_of_benchmark_iterations_double);
|
|
232
|
-
std::cout << "Done.\n\n\n";
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
#ifdef RUN_MATLAB
|
|
236
|
-
run_matlab();
|
|
237
|
-
#endif
|
|
238
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Junekey Jeon
|
|
2
|
-
//
|
|
3
|
-
// The contents of this file may be used under the terms of
|
|
4
|
-
// the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
//
|
|
6
|
-
// (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
// https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
//
|
|
9
|
-
// Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
// the Boost Software License, Version 1.0.
|
|
11
|
-
// (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
// https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
//
|
|
14
|
-
// Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
// KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
#include "benchmark.h"
|
|
19
|
-
#include "dragonbox/dragonbox_to_chars.h"
|
|
20
|
-
|
|
21
|
-
namespace {
|
|
22
|
-
void dragonbox_float_to_chars(float x, char* buffer) { jkj::dragonbox::to_chars(x, buffer); }
|
|
23
|
-
void dragonbox_double_to_chars(double x, char* buffer) { jkj::dragonbox::to_chars(x, buffer); }
|
|
24
|
-
|
|
25
|
-
#if 1
|
|
26
|
-
auto dummy = []() -> register_function_for_benchmark {
|
|
27
|
-
return {"Dragonbox", dragonbox_float_to_chars, dragonbox_double_to_chars};
|
|
28
|
-
}();
|
|
29
|
-
#endif
|
|
30
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Junekey Jeon
|
|
2
|
-
//
|
|
3
|
-
// The contents of this file may be used under the terms of
|
|
4
|
-
// the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
//
|
|
6
|
-
// (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
// https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
//
|
|
9
|
-
// Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
// the Boost Software License, Version 1.0.
|
|
11
|
-
// (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
// https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
//
|
|
14
|
-
// Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
// KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
#include "benchmark.h"
|
|
19
|
-
#include "fp_to_chars.h"
|
|
20
|
-
|
|
21
|
-
namespace {
|
|
22
|
-
void grisu_exact_float_to_chars(float x, char* buffer) {
|
|
23
|
-
jkj::fp_to_chars(x, buffer, jkj::grisu_exact_rounding_modes::nearest_to_even{},
|
|
24
|
-
jkj::grisu_exact_correct_rounding::tie_to_even{});
|
|
25
|
-
}
|
|
26
|
-
void grisu_exact_double_to_chars(double x, char* buffer) {
|
|
27
|
-
jkj::fp_to_chars(x, buffer, jkj::grisu_exact_rounding_modes::nearest_to_even{},
|
|
28
|
-
jkj::grisu_exact_correct_rounding::tie_to_even{});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#if 1
|
|
32
|
-
auto dummy = []() -> register_function_for_benchmark {
|
|
33
|
-
return {"Grisu-Exact", grisu_exact_float_to_chars, grisu_exact_double_to_chars};
|
|
34
|
-
}();
|
|
35
|
-
#endif
|
|
36
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Junekey Jeon
|
|
2
|
-
//
|
|
3
|
-
// The contents of this file may be used under the terms of
|
|
4
|
-
// the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
//
|
|
6
|
-
// (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
// https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
//
|
|
9
|
-
// Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
// the Boost Software License, Version 1.0.
|
|
11
|
-
// (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
// https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
//
|
|
14
|
-
// Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
// KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
#include "benchmark.h"
|
|
19
|
-
#include "ryu/ryu.h"
|
|
20
|
-
|
|
21
|
-
namespace {
|
|
22
|
-
#if 1
|
|
23
|
-
auto dummy = []() -> register_function_for_benchmark {
|
|
24
|
-
return {"Ryu", f2s_buffered, d2s_buffered};
|
|
25
|
-
}();
|
|
26
|
-
#endif
|
|
27
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 Junekey Jeon
|
|
2
|
-
//
|
|
3
|
-
// The contents of this file may be used under the terms of
|
|
4
|
-
// the Apache License v2.0 with LLVM Exceptions.
|
|
5
|
-
//
|
|
6
|
-
// (See accompanying file LICENSE-Apache or copy at
|
|
7
|
-
// https://llvm.org/foundation/relicensing/LICENSE.txt)
|
|
8
|
-
//
|
|
9
|
-
// Alternatively, the contents of this file may be used under the terms of
|
|
10
|
-
// the Boost Software License, Version 1.0.
|
|
11
|
-
// (See accompanying file LICENSE-Boost or copy at
|
|
12
|
-
// https://www.boost.org/LICENSE_1_0.txt)
|
|
13
|
-
//
|
|
14
|
-
// Unless required by applicable law or agreed to in writing, this software
|
|
15
|
-
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
// KIND, either express or implied.
|
|
17
|
-
|
|
18
|
-
#include "benchmark.h"
|
|
19
|
-
#include "schubfach_32.h"
|
|
20
|
-
#include "schubfach_64.h"
|
|
21
|
-
|
|
22
|
-
namespace {
|
|
23
|
-
void schubfach_32(float x, char* buf) { *schubfach::Ftoa(buf, x) = '\0'; }
|
|
24
|
-
void schubfach_64(double x, char* buf) { *schubfach::Dtoa(buf, x) = '\0'; }
|
|
25
|
-
|
|
26
|
-
#if 1
|
|
27
|
-
auto dummy = []() -> register_function_for_benchmark {
|
|
28
|
-
return {"Schubfach", schubfach_32, schubfach_64};
|
|
29
|
-
}();
|
|
30
|
-
#endif
|
|
31
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
|
2
|
-
|
|
3
|
-
project(dragonbox_common LANGUAGES CXX)
|
|
4
|
-
|
|
5
|
-
include(FetchContent)
|
|
6
|
-
if (NOT TARGET dragonbox)
|
|
7
|
-
FetchContent_Declare(dragonbox SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
|
|
8
|
-
FetchContent_MakeAvailable(dragonbox)
|
|
9
|
-
endif()
|
|
10
|
-
|
|
11
|
-
set(dragonbox_common_headers
|
|
12
|
-
include/big_uint.h
|
|
13
|
-
include/continued_fractions.h
|
|
14
|
-
include/rational_continued_fractions.h
|
|
15
|
-
include/best_rational_approx.h
|
|
16
|
-
include/good_rational_approx.h
|
|
17
|
-
include/random_float.h)
|
|
18
|
-
|
|
19
|
-
set(dragonbox_common_sources source/big_uint.cpp)
|
|
20
|
-
|
|
21
|
-
add_library(dragonbox_common STATIC
|
|
22
|
-
${dragonbox_common_headers}
|
|
23
|
-
${dragonbox_common_sources})
|
|
24
|
-
add_library(dragonbox::common ALIAS dragonbox_common)
|
|
25
|
-
|
|
26
|
-
target_include_directories(dragonbox_common
|
|
27
|
-
PUBLIC
|
|
28
|
-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
|
|
29
|
-
|
|
30
|
-
target_compile_features(dragonbox_common PUBLIC cxx_std_17)
|
|
31
|
-
|
|
32
|
-
target_link_libraries(dragonbox_common PUBLIC dragonbox::dragonbox)
|
|
33
|
-
|
|
34
|
-
# ---- MSVC Specifics ----
|
|
35
|
-
if (MSVC)
|
|
36
|
-
# No need to not generate PDB
|
|
37
|
-
# /permissive- should be the default
|
|
38
|
-
# The compilation will fail without /experimental:newLambdaProcessor
|
|
39
|
-
target_compile_options(dragonbox_common PUBLIC
|
|
40
|
-
/Zi /permissive-
|
|
41
|
-
$<$<NOT:$<CXX_COMPILER_ID:Clang>>:/experimental:newLambdaProcessor>)
|
|
42
|
-
endif()
|