Skip to content

Don't create as many garbage objects during reads - #12

Open
ash211 wants to merge 1 commit into
ogrodnek:masterfrom
ash211:master
Open

Don't create as many garbage objects during reads#12
ash211 wants to merge 1 commit into
ogrodnek:masterfrom
ash211:master

Conversation

@ash211

@ash211 ash211 commented Dec 6, 2013

Copy link
Copy Markdown

The old method of reading a row by creating a new reader for every row is
quite inefficient because it leaves a lot of objects laying around for the
garbage collector. This change creates a CSVParser once and then re-uses it
for every row.

There's a chance this change causes a regression, because CSVSerde is no
longer serializable (CSVParser isn't serializable) but this doesn't seem to be
an issue for me in my testing.

The old method of reading a row by creating a new reader for every row is
quite inefficient because it leaves a lot of objects laying around for the
garbage collector.  This change creates a CSVParser once and then re-uses it
for every row.

There's a chance this change causes a regression, because CSVSerde is no
longer serializable (CSVParser isn't serializable) but this doesn't seem to be
an issue for me in my testing.
@ash211

ash211 commented Dec 6, 2013

Copy link
Copy Markdown
Author

In my preliminary testing, this caused a simple count(*) job of 120-130 sec to go down to 100-110.

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