diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-06-15 13:27:59 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-06-15 13:27:59 +0000 |
commit | 7ea5c06059ee6668d6e6d04c3b3dcb8557061696 (patch) | |
tree | 9ae2f93d09346c0272240015443e1a2bc660dd68 /src/tests/bigmyriad.cpp | |
parent | 026cd6f71a15edd1a242c59d5cb9f8271a108506 (diff) | |
download | libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.tar.gz libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.tar.bz2 libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.tar.xz libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.zip |
Bu::Myriad now only uses BitString during initialization, and I'm going to
replace that with just an array, no problem. It's many, many, many times
faster while streams are growing, and it should be constant time, not linear
like it was before.
It also handles myriad files in excess of 2gb correctly now, at least, it
seems to just fine :)
Diffstat (limited to '')
-rw-r--r-- | src/tests/bigmyriad.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/bigmyriad.cpp b/src/tests/bigmyriad.cpp new file mode 100644 index 0000000..6661bf1 --- /dev/null +++ b/src/tests/bigmyriad.cpp | |||
@@ -0,0 +1,25 @@ | |||
1 | #include <bu/myriad.h> | ||
2 | #include <bu/myriadstream.h> | ||
3 | #include <bu/file.h> | ||
4 | |||
5 | int main() | ||
6 | { | ||
7 | Bu::File f("big.myr", Bu::File::Read|Bu::File::Write|Bu::File::Create ); | ||
8 | Bu::Myriad m( f, 2048 ); | ||
9 | |||
10 | char *buf = new char[1024*1024*10]; | ||
11 | memset( buf, 0, 1024*1024*10 ); | ||
12 | |||
13 | for( int j = 0; j < 250; j++ ) | ||
14 | { | ||
15 | m.openStream( m.createStream() ).write( buf, 1024*1024*10 ); | ||
16 | // m.sync(); | ||
17 | printf("\r%03d%%", (j+1)*100/250 ); | ||
18 | fflush( stdout ); | ||
19 | } | ||
20 | |||
21 | printf("\n\n"); | ||
22 | |||
23 | return 0; | ||
24 | } | ||
25 | |||