From 0a45a117e36daf310a6230a8c1a5e9e8e3740138 Mon Sep 17 00:00:00 2001 From: DepressedTWM Date: Sun, 16 Aug 2026 15:36:05 +0400 Subject: [PATCH] OPTIMIZATION --- CMakeLists.txt | 36 +++++++++++++++++------------------- scripts_benchmark/Main.rb | 29 +---------------------------- 2 files changed, 18 insertions(+), 47 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ab213f..2d3868e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,7 +346,8 @@ if(DEBUG) check_option(OPTIONS_DEBUG -g3 -fno-omit-frame-pointer - -Og) + -Og + -fcheck-new) add_compile_options(${OPTIONS_DEBUG}) if("${ARCH_DEBUG}" STREQUAL "") @@ -356,19 +357,20 @@ if(DEBUG) add_compile_options(${ARCH_DEBUG_OPTIONS}) endif() else() - check_option(OPTIONS_RELEASE -O2 - -ffast-math - -fipa-pta - -fipa-sra - -ftree-vectorize - -fstdarg-opt - -fomit-frame-pointer - -frename-registers - -ffunction-sections - -fdata-sections - -fvisibility=hidden - -fno-asynchronous-unwind-tables - -fno-semantic-interposition) + check_option(OPTIONS_RELEASE -O3 + -ffast-math + -fvisibility=hidden + -fno-math-errno + -fno-trapping-math + -ffunction-sections + -fsection-anchors + -fdata-sections + -fvirtual-function-elimination + -fstdarg-opt + -frename-registers + -fuse-linker-plugin + -fipa-pta + -fext-dce) add_compile_options(${OPTIONS_RELEASE}) add_link_options(-Wl,-O2 @@ -378,14 +380,10 @@ else() -Wl,--strip-all -Wl,--no-copy-dt-needed-entries) if(NOT WIN32) - check_option(OPTIONS_RELEASE_WIN32_FLTO -flto=auto) + check_option(OPTIONS_RELEASE_WIN32_FLTO -flto=thin) add_compile_options(${OPTIONS_RELEASE_WIN32_FLTO}) add_link_options(${OPTIONS_RELEASE_WIN32_FLTO}) endif() - if(LINUX) - check_option(MEOW_OPT -fno-semantic-interposition) - add_compile_options(${MEOW_OPT}) - endif() if("${ARCH_RELEASE}" STREQUAL "") message(STATUS "ARCH_RELEASE empty") else() diff --git a/scripts_benchmark/Main.rb b/scripts_benchmark/Main.rb index 52a0890..57200a2 100644 --- a/scripts_benchmark/Main.rb +++ b/scripts_benchmark/Main.rb @@ -22,7 +22,6 @@ begin puts count count = count * count end - count / 67.1488 count = 1 while count <= 5000 do Graphics.frame_rate = count @@ -46,31 +45,14 @@ begin puts CTime.month puts CTime.day puts CTime.hour - Sunshine.wallpapermode="fallback" - Sunshine.wallpapermode="disabled" - Sunshine.wallpapermode="normal" puts Sunshine::SDLVersion_major - puts Sunshine::SDLVersion_minor - puts Sunshine::SDLVersion_micro puts Sunshine::SECURITYSTATE - puts Sunshine::VERSION puts Sunshine::DEVBUILD count = 0 - Oneshot.shake - Oneshot.shake - Oneshot.shake - Oneshot.shake - Oneshot.shake - while count <= 9999999 do + while count <= 999999 do count.clone count = count + 1 puts count - Graphics.setVsync(0) - Graphics.setVsync(1) - Graphics.setVsync(-1) - Graphics.smooth = true - Graphics.smooth = false - Graphics.frame_reset Graphics.update begin raise 'Boom!' @@ -82,15 +64,6 @@ begin rescue puts "Rescued #{$!.class}" end - begin - Dir.open('nosuch') - rescue Errno::ENOTDIR - puts "Rescued #{$!.class}" - rescue Errno::ENOENT - puts "Rescued #{$!.class}" - rescue - puts "g" - end end rescue Errno::ENOENT filename = $!.message.sub("No such file or directory - ", "")