Skip to content

Conversation

@NinoFloris
Copy link
Member

Through the eye of the needle

@NinoFloris NinoFloris force-pushed the array-bloat-reduction branch from a981348 to 399861e Compare March 2, 2023 14:59
@NinoFloris NinoFloris force-pushed the array-bloat-reduction branch from efc60e1 to b35bc2a Compare March 2, 2023 16:00
@NinoFloris NinoFloris marked this pull request as ready for review March 2, 2023 18:33
@NinoFloris NinoFloris requested review from roji and vonzshik as code owners March 2, 2023 18:33
Copy link
Contributor

@vonzshik vonzshik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, though I'm not sure whether the casts are necessary.

@roji roji mentioned this pull request Mar 3, 2023
16 tasks
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks, and not as complicated as I feared it might be 😅

Some thoughts:

  • We can make arrays as a whole opt-in via NpgsqlSlimDataSourceBuilder (#4965). At that point reducing the array overhead becomes less important, but this significant size reduction for those who do opt in is still definitely nice to have.
  • On the other hand, this adds some overhead for arrays (concurrent dictionary lookup per array operation, more virtual calls per array element). It could be claimed that if you opt into arrays, you'd rather have them faster and are willing to pay a bit of size for that; though I'm guessing the runtime overhead added here is probably negligible (maybe a benchmark would help).
  • We've been discussing redoing/changing type handlers in general because the current design is problematic/convoluted (e.g. more in the direction of Slon). If we do that, then the churn here may not be worth it.

To be clear I'm totally fine with merging this (though a quick benchmark would be nice), just pointing out some points.

@NinoFloris NinoFloris merged commit 24c056f into npgsql:main Mar 3, 2023
@NinoFloris NinoFloris deleted the array-bloat-reduction branch March 3, 2023 13:49
@Brar Brar added this to the 8.0.0 milestone Nov 21, 2023
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

Successfully merging this pull request may close these issues.

4 participants