Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More compact format #2

Open
splitice opened this issue Oct 22, 2020 · 1 comment
Open

More compact format #2

splitice opened this issue Oct 22, 2020 · 1 comment

Comments

@splitice
Copy link

splitice commented Oct 22, 2020

Currently JSON is used for serialization. This leads to alot of additional space to represent an object. A more compact format might perform better through reducing the number of blocks that need to be written (and possibly encrypted) on disk.

SHORT LINE (amd64):

real    0m14.598s
user    0m0.000s
sys     0m5.584s

LONG LINE (amd64):

real    0m17.016s
user    0m0.000s
sys     0m5.706s

These tests were performed under considerable existing load (consistent between tests)

Code:

#include <stdio.h>
#include <unistd.h>

#define LINE "through or flushing a disk cache if present. The call blocks until the device reports that the transfer has test line\n"

void main(){
        FILE* fp = fopen("write-test.bin", "w");
        for(int i=0;i<10000;i++){
                fwrite(LINE, 1, sizeof(LINE), fp);
                fdatasync(fileno(fp));
        }
        fclose(fp);
}

Indicates that ~15% could be gained by reducing the LINE by 70% (best case)

@splitice
Copy link
Author

Armv7 shows even more savings from a reduction in disk storage.

LONG LINE (armv7):

real    0m4.056s
user    0m0.024s
sys     0m0.383s

SHORT LINE (armv7):

real    0m0.864s
user    0m0.001s
sys     0m0.114s

Difference is even more pronounced here!

This is likely because the CPU cost of encrypting the data is of significantly higher cost. The disk is also considerably slower under high rate transfer so further savings expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant