The locks in AttributeStore are necessary only during PBF reading, to avoid concurrent mutations corrupting things.
Once we're writing the mbtiles, it's safe to read without acquiring the lock. This eliminates ~9% of system time, and ~2-3% of wall clock time.
The PR also adds a finalize() to AttributeStore, AttributeKeyStore and AttributePairStore. Nothing actually uses this yet - I initially checked the finalized variable and threw if an unsafe method was called, but that gave up the speed benefits, so I removed it again.
Perhaps in the future, a debug build could leave such checks in to detect programming errors.
The locks in AttributeStore are necessary only during PBF reading, to avoid concurrent mutations corrupting things.
Once we're writing the mbtiles, it's safe to read without acquiring the lock. This eliminates ~9% of system time, and ~2-3% of wall clock time.
The PR also adds a
finalize()
to AttributeStore, AttributeKeyStore and AttributePairStore. Nothing actually uses this yet - I initially checked thefinalized
variable and threw if an unsafe method was called, but that gave up the speed benefits, so I removed it again.Perhaps in the future, a debug build could leave such checks in to detect programming errors.