For some reason std:: string/vector memory is much slower!

This commit is contained in:
Alex Hultman
2018-06-24 15:40:12 +02:00
parent 377d1b3ee0
commit 2be613d40b
5 changed files with 82 additions and 24 deletions
+5 -1
View File
@@ -6,14 +6,18 @@
#include <new>
#include <string_view>
#include <iostream>
#include <unistd.h>
namespace uWS {
struct Loop {
us_loop *loop;
static const int CORK_BUFFER_SIZE = 16 * 1024;
static const int MAX_COPY_DISTANCE = 4 * 1024;
struct Data {
char *corkBuffer = new char[1024];
char *corkBuffer = new char[CORK_BUFFER_SIZE];
int corkOffset = 0;
Data() {