Skip to content

PERF: to_json very slow with lines=True #14408

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

Closed
joshowen opened this issue Oct 12, 2016 · 1 comment
Closed

PERF: to_json very slow with lines=True #14408

joshowen opened this issue Oct 12, 2016 · 1 comment
Labels
IO JSON read_json, to_json, json_normalize Performance Memory or execution speed performance
Milestone

Comments

@joshowen
Copy link

joshowen commented Oct 12, 2016

A small, complete example of the issue

N = 100000
C = 5

In [6]: df = DataFrame(dict([('float{0}'.format(i), np.random.randn(N)) for i in range(C)]))

In [7]: df.to_json('foo.json',orient='records',lines=True)

In [8]: %timeit df.to_json('foo.json',orient='records',lines=True)
1 loop, best of 3: 3.66 s per loop

In [9]: %timeit df.to_json('foo.json',orient='records')
10 loops, best of 3: 98.8 ms per loop

As discussed in #14391

@jreback jreback added Performance Memory or execution speed performance IO JSON read_json, to_json, json_normalize Difficulty Intermediate labels Oct 12, 2016
@jreback jreback added this to the 0.19.1 milestone Oct 12, 2016
@jreback
Copy link
Contributor

jreback commented Oct 12, 2016

cc @aterrel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO JSON read_json, to_json, json_normalize Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants