Use Advanced Search to search the entire archive.
Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory
- From: Otávio Gonçalves de Santana <
>
- To:
- Subject: Re: [VOTE] Should a Quantities facade return Quantity or QuantityFactory
- Date: Fri, 31 Oct 2014 08:37:58 -0200
The Class.cast is a wrapper, so it is a slight slower than conventional.
On Oct 31, 2014 8:31 AM, "Martin Desruisseaux" <
>
wrote:
>
Hello Werner
>
>
Le 31/10/14 18:42, Werner Keil a écrit :
>
>
That's a good Point. While the line of code in your own test is usually
>
very vital, one would rarely debug or try to fix a core type like Class in
>
Java itself (even for OpenJDK that is highly unlikely to happen[?])
>
>
I would not said that this is debugging Class. Those Class methods work
>
very well for what they are designed for (i.e. type unknown at
>
compile-time). It is just a matter of using the right tools for the right
>
job.
>
>
I have not micro-benchmarked the code, but I would also expect the
>
Class.cast / Class.isInstance variants to be slower than the classical
>
approach, especially on platforms that do not have all the optimization
>
capabilities of Hotspot.
>
>
Martin
>
>
Attachment:
338.gif
Description: GIF image