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

Improve write time by using a byte lookup table #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

M4GNV5
Copy link

@M4GNV5 M4GNV5 commented Mar 27, 2017

Using this patch reduces file write time drastically.
Old startup time: 0.011s, new startup time: 0.382s
Old file write time: 11.938s. new file write time: 0.005s

Thats a 2387.6x speed increase!

Write output to a buffer first before calling write would probably speed this up even further.

Contents of the file i used for testing the speed:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Tests were run on an Intel i5-6600K @ 3.5GHz running Debian 9 with Linux 4.9.13-1

This is somehow related to #48 however #48 is actually wrong as for writing a lookup table with 256 entries is enough

@typecasto
Copy link

Just for comparison, what are the file sizes of the input/output? Could we do it with 2 bytes instead of just 1?

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

Successfully merging this pull request may close these issues.

2 participants