[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Java generics (was Re: [computer-go] Chains and liberties)
> The Java 1.5 generic types are used to check type safety at compile
> time. They are not kept around at run time, so they don't cause any
> performance hit.
Correct. There is no performance hit between a Generic and a non-Generic
Java collection, but no speedup is achieved either (like in other
languages).
Both in C++ and C#, a templated version will be faster because type info is
not thrown away and dynamic casts can be avoided (among other
optimizations). In Java, all the dynamic casts still need to be done (java
generics are just syntactic sugar).
-Yonik
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/