-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Filip,
On 7/13/20 17:59, Filip Hanik wrote: > for discussion, all feedback and questions welcome: > > > I've created a concept of having Apache Tomcat, embedded, run > without reflection in a native image. This concept creates a jar, > tomcat-embedded-programmatic.jar, that can be fine tuned to only > include what is needed in a default configuration when an embedded > tomcat instance is used and configured programatically. > > Steps to run Apache Tomcat using Java 8 without reflection > > 1. Make sure you have native-image (from the graal installation) > on your path 2. git clone -b > feature/embed-minimal-programmatic-jar-file-master > g...@github.com:fhanik/tomcat.git 3. cd tomcat/res/graal/ 4. > ./build-tomcat-native-image.sh && ./graal-measure.sh > > Should yield an output similar to (Graal 20.1): SUCCESS: the > servlet is working RSS memory: 20.7M Image size: 20.5M > > > or using an older graal, 19.2 SUCCESS: the servlet is working RSS > memory: 18.0M Image size: 16.7M > > > This also leaves a file named > ${java.io.tmpdir}/XReflectionIntrospectionUtils.java so that you > can review the solution to IntrospectionUtils.java > > Goals of this concept > > 1. Do not break anything 2. Create a new and optimized for size > artifact, tomcat-embedded-programmatic 3. Remove reflection by > introspecting classes that are currently passed into > IntrospectionUtils.set/getProperty by generating setters/getters at > build time > > How it's done > > 1. I've build out a small introspection tool in the package > org.apache.tomcat.util.xreflect 2. During build time, it analyses a > set of known classes that are used with IntrospectionUtils.java, > and generates XReflectionIntrospectionUtils.java 3. When it > packages tomcat-embed-programmatic.jar it uses the generated code > when calling setProperty and getProperty > > A PR would look like this: > https://github.com/apache/tomcat/compare/master...fhanik:feature/embed - -minimal-programmatic-jar-file-master?expand=1 Sounds > like a really interesting ApacheCon presentation ;) - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8M5KkACgkQHPApP6U8 pFhhthAAiJjZwWzNNHwx3YQA1J/9sKn2KX50/QrcB+IOkjL8FBbM0bvRCRL1I0ZB 17nQEg5fb7Y+EHOtceYjmJTDrqdj6WIvF60JS5y0E4FUOt0wrqd1v7oTZnKGqgqs 84J8oPW71vpzR/2EL8tzCjn/Oa7rLU58yGtKObBxbgdZcCDa4j0iuklLy6dyktAb JmxTeHWKmvkezbUKoflydSLb9Dxq7dL2XK2JDGw6iQi4FBiAXleooVw/MpZ1fOAm jxPjOnf8NhjNoFJooYs/i7H8Oa0MF2BtdrC1qS7gJBJkAp7bOr0HIO2QZLshkSKe AsC5wp6QfzMWLQsTc25Z5SKGZYNrP6aWkcALYgETjJywDZGmrJ/UO16+zOayqYGq TvSbE+6+cVzlmj4xMf1UPJf/D9gdpqqWkC/YJpfyZgvqgXkBywbHrSUVyC0AbBKU REQ6WFNO2idUrZNbmbC0OaLt4BdikjjazhaCoOWQHij83TElQqXCYbH+JcOrc3JE +9w6Y7fdSwaR+1v2XUUk2McBQtJf9kP7G2iKBYgwrn1JTSrNSB2jvdi5f/HbtGUe txV6AFJQeFEH/grfHbGeLh21B4UyOa2CkAbAD+dikIJqWBMxvm4DMG1cnJW/x/Rs vVX3EbVDc6kEBgLQ1blfC7Yl2QdmUap7wP/X399bvH7bmtWJPPI= =7nG7 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org