GH-1432: Use buffered IO for file extraction

This can improve performance significantly: ~3.5x faster when tested on
a large file passing data to the file analysis framework in small chunks
of 20 bytes.
This commit is contained in:
Jon Siwek 2021-03-09 18:22:54 -08:00
parent f2d3bf3037
commit 1c58a2d86b
2 changed files with 61 additions and 10 deletions

View file

@ -3,6 +3,7 @@
#pragma once
#include <string>
#include <cstdio>
#include "zeek/Val.h"
#include "zeek/file_analysis/File.h"
@ -72,7 +73,7 @@ protected:
private:
std::string filename;
int fd;
FILE* file_stream;
uint64_t limit;
uint64_t depth;
};