Added a simple benchmark of wxLogDebug() and wxLogTrace().
Measure time taken by these calls when the debug/trace messages are not enabled. See #11829. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		| @@ -48,6 +48,7 @@ BENCH_OBJECTS =  \ | ||||
| 	bench_htmlpars.o \ | ||||
| 	bench_htmltag.o \ | ||||
| 	bench_ipcclient.o \ | ||||
| 	bench_log.o \ | ||||
| 	bench_mbconv.o \ | ||||
| 	bench_strings.o \ | ||||
| 	bench_tls.o \ | ||||
| @@ -146,6 +147,9 @@ bench_htmltag.o: $(srcdir)/htmlparser/htmltag.cpp | ||||
| bench_ipcclient.o: $(srcdir)/ipcclient.cpp | ||||
| 	$(CXXC) -c -o $@ $(BENCH_CXXFLAGS) $(srcdir)/ipcclient.cpp | ||||
|  | ||||
| bench_log.o: $(srcdir)/log.cpp | ||||
| 	$(CXXC) -c -o $@ $(BENCH_CXXFLAGS) $(srcdir)/log.cpp | ||||
|  | ||||
| bench_mbconv.o: $(srcdir)/mbconv.cpp | ||||
| 	$(CXXC) -c -o $@ $(BENCH_CXXFLAGS) $(srcdir)/mbconv.cpp | ||||
|  | ||||
|   | ||||
| @@ -15,6 +15,7 @@ | ||||
|             htmlparser/htmlpars.cpp | ||||
|             htmlparser/htmltag.cpp | ||||
|             ipcclient.cpp | ||||
|             log.cpp | ||||
|             mbconv.cpp | ||||
|             strings.cpp | ||||
|             tls.cpp | ||||
|   | ||||
| @@ -255,6 +255,10 @@ SOURCE=.\ipcclient.cpp | ||||
| # End Source File | ||||
| # Begin Source File | ||||
|  | ||||
| SOURCE=.\log.cpp | ||||
| # End Source File | ||||
| # Begin Source File | ||||
|  | ||||
| SOURCE=.\mbconv.cpp | ||||
| # End Source File | ||||
| # Begin Source File | ||||
|   | ||||
| @@ -556,6 +556,9 @@ | ||||
| 			<File | ||||
| 				RelativePath=".\ipcclient.cpp"> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\log.cpp"> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\mbconv.cpp"> | ||||
| 			</File> | ||||
|   | ||||
| @@ -44,14 +44,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				MinimalRebuild="true" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| @@ -70,7 +70,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -141,14 +141,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -164,7 +164,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -237,14 +237,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				MinimalRebuild="true" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| @@ -263,7 +263,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -334,14 +334,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -357,7 +357,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -430,14 +430,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				MinimalRebuild="true" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| @@ -456,7 +456,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -527,14 +527,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -550,7 +550,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -623,14 +623,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				MinimalRebuild="true" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| @@ -649,7 +649,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -720,14 +720,14 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -743,7 +743,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -823,6 +823,10 @@ | ||||
| 				RelativePath=".\ipcclient.cpp" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\log.cpp" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\mbconv.cpp" | ||||
| 				> | ||||
|   | ||||
| @@ -44,7 +44,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -52,7 +52,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| @@ -69,7 +69,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -137,7 +137,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -145,7 +145,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -160,7 +160,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -230,7 +230,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -238,7 +238,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| @@ -255,7 +255,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -323,7 +323,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -331,7 +331,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -346,7 +346,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -416,7 +416,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -424,7 +424,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| @@ -441,7 +441,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -509,7 +509,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -517,7 +517,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -532,7 +532,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -602,7 +602,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -610,7 +610,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivud;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| @@ -627,7 +627,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_DEBUG;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivud;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -695,7 +695,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| 			<Tool | ||||
| @@ -703,7 +703,7 @@ | ||||
| 				AdditionalOptions="/MP" | ||||
| 				Optimization="2" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivu;.\..\..\include;." | ||||
| 				PreprocessorDefinitions="WIN32;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				ExceptionHandling="1" | ||||
| 				RuntimeLibrary="2" | ||||
| 				RuntimeTypeInfo="true" | ||||
| @@ -718,7 +718,7 @@ | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE=1;_CRT_NON_CONFORMING_SWPRINTFS=1;_SCL_SECURE_NO_WARNINGS=1;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXUSINGDLL;_CONSOLE;wxUSE_GUI=0" | ||||
| 				Culture="1033" | ||||
| 				AdditionalIncludeDirectories=".\..\..\lib\vc_dll\mswunivu;.\..\..\include;." | ||||
| 			/> | ||||
| @@ -795,6 +795,10 @@ | ||||
| 				RelativePath=".\ipcclient.cpp" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\log.cpp" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath=".\mbconv.cpp" | ||||
| 				> | ||||
|   | ||||
							
								
								
									
										109
									
								
								tests/benchmarks/log.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										109
									
								
								tests/benchmarks/log.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,109 @@ | ||||
| ///////////////////////////////////////////////////////////////////////////// | ||||
| // Name:        tests/benchmarks/log.cpp | ||||
| // Purpose:     Log-related benchmarks | ||||
| // Author:      Vadim Zeitlin | ||||
| // Created:     2012-01-21 | ||||
| // RCS-ID:      $Id$ | ||||
| // Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org> | ||||
| // Licence:     wxWindows licence | ||||
| ///////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| #include "bench.h" | ||||
|  | ||||
| #include "wx/log.h" | ||||
|  | ||||
| // This class is used to check that the arguments of log functions are not | ||||
| // evaluated. | ||||
| struct NotCreated | ||||
| { | ||||
|     NotCreated() { wxAbort(); } | ||||
|  | ||||
|     const char* AsStr() const { return "unreachable"; } | ||||
| }; | ||||
|  | ||||
| // Temporarily change the log level to the given one. | ||||
| class LogLevelSetter | ||||
| { | ||||
| public: | ||||
|     LogLevelSetter(wxLogLevel levelNew) | ||||
|         : m_levelOld(wxLog::GetLogLevel()) | ||||
|     { | ||||
|         wxLog::SetLogLevel(levelNew); | ||||
|     } | ||||
|  | ||||
|     ~LogLevelSetter() | ||||
|     { | ||||
|         wxLog::SetLogLevel(m_levelOld); | ||||
|     } | ||||
|  | ||||
| private: | ||||
|     const wxLogLevel m_levelOld; | ||||
|  | ||||
|     wxDECLARE_NO_COPY_CLASS(LogLevelSetter); | ||||
| }; | ||||
|  | ||||
| BENCHMARK_FUNC(LogDebugDisabled) | ||||
| { | ||||
|     LogLevelSetter level(wxLOG_Info); | ||||
|  | ||||
|     wxLogDebug("Ignored debug message: %s", NotCreated().AsStr()); | ||||
|  | ||||
|     return true; | ||||
| } | ||||
|  | ||||
| BENCHMARK_FUNC(LogTraceDisabled) | ||||
| { | ||||
|     LogLevelSetter level(wxLOG_Info); | ||||
|  | ||||
|     wxLogTrace("", NotCreated().AsStr()); | ||||
|  | ||||
|     return true; | ||||
| } | ||||
|  | ||||
| BENCHMARK_FUNC(LogTraceActive) | ||||
| { | ||||
|     static bool s_added = false; | ||||
|     if ( !s_added ) | ||||
|     { | ||||
|         s_added = true; | ||||
|         wxLog::AddTraceMask("logbench"); | ||||
|     } | ||||
|  | ||||
|     // Remove the actual logging overhead by simply throwing away the log | ||||
|     // messages. | ||||
|     class NulLog : public wxLog | ||||
|     { | ||||
|     public: | ||||
|         NulLog() | ||||
|             : m_logOld(wxLog::SetActiveTarget(this)) | ||||
|         { | ||||
|         } | ||||
|  | ||||
|         virtual ~NulLog() | ||||
|         { | ||||
|             wxLog::SetActiveTarget(m_logOld); | ||||
|         } | ||||
|  | ||||
|     protected: | ||||
|         virtual void DoLogRecord(wxLogLevel, | ||||
|                                  const wxString&, | ||||
|                                  const wxLogRecordInfo&) | ||||
|         { | ||||
|         } | ||||
|  | ||||
|         wxLog* m_logOld; | ||||
|     }; | ||||
|  | ||||
|     NulLog nulLog; | ||||
|  | ||||
|     wxLogTrace("logbench", "Trace message"); | ||||
|  | ||||
|     return true; | ||||
| } | ||||
|  | ||||
| BENCHMARK_FUNC(LogTraceInactive) | ||||
| { | ||||
|     wxLogTrace("bloordyblop", "Trace message"); | ||||
|  | ||||
|     return true; | ||||
| } | ||||
| @@ -41,6 +41,7 @@ BENCH_OBJECTS =  \ | ||||
| 	$(OBJS)\bench_htmlpars.obj \ | ||||
| 	$(OBJS)\bench_htmltag.obj \ | ||||
| 	$(OBJS)\bench_ipcclient.obj \ | ||||
| 	$(OBJS)\bench_log.obj \ | ||||
| 	$(OBJS)\bench_mbconv.obj \ | ||||
| 	$(OBJS)\bench_strings.obj \ | ||||
| 	$(OBJS)\bench_tls.obj \ | ||||
| @@ -225,6 +226,9 @@ $(OBJS)\bench_htmltag.obj: .\htmlparser\htmltag.cpp | ||||
| $(OBJS)\bench_ipcclient.obj: .\ipcclient.cpp | ||||
| 	$(CXX) -q -c -P -o$@ $(BENCH_CXXFLAGS) .\ipcclient.cpp | ||||
|  | ||||
| $(OBJS)\bench_log.obj: .\log.cpp | ||||
| 	$(CXX) -q -c -P -o$@ $(BENCH_CXXFLAGS) .\log.cpp | ||||
|  | ||||
| $(OBJS)\bench_mbconv.obj: .\mbconv.cpp | ||||
| 	$(CXX) -q -c -P -o$@ $(BENCH_CXXFLAGS) .\mbconv.cpp | ||||
|  | ||||
|   | ||||
| @@ -34,6 +34,7 @@ BENCH_OBJECTS =  \ | ||||
| 	$(OBJS)\bench_htmlpars.o \ | ||||
| 	$(OBJS)\bench_htmltag.o \ | ||||
| 	$(OBJS)\bench_ipcclient.o \ | ||||
| 	$(OBJS)\bench_log.o \ | ||||
| 	$(OBJS)\bench_mbconv.o \ | ||||
| 	$(OBJS)\bench_strings.o \ | ||||
| 	$(OBJS)\bench_tls.o \ | ||||
| @@ -211,6 +212,9 @@ $(OBJS)\bench_htmltag.o: ./htmlparser/htmltag.cpp | ||||
| $(OBJS)\bench_ipcclient.o: ./ipcclient.cpp | ||||
| 	$(CXX) -c -o $@ $(BENCH_CXXFLAGS) $(CPPDEPS) $< | ||||
|  | ||||
| $(OBJS)\bench_log.o: ./log.cpp | ||||
| 	$(CXX) -c -o $@ $(BENCH_CXXFLAGS) $(CPPDEPS) $< | ||||
|  | ||||
| $(OBJS)\bench_mbconv.o: ./mbconv.cpp | ||||
| 	$(CXX) -c -o $@ $(BENCH_CXXFLAGS) $(CPPDEPS) $< | ||||
|  | ||||
|   | ||||
| @@ -35,6 +35,7 @@ BENCH_OBJECTS =  \ | ||||
| 	$(OBJS)\bench_htmlpars.obj \ | ||||
| 	$(OBJS)\bench_htmltag.obj \ | ||||
| 	$(OBJS)\bench_ipcclient.obj \ | ||||
| 	$(OBJS)\bench_log.obj \ | ||||
| 	$(OBJS)\bench_mbconv.obj \ | ||||
| 	$(OBJS)\bench_strings.obj \ | ||||
| 	$(OBJS)\bench_tls.obj \ | ||||
| @@ -312,6 +313,9 @@ $(OBJS)\bench_htmltag.obj: .\htmlparser\htmltag.cpp | ||||
| $(OBJS)\bench_ipcclient.obj: .\ipcclient.cpp | ||||
| 	$(CXX) /c /nologo /TP /Fo$@ $(BENCH_CXXFLAGS) .\ipcclient.cpp | ||||
|  | ||||
| $(OBJS)\bench_log.obj: .\log.cpp | ||||
| 	$(CXX) /c /nologo /TP /Fo$@ $(BENCH_CXXFLAGS) .\log.cpp | ||||
|  | ||||
| $(OBJS)\bench_mbconv.obj: .\mbconv.cpp | ||||
| 	$(CXX) /c /nologo /TP /Fo$@ $(BENCH_CXXFLAGS) .\mbconv.cpp | ||||
|  | ||||
|   | ||||
| @@ -230,6 +230,7 @@ BENCH_OBJECTS =  & | ||||
| 	$(OBJS)\bench_htmlpars.obj & | ||||
| 	$(OBJS)\bench_htmltag.obj & | ||||
| 	$(OBJS)\bench_ipcclient.obj & | ||||
| 	$(OBJS)\bench_log.obj & | ||||
| 	$(OBJS)\bench_mbconv.obj & | ||||
| 	$(OBJS)\bench_strings.obj & | ||||
| 	$(OBJS)\bench_tls.obj & | ||||
| @@ -283,6 +284,9 @@ $(OBJS)\bench_htmltag.obj :  .AUTODEPEND .\htmlparser\htmltag.cpp | ||||
| $(OBJS)\bench_ipcclient.obj :  .AUTODEPEND .\ipcclient.cpp | ||||
| 	$(CXX) -bt=nt -zq -fo=$^@ $(BENCH_CXXFLAGS) $< | ||||
|  | ||||
| $(OBJS)\bench_log.obj :  .AUTODEPEND .\log.cpp | ||||
| 	$(CXX) -bt=nt -zq -fo=$^@ $(BENCH_CXXFLAGS) $< | ||||
|  | ||||
| $(OBJS)\bench_mbconv.obj :  .AUTODEPEND .\mbconv.cpp | ||||
| 	$(CXX) -bt=nt -zq -fo=$^@ $(BENCH_CXXFLAGS) $< | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user