diff --git a/README.md b/README.md index e206b36e6..fe2df5e96 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Subset of R7RS-small. cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.4.805_amd64.deb +sudo apt install build/meevax_0.4.806_amd64.deb ``` or @@ -106,9 +106,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.4.805.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.4.806.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.4.805_amd64.deb` +| `package` | Generate debian package `meevax_0.4.806_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index a0c10b145..3d705fc79 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.805 +0.4.806 diff --git a/include/meevax/kernel/dynamic_environment.hpp b/include/meevax/kernel/dynamic_environment.hpp index f1f1d9aa7..b32497e12 100644 --- a/include/meevax/kernel/dynamic_environment.hpp +++ b/include/meevax/kernel/dynamic_environment.hpp @@ -118,11 +118,6 @@ inline namespace kernel << faint("; d = ") << d << "\n" << std::endl; } - if constexpr (profiler::count_instruction_fetch) - { - current_profiler().instruction_fetchs[car(c).template as()]++; - } - switch (car(c).template as()) { case instruction::load_absolute: /* ------------------------------------ diff --git a/include/meevax/kernel/heterogeneous.hpp b/include/meevax/kernel/heterogeneous.hpp index f57fa194f..939e83903 100644 --- a/include/meevax/kernel/heterogeneous.hpp +++ b/include/meevax/kernel/heterogeneous.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -109,12 +108,6 @@ inline namespace kernel template static auto allocate(Us&&... xs) { - if constexpr (profiler::count_allocations) - { - current_profiler().allocation_counts[typeid(Bound)]++; - current_profiler().allocation_counts[typeid(void)]++; - } - if constexpr (std::is_same_v) { return heterogeneous(gc.make(std::forward(xs)...)); diff --git a/include/meevax/kernel/pair.hpp b/include/meevax/kernel/pair.hpp index 4cb6b0da5..da1208c18 100644 --- a/include/meevax/kernel/pair.hpp +++ b/include/meevax/kernel/pair.hpp @@ -18,6 +18,7 @@ #define INCLUDED_MEEVAX_KERNEL_PAIR_HPP #include +#include namespace meevax { diff --git a/include/meevax/kernel/profiler.hpp b/include/meevax/kernel/profiler.hpp deleted file mode 100644 index 92cba4330..000000000 --- a/include/meevax/kernel/profiler.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2018-2023 Tatsuya Yamasaki. - - 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 - - http://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. -*/ - -#ifndef INCLUDED_MEEVAX_KERNEL_PROFILER_HPP -#define INCLUDED_MEEVAX_KERNEL_PROFILER_HPP - -#include -#include - -#include - -namespace meevax -{ -inline namespace kernel -{ - struct profiler - { - static constexpr auto count_allocations = false; - static constexpr auto count_instruction_fetch = false; - - std::unordered_map allocation_counts; - - std::unordered_map instruction_fetchs; - - ~profiler(); - }; - - auto current_profiler() -> profiler &; -} // namespace kernel -} // namespace meevax - -#endif // INCLUDED_MEEVAX_KERNEL_PROFILER_HPP diff --git a/src/kernel/profiler.cpp b/src/kernel/profiler.cpp deleted file mode 100644 index 0d7611c8d..000000000 --- a/src/kernel/profiler.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright 2018-2023 Tatsuya Yamasaki. - - 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 - - http://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 - -#include -#include - -namespace meevax -{ -inline namespace kernel -{ - auto sh(std::string const& command) - { - if (auto status = std::system(command.c_str()); status < 0) - { - std::exit(EXIT_FAILURE); - } - else - { - return WIFEXITED(status); - } - } - - profiler::~profiler() - { - if (auto ss = std::stringstream(); not std::empty(allocation_counts)) - { - for (auto&& [type, value] : allocation_counts) - { - ss << demangle(type.name()) << "\t" << value << "\n"; - } - - sh("echo \"" + ss.str() + "\" | sed 's/meevax::kernel:://g' \ - | sort --field-separator='\t' \ - --key=2 \ - --numeric-sort \ - --reverse \ - | echo \"TYPENAME\tALLOCATION COUNT\n$(cat -)\" \ - | column -t -s'\t'"); - } - - if (auto ss = std::stringstream(); not std::empty(instruction_fetchs)) - { - for (auto&& [instruction, count] : instruction_fetchs) - { - ss << instruction << "\t" << count << "\n"; - } - - sh("echo \"" + ss.str() + "\" | sed 's/meevax::kernel:://g' \ - | sort --field-separator='\t' \ - --key=2 \ - --numeric-sort \ - --reverse \ - | echo \"MNEMONIC\tFETCH COUNT\n$(cat -)\" \ - | column -t -s'\t'"); - } - } - - auto current_profiler() -> profiler & - { - static profiler value {}; - return value; - } -} // namespace kernel -} // namespace meevax