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

Parsing is substantially slower than I'd expect #36

Open
nex3 opened this issue Jul 23, 2020 · 1 comment
Open

Parsing is substantially slower than I'd expect #36

nex3 opened this issue Jul 23, 2020 · 1 comment

Comments

@nex3
Copy link

nex3 commented Jul 23, 2020

When presented with properties files that contain thousands of entries, this package can take multiple seconds to parse them. This is substantially slower than a naive line-by-line parse method, and slow enough to make this package infeasible for my use-case.

See this benchmark, which compares properties-reader to a naive solution using string splitting. Here's the output I get:

.read() x 23.15 ops/sec ±1.05% (42 runs sampled)
naive x 2,600 ops/sec ±0.89% (98 runs sampled)
Fastest is naive

I might expect a naive solution to be a bit faster because it needs fewer checks for complex cases like comments and headings, but being two orders of magnitude faster is very surprising.

@nex3 nex3 changed the title Parsing is substantially slower than I'd expected Parsing is substantially slower than I'd expect Jul 23, 2020
@sdumjahn
Copy link

sdumjahn commented Aug 5, 2020

I can confirm this behavior. We have files with about 12k lines and it needs more then 30seconds to read a single file.

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

2 participants