aboutsummaryrefslogtreecommitdiff
path: root/src/serialize.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-09-09 17:12:21 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2012-09-09 17:24:00 +0200
commitb019ea17ec7cc37d098982b4f0f4636e424ab4b8 (patch)
tree0e22ef1144fb20d05bc0b5dc68918cd8d21b8f5d /src/serialize.h
parenteabc8f2c81712dedd0d93af221e4dbc5b6dede59 (diff)
downloadbitcoin-b019ea17ec7cc37d098982b4f0f4636e424ab4b8.tar.xz
Remove VC6 comment and pointless #ifdef'd benchmark code
We're in a wholly different world now, C++-compiler-wise. Current std::stringstream implementations don't have the stated problem anymore, and are just as fast as CDataStream. The #ifdef'd block does not even compile anymore; CDataStream constructor changed, and missing some std::. Also timing in whole seconds is also way too granular to say anything sensible in such microbenchmarks. Just remove it, it can always be found again in git history.
Diffstat (limited to 'src/serialize.h')
-rw-r--r--src/serialize.h52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/serialize.h b/src/serialize.h
index abc4f04a0d..63df3160a6 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -243,7 +243,6 @@ uint64 ReadCompactSize(Stream& is)
#define FLATDATA(obj) REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj)))
/** Wrapper for serializing arrays and POD.
- * There's a clever template way to make arrays serialize normally, but MSVC6 doesn't support it.
*/
class CFlatData
{
@@ -1010,57 +1009,6 @@ public:
}
};
-#ifdef TESTCDATASTREAM
-// VC6sp6
-// CDataStream:
-// n=1000 0 seconds
-// n=2000 0 seconds
-// n=4000 0 seconds
-// n=8000 0 seconds
-// n=16000 0 seconds
-// n=32000 0 seconds
-// n=64000 1 seconds
-// n=128000 1 seconds
-// n=256000 2 seconds
-// n=512000 4 seconds
-// n=1024000 8 seconds
-// n=2048000 16 seconds
-// n=4096000 32 seconds
-// stringstream:
-// n=1000 1 seconds
-// n=2000 1 seconds
-// n=4000 13 seconds
-// n=8000 87 seconds
-// n=16000 400 seconds
-// n=32000 1660 seconds
-// n=64000 6749 seconds
-// n=128000 27241 seconds
-// n=256000 109804 seconds
-#include <iostream>
-int main(int argc, char *argv[])
-{
- vector<unsigned char> vch(0xcc, 250);
- printf("CDataStream:\n");
- for (int n = 1000; n <= 4500000; n *= 2)
- {
- CDataStream ss;
- time_t nStart = time(NULL);
- for (int i = 0; i < n; i++)
- ss.write((char*)&vch[0], vch.size());
- printf("n=%-10d %d seconds\n", n, time(NULL) - nStart);
- }
- printf("stringstream:\n");
- for (int n = 1000; n <= 4500000; n *= 2)
- {
- stringstream ss;
- time_t nStart = time(NULL);
- for (int i = 0; i < n; i++)
- ss.write((char*)&vch[0], vch.size());
- printf("n=%-10d %d seconds\n", n, time(NULL) - nStart);
- }
-}
-#endif
-