[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 5336: Remove downcasting methods from Grob_array and Grob_info

From: Carl . D . Sorensen
Subject: Re: Issue 5336: Remove downcasting methods from Grob_array and Grob_info (issue 344010043 by address@hidden)
Date: Tue, 12 Jun 2018 15:18:41 -0700


Thanks for the feedback.  I appreciate it.

I'm still not convinced that pulling the dynamic casts out of the
getter/setter pair is better.

You talk about performance penalties of dynamic casting.  But your
profiling shows that dynamic casting took about 1% of the processing
time.  Even if you could reduce dynamic casting by 90% (which seems
unlikely), you'd only reduce execution time by 0.9%, which seems pretty

The tradeoff of having people know about dynamic casting and using it
properly needs to be matched with people not needing to know about
dynamic casting and being able to ignore it.  It seems to me that unless
there is a significant mistake that is made by code that doesn't know
about the dynamic cast, it's better off to hide it.  In fact, it seems
to me that it would be possible (and maybe preferable) to put necessary
error checking once in the setter/getter, rather than having to recreate
it multiple times throughout the code base.

If dynamic casting were taking up 50% of the process time, or errors in
using dynamic casting were responsible for large numbers of bugs, I
might feel different.  But to me, the benefits I understand from your
explanation seem to be not worth the cost of having dynamic casts show
up in 21 different files.

As I said before, I'm not asking for a reversion.  I think I just have a
different tradeoff value model than you have.

Thanks for your explanation,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]