aboutsummaryrefslogtreecommitdiff
path: root/src/old
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-05-17 21:45:50 +0000
committerMike Buland <eichlan@xagasoft.com>2007-05-17 21:45:50 +0000
commit326125aee0b8cd807a6a1d158398078ff6bfb1e1 (patch)
tree01ce1ba9d6b551ac621c73276eeb23268d315f43 /src/old
parente0e7932a122614a0ff566fbfd8de5776de8b9f6d (diff)
downloadlibbu++-326125aee0b8cd807a6a1d158398078ff6bfb1e1.tar.gz
libbu++-326125aee0b8cd807a6a1d158398078ff6bfb1e1.tar.bz2
libbu++-326125aee0b8cd807a6a1d158398078ff6bfb1e1.tar.xz
libbu++-326125aee0b8cd807a6a1d158398078ff6bfb1e1.zip
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.
Diffstat (limited to 'src/old')
-rw-r--r--src/old/tests/fstring.cpp48
1 files changed, 0 insertions, 48 deletions
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 @@
1#include "hash.h"
2#include "fstring.h"
3
4FString genThing()
5{
6 FString bob;
7 bob.append("ab ");
8 bob += "cd ";
9 bob += "efg";
10
11 printf("---bob------\n%08X: %s\n", (unsigned int)bob.c_str(), bob.c_str() );
12 return bob;
13}
14
15void thing( FString str )
16{
17 printf("Hey: %s\n", str.c_str() );
18}
19
20#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() );
21int main( int argc, char *argv )
22{
23 FString str("th");
24
25 str.prepend("Hello ");
26 str.append("ere.");
27
28 FString str2( str );
29 pem;
30 str += " What's up?";
31 pem;
32 str2 += " How are you?";
33 pem;
34 str = str2;
35 pem;
36
37 str2 = genThing();
38 pem;
39
40 str = str2;
41 pem;
42
43 thing( str2 );
44 thing("test.");
45
46 printf("%d == %d\n", __calcHashCode( str ), __calcHashCode( str.c_str() ) );
47}
48