C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Benchmarking contract evaluation semantics mode "assume" in Eigen.

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 02 Apr 2026 11:15:19 -0700
On Thursday, 2 April 2026 10:27:03 Pacific Daylight Time Mark Hoemmen via Std-
Proposals wrote:
> > And as found by Adrian in the first post in the thread, turning all
> > assertions into assumptions can hurt performance as much as it can help.
> > You should use assumptions more conservatively, in targeted places where
> > profiling has shown that it matters. See also
> > https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609
> Right, for sure, I definitely don't mean that contract assertions
> should ALWAYS be followed by assumptions.

I would hope they are almost never followed by the exact same assumption. The
information is already there. The compiler should be able to use it.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2026-04-02 18:15:25