From 326125aee0b8cd807a6a1d158398078ff6bfb1e1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 17 May 2007 21:45:50 +0000 Subject: As evidenced by my latest test, the Bu::FString copy is actually slower than the std::string copy by a rather large margin. This seems very odd, so I'm going to do a few tests, the first one is stripping out the FString shared pointer stuff and seeing if that makes an appreciable difference. --- src/old/tests/fstring.cpp | 48 ----------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/old/tests/fstring.cpp (limited to 'src/old/tests') diff --git a/src/old/tests/fstring.cpp b/src/old/tests/fstring.cpp deleted file mode 100644 index 271738c..0000000 --- a/src/old/tests/fstring.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "hash.h" -#include "fstring.h" - -FString genThing() -{ - FString bob; - bob.append("ab "); - bob += "cd "; - bob += "efg"; - - printf("---bob------\n%08X: %s\n", (unsigned int)bob.c_str(), bob.c_str() ); - return bob; -} - -void thing( FString str ) -{ - printf("Hey: %s\n", str.c_str() ); -} - -#define pem printf("---------\n%08X: %s\n%08X: %s\n", (unsigned int)str.c_str(), str.c_str(), (unsigned int)str2.c_str(), str2.c_str() ); -int main( int argc, char *argv ) -{ - FString str("th"); - - str.prepend("Hello "); - str.append("ere."); - - FString str2( str ); - pem; - str += " What's up?"; - pem; - str2 += " How are you?"; - pem; - str = str2; - pem; - - str2 = genThing(); - pem; - - str = str2; - pem; - - thing( str2 ); - thing("test."); - - printf("%d == %d\n", __calcHashCode( str ), __calcHashCode( str.c_str() ) ); -} - -- cgit v1.2.3