I’m just returned from @JCreteUnconf, which is an amazing unconference about Java-related technologies in the island of (you guessed) Crete.
I’ve already described my previous attendance here.
Both the people and the location makes every edition of JCrete an unforgettable event.
(a special hello to @rgransberger who wasn’t there this time for a very good reason but she did so well at disorganizing all past editions)
In an unconference, everybody is a speaker and everybody can propose an argument of discussion. There are only 4 rules:
1: Whoever shows up are the right people
2: Whatever happens is fine
3: Whenever it starts is the right time
4: It is over when it’s over
Every day anybody can propose a topic, he just needs to explain it in front of everybody. After there are enough topics, proposers move them on on the schedule and the day start!
I won’t even try to make a summary of all the interesting topics discussed, but I made a list of useful things that I’ve learned and what I want to study better.
Notes from Monday
There was an interesting discussion driven by @cliff_click on asynchronous models in various languages. There was a consensus that the most common two blocking problems are net Sockets and Db access. But while there are many async libraries for HTTP and such, there is not much on the Database front.
@heinzkabutz showed us some strange behavior about the new
HttpClient introduced in Java 11 JDK. It allows for asynchronous calls using
CompletableFuture to call and process results asynchronously.
Unfortunately, it behaves in an unintuitive (buggy?) way when you pass a different executor in the constructor, instead of using the default one. It seems to use the given executor for the HTTP call but then returning a
CompletableFuture that runs on the common ThreadPool.
Mob debugging is both fun and instructive! Maybe we should introduce it as practice at work…
The last talk of the day was about the new Java garbage collectors. There was a lot of comparisons among the veteran Azul C4 and the new kids: RedHat Shenandoah and ZGC.
One interesting note is that C4 is generational, that is it collects with different heuristics objects depending on their “age”. Instead, Shenandoah and ZGC are non-generational. Azul people defend their choice because “generational abstraction really works” and reckon that in the future Shenandoah and ZGC will add generational info to their heuristics.
Talking about microservices, since Jdk13 Shenandoah will return unused memory to the Operating System. This could be very useful for containers deployments.
A completely different option can be using OpenJ9 instead of JDK for microservices. It has been optimized for low latency and performance on systems that run on relatively small memory heaps (around 1GB), which is often the case with microservices. On comparison, C4 and ZGC really shine on machines with 64 GB ram or more.
Notes from Tuesday
The second day opened with a discussion about which Java? For people looking at Java now is very complicated to understand where to download it from. Oracle JDK (nonfree)? Oracle OpenJDK? AdoptJDK? RedHat? Amazon Espresso? Azul? etc. It’s all very confusing. On top of this, there is no hard rule about version minor number, so the same version of OpenJDK from different vendors can contain different patches and bugfixes.
There was also a general agreement that the 6 months release cycle is too quick.
I lead the second session talking about Kotlin and coroutines. Lots of interesting comments and comparison by @kittylyst with Ceylon, Go and other languages.
One nice Kotlin feature is the Sealed Classes. They work like a union type, but they are still very close to Java for interoperability. Real union types would allow for defining a new type using existing types, like
Foo = String | Int which is unfortunately not possible in Kotlin.
The last session of the day was lead by @dandreadis who is Quarkus.io team lead. He explained a lot about Quarkus.io philosophy and goals.
I’ve played a lot with Quarkus and Kotlin and I’ve also ported an example to Kotlin, you can find the code here.
Notes from Wednesday
Online courses and training is a fantastic opportunity but it’s also full of problems. @heinzkabutz @omniprof and Cay Horstmann and others shared their huge experience and problems they found with different platforms.
Personally, I love the approach of Katacoda but it’s not easy to translate it for teaching programming. You can upload your videos on Udemy but there are still problems with piracy and low engagement. Safari online courses seem better, I never did one but I want to try.
And by the way, Heinz’s courses are fully recommended.
Another interesting observation by Ken Fogel is how using chalk on a blackboard is helping to keep students attention, while after a few slides most of the students are sleeping.
I co-led a session on Project Valhalla. Showing how the code looks like. The new opcodes, the (temporary) use of ? for non-flattenable fields and erasable generics, the compact arrays, etc. Lots of interesting comments and insights.
I’m preparing a longer blog post on this, so stay tuned if you are interested.
@simonebordet delved in a detailed and very interesting explanation of Jetty architecture and in particular the new features of Jetty 10: modularity and how it supports HTTP/2.
One particularly interesting pattern is what he called “Eat What You Kill” Thread model. Instead of having a Thread waiting for incoming connections and then passing them to a different Thread pool for serving the request, Jetty let the same Thread serving the request and then it picks another Thread from pool to keep listening for incoming connections.
This allows for better performance and simplifies the logic in case of HTTP/2 multiple requests.
Notes from Thursday
There are also many non-technical talks at JCrete. I joined a discussion about public speaking skills, led by @melissajmckay. It has been one of the more enlighting talks of all unconference.
Among participants, there were experienced speakers and beginners. It was surprising to hear how everybody is nervous before, including amazing speakers who fill the rooms in any conference.
We shared the first talk experience and tips to improve. The single best suggestion if you want to improve your public speaking is to practice, record and compare the results with other people. There are many meetups and groups on public speaking around, even remotely.
Another good suggestion is to learn how to monitor and control your breathing to overcome nervousness and regain confidence.
@mauricenaftal in fact gave an example of how even if you mess up your live coding examples you can come out with help from the public and still be rewarded with a Java RockStar feedback. It’s kind of comforting that even such great speakers had their moments.
Next was an interesting talk by @mjpt777 on memory access patterns. When we have an aggregated object, with references to other objects, it makes a huge difference where the other objects are allocated in the heap. Having everything in a contiguous part of memory can give a two order of magnitude performance improvement comparing with having all object scattered in different memory pages.
Unfortunately, Java doesn’t provide a mechanism (short of using sun.misc.Unsafe pointers) to address this concern.
Project Valhalla doesn’t seem to help here because it cannot flatten external objects (String for example) and also because some business objects need to be mutable.
As a comparison, Martin pointed out that C# Dictionary is 10x faster than Java HashMap because of how it allocates memory. He created ObjectLayout project to address these points. That is something I want to look better at.
Another interesting non-technical talk was about self-awareness for introverts (that believe it or not were the majority here). Cliff presented as a talk at GeeCon and I strongly recommend to everybody to watch it here.
Notes from Friday (Hackday)
Friday was dedicated to hacking. Groups formed on several topics. I’ve tried to use LegoMindstorm EV3 from Java and Linux using LeJOS. Unfortunately works only with Java7.
@cliff_click is working on a new language called AA. The main goal is to reach same performance than well written low-level code but with a strong type system and minimal syntax (almost no keywords).
Finally, Friday evening we went all to eat at the Sunset Tavern, enjoying fantastic greek food and discussing our favorite topics.