Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/refactor'
Browse files Browse the repository at this point in the history
Signed-off-by: supercmmetry <vishaals2000@gmail.com>
  • Loading branch information
supercmmetry committed Dec 16, 2020
2 parents bcd7095 + 4d70f73 commit 0c54c1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cmake-build-debug
cmake-build-release
.idea
release
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ A simple and fast bitio library for C++

## Benchmarks:

This benchmark was taken on Arch Linux (x86_64), Intel i7-9750H with a 128 KB bitio buffer.
This benchmark was taken on Arch Linux (x86_64), Intel i7-9750H, 1TB HDD (SATA 7200rpm) with a 128 KB bitio buffer.

| Operation | Speed (Megabytes per second) |
| ----------- | ----------- |
| Read | 10.4 |
| Write | 7.5 |
| Seek (SEEK_CUR) | 4.8 |
| Seek To (SEEK_SET) | 167.6 |
| Read | 10.5 |
| Write | 6.7 |
| Seek (SEEK_CUR) | 6.1 |
| Seek To (SEEK_SET) | 58.6 |

2 changes: 1 addition & 1 deletion benchmarks/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void benchmark(bitio::stream *stream) {

// Seek_to operations
start = clock.now();
for (int i = 0; i < 1024; i++) {
for (int i = 0; i < 1048576; i++) {
stream->seek_to(i);
}
auto seek_to_pass_1 = clock.now() - start;
Expand Down
2 changes: 1 addition & 1 deletion src/bitio.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>
#include <mutex>

#define BITIO_BUFFER_SIZE 0x400
#define BITIO_BUFFER_SIZE 0x20000

namespace bitio {
const uint64_t u64_sblmasks[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
Expand Down

0 comments on commit 0c54c1d

Please sign in to comment.