From 6dfef9f61bde83e8ca09d920e05b592ca61f2256 Mon Sep 17 00:00:00 2001 From: Gordon MacPherson Date: Sat, 15 Aug 2020 02:51:19 +0100 Subject: [PATCH 1/4] go faster button! --- platform/windows/detect.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index a9f25fa07855..680af629ecf3 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -180,22 +180,22 @@ def configure_msvc(env, manual_msvc_config): if env["target"] == "release": if env["optimize"] == "speed": # optimize for speed (default) - env.Append(CCFLAGS=["/O2"]) + env.Append(CCFLAGS=["/O2", "/MP"]) else: # optimize for size - env.Append(CCFLAGS=["/O1"]) + env.Append(CCFLAGS=["/O1", "/MP"]) env.Append(LINKFLAGS=["/ENTRY:mainCRTStartup"]) env.Append(LINKFLAGS=["/OPT:REF"]) elif env["target"] == "release_debug": if env["optimize"] == "speed": # optimize for speed (default) - env.Append(CCFLAGS=["/O2"]) + env.Append(CCFLAGS=["/O2", "/MP"]) else: # optimize for size - env.Append(CCFLAGS=["/O1"]) + env.Append(CCFLAGS=["/O1", "/MP"]) env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(LINKFLAGS=["/OPT:REF"]) elif env["target"] == "debug": - env.AppendUnique(CCFLAGS=["/Z7", "/Od", "/EHsc"]) + env.AppendUnique(CCFLAGS=["/Z7", "/Od", "/EHsc", "/MP"]) env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(LINKFLAGS=["/DEBUG"]) From b5a165a317e6bf279ff075a34328d566f4f5f030 Mon Sep 17 00:00:00 2001 From: Gordon MacPherson Date: Sat, 15 Aug 2020 17:56:17 +0100 Subject: [PATCH 2/4] add tool for debugging... --- core/image.cpp | 2 ++ timecmd.bat | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 timecmd.bat diff --git a/core/image.cpp b/core/image.cpp index e2f353698fea..8ef5a2fc809c 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -94,6 +94,7 @@ void Image::_put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_data, for (uint32_t i = 0; i < p_pixelsize; i++) { p_data[ofs + i] = p_pixel[i]; } + // something new } void Image::_get_pixelb(int p_x, int p_y, uint32_t p_pixelsize, const uint8_t *p_data, uint8_t *p_pixel) { @@ -102,6 +103,7 @@ void Image::_get_pixelb(int p_x, int p_y, uint32_t p_pixelsize, const uint8_t *p for (uint32_t i = 0; i < p_pixelsize; i++) { p_pixel[i] = p_data[ofs + i]; } + // something else } int Image::get_format_pixel_size(Format p_format) { diff --git a/timecmd.bat b/timecmd.bat new file mode 100644 index 000000000000..0d738287f5e2 --- /dev/null +++ b/timecmd.bat @@ -0,0 +1,26 @@ +@echo off +@setlocal + +set start=%time% + +:: Runs your command +cmd /c %* + +set end=%time% +set options="tokens=1-4 delims=:.," +for /f %options% %%a in ("%start%") do set start_h=%%a&set /a start_m=100%%b %% 100&set /a start_s=100%%c %% 100&set /a start_ms=100%%d %% 100 +for /f %options% %%a in ("%end%") do set end_h=%%a&set /a end_m=100%%b %% 100&set /a end_s=100%%c %% 100&set /a end_ms=100%%d %% 100 + +set /a hours=%end_h%-%start_h% +set /a mins=%end_m%-%start_m% +set /a secs=%end_s%-%start_s% +set /a ms=%end_ms%-%start_ms% +if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%ms% +if %secs% lss 0 set /a mins = %mins% - 1 & set /a secs = 60%secs% +if %mins% lss 0 set /a hours = %hours% - 1 & set /a mins = 60%mins% +if %hours% lss 0 set /a hours = 24%hours% +if 1%ms% lss 100 set ms=0%ms% + +:: Mission accomplished +set /a totalsecs = %hours%*3600 + %mins%*60 + %secs% +echo command took %hours%:%mins%:%secs%.%ms% (%totalsecs%.%ms%s total) From e8d7c68e2c07480b7b6bb0f5efda915d1416f5d9 Mon Sep 17 00:00:00 2001 From: Gordon MacPherson Date: Sat, 15 Aug 2020 18:25:43 +0100 Subject: [PATCH 3/4] Improved some linker options to not make them redundantly --- platform/windows/detect.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 680af629ecf3..a2e84179ba68 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -180,30 +180,30 @@ def configure_msvc(env, manual_msvc_config): if env["target"] == "release": if env["optimize"] == "speed": # optimize for speed (default) - env.Append(CCFLAGS=["/O2", "/MP"]) + env.Append(CCFLAGS=["/O2"]) else: # optimize for size - env.Append(CCFLAGS=["/O1", "/MP"]) + env.Append(CCFLAGS=["/O1"]) env.Append(LINKFLAGS=["/ENTRY:mainCRTStartup"]) env.Append(LINKFLAGS=["/OPT:REF"]) elif env["target"] == "release_debug": if env["optimize"] == "speed": # optimize for speed (default) - env.Append(CCFLAGS=["/O2", "/MP"]) + env.Append(CCFLAGS=["/O2"]) else: # optimize for size - env.Append(CCFLAGS=["/O1", "/MP"]) + env.Append(CCFLAGS=["/O1"]) env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(LINKFLAGS=["/OPT:REF"]) elif env["target"] == "debug": - env.AppendUnique(CCFLAGS=["/Z7", "/Od", "/EHsc", "/MP"]) + env.AppendUnique(CCFLAGS=["/Z7", "/Od", "/EHsc"]) env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) - env.Append(LINKFLAGS=["/DEBUG"]) + env.Append(LINKFLAGS=["/DEBUG:fastlink"]) - env.Append(LINKFLAGS=["/SUBSYSTEM:WINDOWS"]) + env.Append(LINKFLAGS=["/MT16", "/SUBSYSTEM:WINDOWS"]) if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": env.AppendUnique(CCFLAGS=["/Z7"]) - env.AppendUnique(LINKFLAGS=["/DEBUG"]) + env.AppendUnique(LINKFLAGS=["/DEBUG:fastlink"]) ## Compile/link flags From 00256ef150fe11f44ef8b4c1c12ea181f99f4540 Mon Sep 17 00:00:00 2001 From: Gordon MacPherson Date: Sun, 16 Aug 2020 20:10:21 +0100 Subject: [PATCH 4/4] Update detect.py --- platform/windows/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index a2e84179ba68..b46b87d03f7c 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -199,7 +199,7 @@ def configure_msvc(env, manual_msvc_config): env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(LINKFLAGS=["/DEBUG:fastlink"]) - env.Append(LINKFLAGS=["/MT16", "/SUBSYSTEM:WINDOWS"]) + env.Append(LINKFLAGS=["/SUBSYSTEM:WINDOWS"]) if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": env.AppendUnique(CCFLAGS=["/Z7"])