Skip Navigation

weiznich

@weiznich.programming.dev.ap.tdpl.io

1 Posts2 Comments0 Memberships

Joined November 2026

  • rust Diesel 2.4.0

    At least #[auto_type] and using BoxableExpression as trait bound doesn't need any boxing at all. That written, as others already pointed out: Boxing and dyn dispatch are sometimes the right solution. You also should keep in mind that in most cases the performance penalty of the allocation or the indirect function call is not significant compared to say a network roundtrip or an io operation. The only situation with Diesel queries where I found that allocations matter are for hot loops of trivial queries on an in memory SQLite database connection. There it costs you around 50% of performance. Otherwise you won't notice much difference.

    1 1