[Bf-blender-cvs] [62ac065] fracture_modifier: fix for windows only: avoiding changing the global locale avoids slowdown in windows string operations

Martin Felke noreply at git.blender.org
Sun Jan 24 13:03:38 CET 2016


Commit: 62ac065a4c8082233627031e59c2e9bca9e0e88b
Author: Martin Felke
Date:   Sun Jan 24 13:02:34 2016 +0100
Branches: fracture_modifier
https://developer.blender.org/rB62ac065a4c8082233627031e59c2e9bca9e0e88b

fix for windows only: avoiding changing the global locale avoids slowdown in windows string operations

===================================================================

M	intern/cycles/util/util_path.cpp

===================================================================

diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp
index e8f1ec8..fb45d7c 100644
--- a/intern/cycles/util/util_path.cpp
+++ b/intern/cycles/util/util_path.cpp
@@ -69,7 +69,13 @@ void path_init(const string& path, const string& user_path)
 
 #ifdef _MSC_VER
 	// fix for https://svn.boost.org/trac/boost/ticket/6320
-	boost::filesystem::path::imbue( std::locale( "" ) );
+
+	/* Note, std::locale("") changes the global locale under windows and this causes a slowdown in
+	 * string operations, noticeable when creating many objects for example,
+	 * so changing to std::locale::classic() instead, seems to work with umlauts for example, too,
+	 * this was a fix for https://developer.blender.org/T37817 */
+
+	boost::filesystem::path::imbue( std::locale::classic() );
 #endif
 }




More information about the Bf-blender-cvs mailing list