ufl team mailing list archive
-
ufl team
-
Mailing list archive
-
Message #00678
Re: Alternative faster assertion method
On Wednesday 04 February 2009 10:42:12 Martin Sandve Alnæs wrote:
> I won't change the code everywhere to do this now,
> but if profiling in the future shows all the ufl_assert
> calls to take significant time, we can do this:
>
> isinstance(a, Expr) or error("Expecting Expr instance.")
>
> instead of this:
>
> ufl_assert(isinstance(a, Expr), "Expecting Expr instance.")
>
> They do exactly the same, the length is about the same,
> but the former is much cheaper as long as it doesn't trigger.
Some annoying questions ;)
How much is much and how does this compare to all other things you are doing?
Johan
> Martin
> _______________________________________________
> UFL-dev mailing list
> UFL-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/ufl-dev
Follow ups
References