Skip to content

Commit

Permalink
feat!: removing ARK_PROFILER_MIPS as it has served it's purpose and i…
Browse files Browse the repository at this point in the history
…s no longer useful
  • Loading branch information
SuperFola committed Sep 25, 2024
1 parent 0de4b87 commit 6b6fa20
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ set(ARK_COMMIT ${GIT_COMMIT_HASH})

option(ARK_BUILD_EXE "Build a standalone arkscript executable" Off)
option(ARK_ENABLE_SYSTEM "Enable sys:exec" On) # enable use of (sys:exec "command here")
option(ARK_PROFILER_MIPS "Enable MIPS calculation" Off)
option(ARK_NO_STDLIB "Do not install the standard library with the Ark library" Off)
option(ARK_BUILD_MODULES "Build the std library modules or not" Off)
option(ARK_SANITIZERS "Enable ASAN and UBSAN" Off)
Expand Down Expand Up @@ -161,10 +160,6 @@ if (ARK_ENABLE_SYSTEM)
target_compile_definitions(ArkReactor PRIVATE ARK_ENABLE_SYSTEM)
endif ()

if (ARK_PROFILER_MIPS)
target_compile_definitions(ArkReactor PRIVATE ARK_PROFILER_MIPS)
endif ()

if (ARK_BUILD_MODULES)
get_directory_property(old_dir_compile_options COMPILE_OPTIONS)
add_compile_options(-w)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ Different CMake switches are available to customize the build:

* `-DARK_BUILD_EXE` to generate an executable, defaults to Off, building a shared library only
* `-DARK_ENABLE_SYSTEM` to enable `sys:exec` (execute shell commands without restrictions), defaults to On
* `-DARK_PROFILER_MIPS` to enable the MIPS counting, defaults to Off
* `-DARK_NO_STDLIB` to avoid the installation of the ArkScript standard library
* `-DARK_BUILD_MODULES` to trigger the modules build
* `-DARK_SANITIZERS` to enable ASAN and UBSAN
Expand Down
18 changes: 0 additions & 18 deletions src/arkreactor/VM/VM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#include <Ark/TypeChecker.hpp>
#include <Ark/Compiler/Instructions.hpp>

#ifdef ARK_PROFILER_MIPS
# include <chrono>
#endif

struct mapping
{
char* name;
Expand Down Expand Up @@ -265,11 +261,6 @@ namespace Ark

int VM::safeRun(ExecutionContext& context, std::size_t untilFrameCount, bool fail_with_exception)
{
#ifdef ARK_PROFILER_MIPS
auto start_time = std::chrono::system_clock::now();
unsigned long long instructions_executed = 0;
#endif

#if ARK_USE_COMPUTED_GOTOS
# define TARGET(op) TARGET_##op:
# define DISPATCH_GOTO() \
Expand Down Expand Up @@ -1180,15 +1171,6 @@ namespace Ark
m_exit_code = 1;
}

#ifdef ARK_PROFILER_MIPS
auto end_time = std::chrono::system_clock::now();
auto d = std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time);

fmt::println("\nInstructions executed: {}", instructions_executed);
fmt::println("Time spent: {} us", d.count());
fmt::println("{} MIPS", static_cast<double>(instructions_executed) / d.count());
#endif

return m_exit_code;
}

Expand Down

0 comments on commit 6b6fa20

Please sign in to comment.