J
js_dev
Hi all,
Just skim through and if its an old, already-discarded idea, dont
bother, just reply "old, discarded"
Speeding up java:
I feel that quite a large part of the java community is busy comparing
IDEs and platforms and competitive open-scource products
and not focussing on the basic problem which is speed of execution and
memory footprint. I find most Java programs on my
P4 2.4GHz, 512M, 80 GB HDD to be slow to start, especially the GUI. I
am not sure of non-GUI because have not used any power programs, yes I
once generated the entire java docs from the src.zip of Sun, but that
took around 20 minutes or more.
specification.
(2)This bytecode runs in every place where there is a JVM made for that
platform which
<i>basically hides the native part of the code</i>
(3)What
<i>actually carries the bytes/electronic signals to and from the
memory</i>
into the processor and harddisk is
<i>very much native</i>
code, but it is part of the JVM and transparent to the programmer/user
and that's your platform-independence.
(4)WORA(write once run anywhere) essentially refers to the bytecode
specification and practically, only to the means of <i>distributing</i>
binaries,
<i>not the execution of the java code</i>.
If we need to make java fast without losing cross-platform usability,
one way that strikes me is to mark code to be made fast in your source
as
optimize{
/* my code
* to be optimized
* goes here
*/
}
Just like we have synchronize{} and static{} and such others, we should
add optimize{}.
or
<i>Maybe the optimization functionality should get added to all code
internally by default, removing the syntax inconsistency</i>
Q. But isn't this going to go right against Java's cross-platform
usability and backward compatibility?
No.
The only modification in your source code is the word "optimize" and
the two brace brackets(maybe not even that).
Then, how will it actually optimize?
Here, <i>the jvm needs modification</i>.
Java packages
<i>should continue to be distributed as they are being distributed
today</i>
-in the form of platform-independent jar and class files.
<b><i>no change at all there.</i></b>
However, a change in the JVM or an additional utility like jvmopt.dll,
which is basically a parser, C/C++-style native compiler, linker,
(all-in-one) which will reparse the bytecode - (if your machine has an
older JDK installation, this dll will obviously be absent and your
javac.exe will simply not optimize.
However, if your machine has Java 7(for example), a "tmp-bin" directory
will be created in which the code to be optimized
will be compiled into native dll code or exe code (don't jump, just
read to the end.....)
<b><i>only for the time of execution </i></b>
(and don't name the generated files .dll and .exe - basically to
prevent rampant reverse engineering and corruption of executable
formats) and then, when the execution is complete, this "tmp-bin"
directory will be cleaned up automatically (del *.*).
But jars and class files will continue to be <b>the same</b>.
<b>this is the most important thing.</b>
There is no change made to either the .class specification or the
bytecode specification or the jar specification.
The only changes are in
(1)javac.exe and
(2)java.exe and
(3)an additional jvmopt.dll and
(4)the "tmp-bin" directory.
Clearly, this is a workaround and hardly elegant, but utilitarian
nevertheless.
I know that the JSR process will reject it outright, but maybe it can
give some ideas to some experts.
I would like to know what ( or maybe what all ) is wrong with the idea.
Regards,
Joseph S.
Just skim through and if its an old, already-discarded idea, dont
bother, just reply "old, discarded"
Speeding up java:
I feel that quite a large part of the java community is busy comparing
IDEs and platforms and competitive open-scource products
and not focussing on the basic problem which is speed of execution and
memory footprint. I find most Java programs on my
P4 2.4GHz, 512M, 80 GB HDD to be slow to start, especially the GUI. I
am not sure of non-GUI because have not used any power programs, yes I
once generated the entire java docs from the src.zip of Sun, but that
took around 20 minutes or more.
(1)Java is "cross-platform" <b>only</b> because of a universal bytecodeFrom the little java I know, I can make the following conclusions:
specification.
(2)This bytecode runs in every place where there is a JVM made for that
platform which
<i>basically hides the native part of the code</i>
(3)What
<i>actually carries the bytes/electronic signals to and from the
memory</i>
into the processor and harddisk is
<i>very much native</i>
code, but it is part of the JVM and transparent to the programmer/user
and that's your platform-independence.
(4)WORA(write once run anywhere) essentially refers to the bytecode
specification and practically, only to the means of <i>distributing</i>
binaries,
<i>not the execution of the java code</i>.
If we need to make java fast without losing cross-platform usability,
one way that strikes me is to mark code to be made fast in your source
as
optimize{
/* my code
* to be optimized
* goes here
*/
}
Just like we have synchronize{} and static{} and such others, we should
add optimize{}.
or
<i>Maybe the optimization functionality should get added to all code
internally by default, removing the syntax inconsistency</i>
Q. But isn't this going to go right against Java's cross-platform
usability and backward compatibility?
No.
The only modification in your source code is the word "optimize" and
the two brace brackets(maybe not even that).
Then, how will it actually optimize?
Here, <i>the jvm needs modification</i>.
Java packages
<i>should continue to be distributed as they are being distributed
today</i>
-in the form of platform-independent jar and class files.
<b><i>no change at all there.</i></b>
However, a change in the JVM or an additional utility like jvmopt.dll,
which is basically a parser, C/C++-style native compiler, linker,
(all-in-one) which will reparse the bytecode - (if your machine has an
older JDK installation, this dll will obviously be absent and your
javac.exe will simply not optimize.
However, if your machine has Java 7(for example), a "tmp-bin" directory
will be created in which the code to be optimized
will be compiled into native dll code or exe code (don't jump, just
read to the end.....)
<b><i>only for the time of execution </i></b>
(and don't name the generated files .dll and .exe - basically to
prevent rampant reverse engineering and corruption of executable
formats) and then, when the execution is complete, this "tmp-bin"
directory will be cleaned up automatically (del *.*).
But jars and class files will continue to be <b>the same</b>.
<b>this is the most important thing.</b>
There is no change made to either the .class specification or the
bytecode specification or the jar specification.
The only changes are in
(1)javac.exe and
(2)java.exe and
(3)an additional jvmopt.dll and
(4)the "tmp-bin" directory.
Clearly, this is a workaround and hardly elegant, but utilitarian
nevertheless.
I know that the JSR process will reject it outright, but maybe it can
give some ideas to some experts.
I would like to know what ( or maybe what all ) is wrong with the idea.
Regards,
Joseph S.