overhead of reflection info
Per Bothner
per@bothner.com
Sat Feb 21 20:24:00 GMT 2004
Adam Megacz wrote:
> I think I'm going to see how far I can get with a patch that disables
> reflection. Getting libgcj to live without it will be a challenge,
> but I think it can be done.
I think such a flag will be worthwhile. I think it would be easier
and do more if you also disable classloading, interpretation, and JNI,
since those are big uses of reflection info.
I'd keep just enough to keep the "JDK 1.0" level of reflection:
Object's getClass() and Class's getName(), plus support for
classcast, instanceof, and method invocation. If you have any
partial patches I'd be happy to help with those.
I wonder whether we should add a flag to disable class initialization?
That would save both time and space, since we don't need to generate
all these tests to check if a class is initialized. However, we'd
have to make sure all classes can be initialized at compile-time,
and reject any non-trivial class initialization code. I don't know
how much of the library should have to be changed - a good chunk,
I suspect, so this is not a trivial change. We'd also have to figure
out how to handle String literals.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Java
mailing list