leijurv left a comment (osm2pgsql-dev/osm2pgsql#2503)

Thank you for the review!
- We can't compile out the decision entirely, because the format is picked per 
table at runtime, so a template would relocate the branch not eliminate it. 
Because `add_column` is a member template, we can't use a virtual function 
there. For performance, the current branch should be perfectly predicted. The 
binary encoding could be relocated into its own class so that there is less 
interleaving though if that reads better?
- Good point: 
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2503/changes/9e807483e6f19248a7af27f804a98b6bd0caccdd
- Good point again: 
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2503/changes/9e807483e6f19248a7af27f804a98b6bd0caccdd
- The `optional` has a small win in that it keeps a "no binary representation" 
sentinel/marker value out of a table's list of column types. If you like I can 
add an extra enum `copy_field_type::none` bu then every switch in the encoder 
would have to reject it. But that's not really expensive as it would fall 
through to `throw_type_mismatch`. This only affects `binary_copy_type` and two 
callers.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2503#issuecomment-5848110739
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/pull/2503/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving

Reply via email to