]> source.dussan.org Git - jgit.git/commit
[performance] Remove synthetic access$ methods in transport package 70/59170/1
authorAndrey Loskutov <loskutov@gmx.de>
Wed, 28 Oct 2015 19:24:12 +0000 (20:24 +0100)
committerAndrey Loskutov <loskutov@gmx.de>
Wed, 28 Oct 2015 19:24:12 +0000 (20:24 +0100)
commitdf876d2e0f4a3d4b99249ae03f901adcb9175c36
tree763279312565c853bbd1525a92d1deb38771c5e5
parent79a7dd026fa393fa3c66e945839e9faef744be2f
[performance] Remove synthetic access$ methods in transport package

Java compiler must generate synthetic access methods for private methods
and fields of the enclosing class if they are accessed from inner
classes and vice versa.

While invisible in the code, those synthetic access methods exist in the
bytecode and seem to produce some extra execution overhead at runtime
(compared with the direct access to this fields or methods), see
https://git.eclipse.org/r/58948/.

By removing the "private" access modifier from affected methods and
fields we help compiler to avoid generation of synthetic access methods
and hope to improve execution performance.

To validate changes, one can either use javap or use Bytecode Outline
plugin in Eclipse. In both cases one should look for "synthetic
access$<number>" methods at the end of the class and inner class files
in question - there should be none.

NB: don't mix this "synthetic access$" methods up with "public synthetic
bridge" methods generated to allow generic method override return types.

Change-Id: I0ebaeb2bc454cd8051b901addb102c1a6688688b
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
12 files changed:
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateStore.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TestProtocol.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportAmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java