properties icon indicating copy to clipboard operation
properties copied to clipboard

Parsing is substantially slower than I'd expect

Open nex3 opened this issue 4 years ago • 1 comments

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 avatar Jul 23 '20 22:07 nex3

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

sdumjahn avatar Aug 05 '20 13:08 sdumjahn