Skip to content

Conversation

@f8k8
Copy link

@f8k8 f8k8 commented Jun 9, 2021

This is a rewrite to address the performance issues with the library. Originally, the library would read single characters from the file and create a lot of temporary strings. This rewrite reads the file in chunks of up to 16KiB depending on the file size, pushes the data into an array while counting new lines, then finally reverses the array. It's possible that further performance improvements could be gained for large line counts depending on how arrays are handled internally in Node when pushing / reversing, but I haven't looked into that so far.

This should help with #26

commit c74e614432a1fb0ade7dfc9d9dac6cab0582f26e
Author: Andrew Porritt <aporritt@gogo-robot.com>
Date:   Wed Jun 9 12:59:06 2021 +0100

    Fix quotes

commit 3d74cc65dfaf2178c5c233b0dc8c766d559527a3
Author: Andrew Porritt <aporritt@gogo-robot.com>
Date:   Wed Jun 9 12:55:49 2021 +0100

    Rewrite to improve performance
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.

1 participant