
About this episode
Helidon JSON and Helidon JSON Binding, compile-time JSON binding with annotation processors generating readable Java source code, no bytecode manipulation and no reflection, debuggable generated converters, comparison with Micronaut compile-time generation, why Helidon avoids the JSON-B API and its reflection overhead, a proposed bridge to the JSON-B API for stable standards-based code, serializing Java Records with the @Json.Entity annotation, a package-info annotation idea for processing an entire package, Boundary Control Entity (BCE) structure for entity records, JSON-P style JsonParser and JsonGenerator entry points, HashMap-like dynamic JSON objects for versioned and evolving APIs, a single centralized entry point for discoverability, grounding LLMs with Jakarta EE and MicroProfile standards to avoid hallucinations, reducing dependencies by letting LLMs generate helper methods, Java 25 source-mode scripting and simplified main replacing python scripts, zero-dependency JSON parsing with a forked org.json, JMH benchmarks showing Helidon JSON around 400% faster than Jackson and faster than yasson, energy and cost savings from faster serialization, object pooling and virtual-thread-friendly design with Scoped Values
David Kral on twitter: @VerdentDK
Get every episode summarized
Each time airhacks.fm podcast with adam bien publishes, we email you a written briefing from the transcript — the topics, who appeared, and any specific claims, with the ad reads skipped.
Email me new episodesFree for 3 shows. No card needed.
Hosts & guests
Transcript ready
848 searchable segments. Every word is indexed and playable.
Full transcript
airhacks.fm podcast with adam bien — Fast JSON and Furious Runtime. Machine-transcribed; use the interactive transcript above to jump the player to any line.
Hi David Kral. Kral is pronounced perfectly. Kral. Yeah. Oh, it's very close to Pronunciation go ahead. What's the perfect Kral. Yeah, yeah, yeah, yeah, yeah, yeah, Kral Okay, and David is important because your colleague Daniel Kets, you know Daniel still yeah, I still know I still know Daniel Okay, he complained that I never introduced my guests with the first name so I we fixed this right now. Yeah, so he's happy now Yeah, I told him that you did it because of him and He was he was thrilled that he has such an impact thrilled. Okay, because Greetings to him. I didn't met him at Java one last year. I did but this year he was not there I think or at least I didn't met him so greetings now We met because you worked on a very secret technology called Jason. Oh, yeah, very great one. Yeah And you made it faster, right? Right. Yeah, we were developing
Our own binding framework or version of it. It's it's just a variation of already existing tools, right? but we are doing it for our halibut declarative and our halibut declarative feature is pretty much its signature movies or signature feature is that it's compile time and Pre-generated at the compilation time all of the bindings thing all the binding things and I don't mean just just the Jason stuff but also the web server and the routing and pretty much everything Of this sort is done during the compilation time and we needed some Framework for Jason binding which would be able to do that which would be able to prepare for us all the all the deseralizers, right and serializers at the compilation time and We wanted to have it nicely wired to the whole helid and ecosystem and for it to follow our our standards and
That's what I've been working on for for quite some time because First that it was just my pet project but It moves to a full halibut feature. Mm-hmm. So we can we can summarize for the podcast that Healy done is a collection of pet projects, right? Oh Sometimes I'm having exactly this feeling that You were serious for a second your froze this was this was interesting I actually I actually like this summarization because I spoke about it with Thomas Langer some time ago and We were talking about that exactly this that we are Working on some improvements from our free time because we have an idea and we want to test something and and stuff like that and suddenly We realized hey, but this is really useful we can use that and and something it's it's not a pet project anymore, but about a feature and
So it's exactly as you said it pretty much Cool, but the the compile time how to call it configuration or me wiring It's similar to my keynote or You are aware of my current. Yeah Yeah Well, the way we do it is we use annotation processor and as far as I remember Micron is doing the same thing right that they are pretty much generating these these binding or Converter classes during the compilation time. So I think it's it's very similar in this regard We just generate the Concrete sources sorry the Java sources Specifically, it's it's it's no bytecode. So as far as I remember I think Micron is currently having this feature as well that they can generate the Java sources, but
We don't have any bytecode manipulation whatsoever there in the whole process nowhere, so We we do that and I think yes, it's very similar to what my computer does Yeah, yeah, yeah, that's great because what I usually said always is that Hella done is very fast, but it's completely different to my keynote and corkus. This was my tagline, but it's no more true, right? So you performing similar optimizations to corkus or my keynote. I wouldn't say that It's not It's not true anymore. We still try to do stuff a little bit differently Exactly like this right where where we are not using any bytecode manipulation as I mentioned these sources We these generated sources from the annotations are just regular Java sources Which you can take which you can edit if you want to in some way and And one of the great things which which I really like about is is how easy actually it is to debug the whole process because
Since there is as we are always trying to say there is no magic, right? It's it's just the regular Java sources with no reflection or bytecode manipulation whatsoever and You can just take it you can place the break point there and it will it will get resolved You will see the whole process you'll see the whole chain you have everything in front of you and That's that's one of the great strengths. I believe our our approach has in this regard But micro would be similar right because if they generate you know the bytecode at build time Oh the bytecode yes, but but it would require you to Decompile with right or ah ah The main difference between helidon and micro node is Micro node generates bytecode which is not visible to the developers and you are generating source code Yeah, so it means so what there's no magic because what you see is what there is
The entire source code is compiled and there is no bytecode without source code, right? This is the difference. Oh, yes, exactly I mean I know that had it on ships with libraries, but despite the libraries So if we declarative had it on if you fire up the annotation processor We get source code which looks nice. I take ownership of the source code It could be generated by LLM, but is this generated by compiler? It does meta and therefore there is no magic, right? This is the main difference. Yeah Yeah, we are trying to completely avoid any bytecode manipulation and we always generate the Java sources without without Well, and in black magic. I like to call it Yeah, white magic is cool, but black could be sometimes problematic. Yeah Voodoo magic Cool, so now
Your Jason I cannot even imagine how it works because Jason is flexible So what is starting point a Java class or a Jason schema? Right well for us it's it's Since I used to work At the start of my career and Oracle I used to work on the Jason B And I was heavily influenced by the overall design and I kind of like it What's the state of Jason B is still The implementation is still is someone working on it on the implementations or you know it Well in terms of in terms of you mean my involvement there or or what's So overall landscape because there's a micro-profile still using Jason B and there are I know there's eclipse implementation And there was a glassish one I think the question is is there something else? So is there a hellied on Jason B? No, no, no, no, no, no, no, no, Jason B implementation. We avoided that original
I wanted to do that this way that we would implement the Jason B API because why not right and Then I dropped the idea because The disceralizers and serializers are actually using They are having the reflection bond today. I think they're having Jason P. Orra Well, not necessarily Jason P. I mean I could create an implementation of the Jason P itself as well, but I if I remember correctly There was a problem that it's having like fields and Methods from reflection bounce to it and that's something we wanted to completely avoid because we don't need these these stuff We don't need this overhead and And That's the reason why we didn't follow this path actually and it's it's so it's The way that it wired the Jason P there We were not exactly thrilled about that and when I was trying the API to make my own
Inbumentation, that's how I actually started that I created an implementation of the Jason Jason P API There were some performance problems. I was having so I was thinking hey, how about I'll try it without that API How about I'll just design the API myself for my needs and We'll see how the performance is going without it and I was able to get the multiple of times The performance just because I didn't use the API I'm asking because With Jason is the last battle almost for me because in the recent years I used So I was a five years ago. I used Jason B all the time and Then in some projects I noticed that because of flexibility I didn't want it to have a single class to Jason. So I was happy everyone's Hashemab like approach So almost all my recent projects are Jason P. You know the P like hashemab, right?
Okay, so and and then what I did I started a criminal project almost because Because I needed Jason for configuration purposes outside Micro profile just Java. I see for instance right now. I have for instance on an agent on I use it a lot I implemented by myself was no external dependencies and and it just needs a little bit of Jason And what I did is I used you know org Jason the reference implementation for the the very old reference implementation Which there is an implementation for JavaScript and for Java the identical. Yeah, I think yeah, I think I do I Mean it at least the name of the stuff Rings about yeah, I think that the name of the project is just org Jason Yeah, and the interesting part So the not that interesting part is very old and the API is It's okay, but this somehow I mean it is similar to Jason B
but It is like you start with an object and then say it and whatever so it's a little bit strange And what I did is I I forked that this is what is criminal because I don't like such actions, but it worked well and And this this org Jason was maybe this 20 classes, but They have property support and being support whatever I deleted everything and I only kept three classes So with just three classes I have now Jason API, which is related to the Jason and I would like to have one class maybe or two or Java records and I use it just you know for Java CLI for So something outside headed on corkus micro profile whatever and in the corkus micro profile I use usually Jason P and Especially with llms if they generate you know the The cat and put it is visible for me. I don't have to write it. I can read this and the writer tests
So this is why I am asking this is why it made me curious Because is your API more like Jason P processing or be like binding what is it your API design both I cool, but I mean yes my my API not not the Jason BNV I Designed both for that and we kept it separated because in many cases we also need to use just Just the Jason P like APIs just to have some dynamic object right which you can create and then Converted to Jason and that's it. We are using we are using it quite a lot and But also having the the layer of being able to basically Easily convert some Jason to some some more complex object, let's say We also need that right and our users as well. So does the reason why we basically did both and
As mentioned at the beginning or not at the beginning, but Since I was in influenced by the Jason V I was trying to design it very similarly. So basically the overall design is that you have one instance it's single code Jason binding and This Jason binding allows you to serialize or diserlize of just it's pretty much everything in the as I have And no other methods are involved there and This implementation will choose the correct The sterilizer or civilizer for your purpose Based on the class you provide or the instance you provide if you want to serialize it right So we can so that that way it can determine what you need and that's pretty much the whole logic there And that's just the binding part and then we are having this Jason P like a api's meaning there are there is a Jason parser there is a Jason generator and the dynamic object
And you can use those directly or as a part of the Jason binding So you can you can use that as well. We also do have features like That if you have this dynamic object you can easily just call Diserlize s or some pelata and you can pass the Jason This dynamic object of ours and specific specified a class you want to diserlize it into and It will automatically convert it for you so you don't need to go Over the Jason again and then the sterilize that to the to some specific structure you desire you can you can use that directly So it's it's there is an integration between these two projects even on this on this level because this is something we felt it's Is something Someone might use Because it's useful
But is it the helidon media Jason P it is not that right So if you if you helidon dash may media does dash Jason P just the maven coordinates It starts with Jason P support. This is not this right no no Jason P this is this is our This is our support for HTTP media for Jason P itself. That's that's for the Jakarta version Of the api's right But if you would be searching for the HTTP media support for that that's That's That's Jason only and for For the Jason binding it's That's Jason binding Those those are the but those are the Media's media supports for HTTP. I think So there are two helidons and we are talking about the Java SE one right yeah
So and because we are talking about Java SE one You don't have to implement Jason B and Jason P So this is the first clarification right but but you could Build a bridge and making Jason B compatible right Well, it wouldn't be Well, you could because I thinking you know it would be really cool To have a Jason B api which is based on your and uses reflection. It is slow. I know yeah, that's to be High speed and not using reflection and dropping and api is a very reason for Java SE because Java See doesn't care about Jason B or Jason P right but we could provide a bridge right You know what it is you some I do believe that there could be a bridge and included if there would be such a need from our users Or users they Potentially could that themselves that you shouldn't be that hard but Yes, yes, I think it's totally doable. It's just about doing a wrapper
Around our way of doing things and then just not sit to Jason B and it would work So support from users will never come I guess because if you if you users get helidon package They will use whatever inside. Yeah, and I tell you a story uh Way back We used web logic server and it came out of the box box I remember till now with of I think was file support whatever that we can use a connect to access local files which sound strange but in class that could make sense And they dropped or they changed it to me and it was no more compatible and they say well This was our implementation was bound to this server version and this is normal and what my client said is We are not allowed anymore to use any proprietary features now. We only use public APIs And we never will use anything web logic specific. I remember distinctly So I think it might be a good idea To have an optional bridge and say look this is the you don't have all the features maybe it's slower
But you know, this is an API which never changed yeah also the next the next This Very important thing is in all my projects is the question how well lm supports that and um What I see is The microprofile jacata java is e api supporting lm's is great They never hallucinate So if you had a jsonb bridge I could tell our ground my lm You are only allowed to generate jsonb code and helidon could be pluggable So I think that demand is there but this is no you will apple. I think we'll never Here from the clients that they would like to have a different CPU inside or maybe uh the rem is not nice enough Maybe they will get someone from the you know from the service providers who care about the iPhones or whatever or the Or the telecommunication companies but not for from the end users and I think it'd be the same story because java s e Is java s e you can do whatever you like but I think
Uh, we should push the standards forward because I get I guess I know uh that APIs are hugely beneficial in lm driven development and actually my all my projects are more standard based than ever So they use jacata e microprofile all the time because lm's Know it that well And with lm's you can even skip more dependencies because you know you can say hey lm generate the glue code and lm will do You don't have you know To to to to to get the jacata commons link to check whether string is empty for instance, right? So they generate two methods and i'm done So uh this would be my justification that you get a little bit more time Is is Dimitri still there? I didn't know yeah, yeah, he's Dimitri still the man because he designed the jsonb so he should I actually tell you hey Where is jsonb? Where is jsonb? I'm little bit disappointed with Dimitri I have to say I have to invite him back to the podcast because if he designed not only the specification
He also designed the logo for this specification right for the implementation, you know the jsonb the json binder He should be after and and we should be careful Because this is what I tell you my project was criminal because I just forked that for my reasons is is is great But I would like to have an API actually right? Yeah, well Frankly, this is something we were already thinking about not just for the jsonb API itself But also for for other frameworks such as json and stuff that we would at least support the annotations in some way and Pretty much do some breach around it if if it comes to that but Frankly, it's something we didn't do yet But yeah, but just motivation maybe you know before it was there already yeah And I think for Java the huge advantage is our ecosystem and the amount so what I do in on conferences though I am I or my clients they ask me knows do we still need Java and
He are do LLMs understand Java and and LLMs are very very good in The quality of Java co-generation itself, but if you create a few rules and say you are only allowed to use an or micro profile in Jakarta E magic happens because because you know all our specs I've written in very normative way, so they are very strict And they were always open and they know it by heart. So I would say this is huge competitive Advantage over other languages or platform what we have with the APIs and if you would for instance, right? You have your first binding implementation There is bound to helidon for fall. Let's say then helidon 5 comes out and you change something you get hallucinations and But if you would had json b It is there will be never hallucinations. You know the only hallucination can be that the wrong version from helidon is picked Yeah, I got it. Yeah This will yeah, this will be the motivation. Yeah, make sense to be fair
But as mentioned right now No, no, no, but in the queue after the podcast is published hopefully and And It's nothing against no to to change the json b a little bit right? I don't know how the processes working But I think they will be open if you say you know I did the reflection is problematic here. I would like to change it. I don't think there will be lots of friction I don't know to be fair. I mean it's a significant change there And I don't know how Others would feel about that So I think Dimitri will know because he was in and and if I think is a silent in the json b space at least So yeah, we can look at up right now and What's on the horizon and at least you know, propose it or revive it because it comes from from a need
It's a part of the co-profile. I think this and Yeah, I was yeah, I would be using the json b api already For for my there is a 3-1 under development Mm-hmm from Emily junk ed bret Dimitri con nilo Is so I think this is like set in stone he's already there and From pyaraguy's tomitribe that I even I would say There is nothing against you can at least write an email right and say hey look I had a problem and see what happens. This is what I would do at least and Support for Java records ability to serialize this allows you ID to json. This is clarification json number format. So I would say If they provide support for Java records They were not available before I think you could do something not saying that they wouldn't begin to
Changing to spike or Or in Evolve it in some way like like when I what I did with the regress And David crawl and December 17. Yeah, I proposed that Yes But I don't know how how kin they would be into such such a major rework of the api because changing the disurlizer and serializer Signature basically is a big is a big impact for things. So I don't know Yeah, I was thinking about this and if there is a need maybe you know We could get Jason B in Java s. So I already have it. I actually this what I use in my system tests but um and what would be the impact would be not just the entry point to the serializer or what is the impact on the api I'm talking about api. Yeah, in terms of the api is just the method the method. Yeah, the method
But you could add additional methods right? Well, you could and make some default if it comes to that But I really don't know. So I would say this is if you will break break word compatibility Is a big issue, but if you add stuff and it's okay. This is new in you know Jason support whatever. Yeah, then I would say it is a huge selling point This is one of the reasons where I try also try to avoid Jackson. I have to tell say it is almost standard Jackson is huge popular But if I have an api, why should use Jackson if there is api, you know and Surprisingly the Jason P the old one was always fast enough I know that Jackson is faster, but I had never any performance problem with Jason P And this is why on my project I based right now on Jason P because uh right Additional stability and the hope that uh like right now we can talk about Jason B And if you provide the implementation I get a no without changing my code
A better implementation of Jason B and maybe Quarkus guy see this and provide some this is what's what's makes interesting Or you can build something anywhere where the Quarkus guys cannot use it right so there could be also right no license key Whatever say if Quarkus slow you can say no in the If server equals Quarkus Sleep 500 milliseconds, you know, they won't notice and Had it on with the fastest All right No, but but think about the Jason P. Yeah, I actually like the idea and as mentioned we already had it But we but I need to raise that probably again. We'll see what we'll see We will see what what come comes up from that Uh, I'm not going to give you any promises in this regard No, but uh, I Yeah, I still see the benefits for that and I saw it at the beginning as well. Yeah
Will see and a motivation maybe I told you this already is uh, it was a few years back At Java user meeting the rihat fichna This is also was on the podcast. He talks about a lot on conferences even So we had uh Java haters java user group. So I saw him talking about is a java one and um and what I met them pattern developers And they told me they would like to have or yeah, they would like to use uh java for Um operations It's easier to operate and it's faster But it's harder to learn and I say yeah, what do you mean by that and I say yeah, but uh Take a look at Quarkus tutorials. It's like a no five different Path to do the same And I say I never read the tutorial they say what how you learn then So I read micro profile. I mean there is a jacks arrest It is just one path And i pick Quarkus and it rocks or you can pick helidon or whatever you are completely independent of the implementation So I would say this is huge edit value focusing on apis because apis abstractions
And uh is the same here in helidon right if you open helidon you have a declarative microprofile You have multiple paths and a novice is is could be confused and say what's going on? I mean what to pick why there is a java version and a java version which called microprofile and both are java right and with the api approach I think for me it was a huge selling point. I ignore first the event or specific stuff Focus on the api implemented the app and then if we then thought about you know Which configuration options do you have and and and and and i'm really happy I always was happy with the approach so I would say From the marketing perspective because from the implementation perspective for you know You have to implement a bridge is not like it is getting leaner or better. It is just additional abstractions afterwards right yeah, but for me I think what you did is is is the usual way you have an idea you implement
Something and then think about how to abstract it And not like start with the abstraction. I hope that you will find an implementation right? Yes, yes pretty much like that. Yeah, very good. So now tell me more. So could I use it or for Is it meant Digestion support for internal use in helidon or is it meant to be used by me as a user? It's definitely intended to be used By you as a user we are currently migrating our internal projects or our projects in general We are having as a part of helidon and we are migrating them to be based on the halidon jason So we are currently already running it But the main idea behind it wasn't just for us internally inside our components but also for our users to benefit from it because The fact that you can have the pretty much overall
binding logic generated at the compile time in the javasource says it's great. I mean It was exactly what we wanted. It was exactly the design we are trying to follow and We think our users will benefit from it greatly. So that's that's what we that's why we did it and Definitely, it's not intended only for our internal use. I found an article Surlising this allies jason with hadidon from December 24th interestingly and But it's a jason b. Yeah, I think so but it looks yes search for helidon jason Or I can send it to you actually But there is a medium. Yeah, I did it. Helidon jason and is it jason support jesus jason p is always jason b And Helidon for four release it's on a medium and and I made it from Ali Yeah, that's a helidon jason and then that
Fast jason without furious runtime code. That's that's the that's the medium article I wrote about it So I was I would try to find your article, but it disappeared. There is no way there is no way for it to find it It's a helidon no, so I even found our Our podcast jason, but no It's tried to google the fast jason without furious runtime code Fast jason with four years without furious runtime code and it should be on medium Or I can send you the link if you want to actually why shouldn't I do it we are having on chat here, so Yeah, put it in the chat. This would be cool Yeah, yeah, yeah, something there Oh, absolutely So now we can restart the podcast right so I will just cut it out everything It's still records. I don't know where we stopped actually
Oh, you ask Adam are you there I asked it several times because suddenly you fell silent and I was surprised by that Yeah, I believe you so we can reboot right okay So After some technical difficulties. I got an article from you with the title and it is extremely well hidden Helidon jason fast jason without full-use runtime code from March 27th yes, and in this article We see that in order to do the speed magic we need helidon dash jason dash binding and um It it is indeed similar to jason b we have jason binding dot builder and And we can just Suilized a person for instance Uh, which is Java record
And you need to one annotation adjacent dot entity yes There's the marking annotation for our annotation processor to properly pick up the The type and generates Some some binding around that I mean the convert convert the tie But why why you did that you could say whatever whatever I put to the you know to the binder it is it is An entity you could make a default that is salizable right? Uh, well whatever you put into the jason binding object. It's automatically Serializable and deseralizable if there is some converter for it. So we support some some basic Java types And you can use those out of the box without needing pretty much doing anything right But if you want something more complex like your own pojo's to be handled and supply that then you need to place the The That entity or at jason entity rather annotation there on the on the type and then
Having our annotation processor on the class bar during the compilation it will it will pick it up and it will compile everything So That's one way or you can design it yourself if you want to if you want to Make your own converter for that You can you can also do that. So you can provide it to us over the annotation or Over the builder as as you have mentioned yourself that You can do that over the builder But why we need it because if you think about us, let's say I created my own Java record developer And I pass it to your binder So you could just assume You just use it in why I need still to put an annotation on it That's because of because we need to trigger the annotation processor and That's at a compilation time and we basically say hey give us all the classes or basically Java types which are annotated with this At jason entity and that's how we determine for which classes we should generate the
The converter converter for because otherwise we would be generating it for everything pretty much Or we would have to analyze the code in some way What types are used there and stuff like that. That's obvious is something we don't want to do so That's why that's the reason why we basically came up with this uh I I get you if you run on helidon because you have to scan the class path, right? But yeah Or similar or similar not scan the but but scan something right to find the classes can be John Dex or whatever but you know 20 years ago we would scan class path so now You're your API looks like this jason binding dot create i have the binding And then I say binding dot sui lies and I pass the records So you know that I pass the record to the serializer in this particular case
For my perspective the annotation is optional is not needed well. Oh that what that's what you mean. Yeah, absolutely It's it's optional. Oh very good. Uh, I thought that you are talking about How this will then be processed because since if you wouldn't be having the The jason annotation there. We wouldn't generate okay on the burger for you So we would have to provide Assumed you love annotations you would like a note to annotate whatever you can't like no this cannot be right Give me your annotation right This is the annotation is there just for our annotation processor to properly pick it up But during the runtime if you provide the converter for it yourself it will absolutely work so But why I have to provide the converter because in java record you could have your own java record converter And you could just you know search for the components and if you're a string component you have your own converter Right, but then you are getting into the place where you pretty much
Have to use reflection because you need to go through the through the fields methods invocations and stuff like that what we do during the compilation time is that we do pretty much all of this We will go through the we will go through the record. We will determine the the getter methods We will check what what's there which constructor to use and stuff like that And then we go then we generate a code which which diserlizes or serializers Surlizes this object base on this information we found in the record So that's what we what we are doing there and when I'm saying that you need to provide your own converter or what we are doing it doesn't mean that we are Not reusing some already existing ones like for example for a string you are not required to invent your own Deerolization mechanism for string for example, right now, but for my dev developer record
For your developer record you can just delegate is to string converter There are mechanisms for that. So you will be just required to say hey, I am I'm having these these fields there Or the how it's called for records is Record component or something like that and component and record component is like yeah, and you will just Take the type of this component and search for the already registered Registered converter for the given type and you will just delegate the overall process for it Yeah, I just copy it To example from your article. So the first one is the person with adjacent entities And this is what I'm talking about so for me this adjacent entity Might not be required because I'm passing this to binding CLIs But I think I begin to understand you need this adjacent entity to generate the source code at build time
because It is too late then if in runtime I pass the person to CLIs you cannot generate the infrastructure anymore This is the problem and we are trying to avoid any bytecode manipulation whatsoever So because of that we can't do pretty much what we are doing at a compilation time And we And since we are also not using any reflection. We are basically having no way how to then properly handle it but What I'm doing in my projects is I have BC boundary control and an old pattern from Eva Jacopson 1992 older than Java also well known by LLMs so which is cool And my JPA entities data objects Java records are in entity package usually not usually always Or in boundary package what I could do I could annotate a package info oh I see and then All the records in my package would be automatically processed. This would be cool
Oh, this is this is actually I like it. This is this is a good approach Which could be very useful for that and you wouldn't have to Um modify your your classes at all you would just annotate the package and it you know for LLMs They will go there see package info way great, you know and annotation then all the records and we could have the annotation with list of records If it I need some adjustment But it default would be see whatever's in the package It usually is JSON serializable. I would say in some of my project it is the case in more complicated projects Maybe not But then I would put the annotation on the package info I would put on the classes. There's would be more convention Yeah, and really I really like it. I made a note here To very good This is this is a great. I didn't thought about it actually I this is PDD this is podcast driven developer nice We have to do it more Yeah
So then we get json b api on json p you know this is uh Okay, now I now I get it and this is really very similar to json b Um, but what you should do is you should use an ovaris and multiline strings In the example. Oh yeah, yeah I think it will look nice. I this is compact, but you know we get we get uh Angry javascript developers. This is a crap java It could look nice. Right. So this is um All right good point. Yeah, I can definitely use that. That's that's fine. Pretty cool Do I have to use helidon or I can just use this without helidon? Well, you can use this without helidon. It's completely standalone and If it will generate the source code will it be Self-contained or I still need external libraries? Well, uh the generated code
Is then this is discovered why are the service registry? So you don't have to do so you need service registry for that, but it's automatically Optin for you as a as a as a dependency of this project. So You don't have to specifically add anything yourself If you're asking about it because what would be cool? So like eject, you know that I can generate the java source code And then I don't need anything because um What I do right now is uh It is actually it's it started more so I do the the Shorts on youtube. There are already the one thousand two hundred of them and um and java 25 came with the Simplified main and with the shea share bank. So where you can run java 25 from in source code mode and um and I I began I don't know when the first scripts as the the shea bank support was uh isn't older than java 25
So I started in earlier with it, but with the simplified main this void main instance and so forth What happened in my case all my all my shell scripts are converted to java now So uh end uh in my commercial projects I'm converting because sometimes they are old python scripts And I had to con extend them and before I extend them I converted them to java And in all cases java was shorter than python. I even posted from time to time on if there's not that critical on on LinkedIn And I was stunned because I assumed you know python is more compact easier whatever and then how can it be the java 25 is shorter than python and for that purpose It is really cool to have self-contained code, you know Because I don't need external libraries. I have one script Even if it's longer one I don't care and I can run it it is executable and I'm done. This is you can debug in the fourth So uh maybe It there's something in there, you know, even for your clients you can say look
We can have you know The entire or in other entire a parts of it just as java source which it run just with java or java c uh, especially This is also the case why I picked the org jason because there are no external dependencies. I have three classes I can parse jason and serialize jason and without even compiling I just say java and it just compiles in memory and does that you know, which is which is huge Super cool Yeah, this is actually a great project and the question is now How fast is it if you compare it to jaxon for instance to have some Performance if you yeah, we did we did some performance measurements and I just want to note that We were trying to use some dedicated machine which was designed for or It was tuned for the performance measurements, but it's by no means any certificate certificate machine for
For that so just keep that in mind, but So it was not run on a dedicated jason CPU right But A jason asic this would be cool, you know a jason asic That would be yeah Yeah, but uh the numbers we got are pretty much consistent on every every environment we are running this on and I don't mean the Numbers themselves, but the the order of the frameworks how they are scoring in terms of for example the perfect percentage wise and stuff like that We were having multiple times pretty much the same results with the different numbers, but the scoring was percentage wise very similar all the time so that's why we went with it and We did some jmh benchmarks and in comparison to jax
You are not allowed to reveal numbers I am we are actually having it in the article down there Very good so because I thought You will never tell me the number I do but I was trying to get into that and do some disclaimer before So in terms of the jaxon and if we If you think about the use case as a simple pojo with some some string values some primitive type values This is a this is the diagram right operation per millisecond And Some one one inner object Then the performance was 400 times Better for 100 percent bigger performance than what jaxon has In terms of digitalization, which is crazy. Yeah, it's it's pretty good. I think So micronod is a little bit better. Yes And jaxon unfortunately what I'm using yeah, it's the first one. Yeah, yes, but I will cut it out
My clients won't hear this but But it is like I don't know how many maybe 800 operations per second you can do with jaxon and helidon does 12,000 yes. Yes, exactly Okay, so the the jaxon had I think how well how much was it in this yeah, it was 1000 and 800 operations per millisecond or really because on the graphic is less than now It's it's just not that apparent from from from the graph because so there is no there is no one hundred one thousand Line there. Oh Okay, it's actually, but it should be a half of two thousand I would say right yeah, this is a this is a strange Carrave I have to take a look at it is but For as you as you said it this looks very is looks even slower than What what the measurements were I I need to fix that I don't want to
I don't want this to make it a little bit higher I do a little bit better, you know, but if you check the numbers above it basically the jaxon is having one tons of n80 operations per millisecond and and Jackson has two thousand 300 operations per millisecond and our implementation has nearly 12,000 Operations, but this is interesting what it means is this is why yasson or json p was always Good enough for me because there was not a lot difference to jaxon I assume you know that the json p was actually way worse, but it is not and If you don't see a lot so what do you do you know we do a lot of stuff and then we return from jax or s A json object so does you want notice because there is a you know the relation between the response and the work inside The methods is not like everything is json inside we just emit json at the end
And whether it takes one millisecond on one and a half millisecond no one cares, right? So this is but in your case Is this like if you have to do you know a high-performance json now is the value proposition picky ason which is standard and you get 1,300 transaction per seconds or we change the API a little bit And we get 12,000 in order is a huge difference. So I would say it is and it is not if speed means money So in the cloud if you do have lots of json you could immediately get cost savings and of course the next thing energy savings Because the parser stuff is CPU intensive if it is 12 times faster it means we save a lot of energy Yeah, I mean it was it is some talks about exactly these stuff before yeah This is great work. So it means you need more leisure to do more pet projects, right? I'm actually working on some new stuff, but that's not
Okay, of course you cannot tell me this. So if I ask you so no, I cannot tell you this and then I get you know An email in the fork night action and say hey look we can talk about this now I have a new thing do you want to talk about it exactly? This is how it will look but even if it's released it is impossible to find the article so as a service to our A listness we will put it to the show notes, but you can google all the time you will never find it So I don't know what you did I looked for David Krall and Jason and I found your LinkedIn profile. This was more relevant than the article you know Nice, I need to propagate it more than As it seems yeah, we we did it now and of course So but this is the Jason P the Jason B and how Jason P looks like the Jason P We are not propagating in that much because I think that the most of the users will be using actually not that much You cannot propagate it less than this
This is already complete secret you know I mean we don't run That's for example in our documentation is below the Jason binding Because we think that the most of the users will use the the Jason binding More than the Jason P equivalent But if you want to use the Jason P equivalent You can you can approach it why I creating the Jason parser There is a Jason parser class Sorry the interface and it's having some methods which will give you back the the corresponding parser you need or the Jason generator Those are the basically two main entry points which you need to use For you to be able to start with it But the Jason P is it Hash map like It's not a hash map like that it would be an implementation of a hash map
But right now it's using Hash map like you know like the Jason P is more or less hash map like I would say yeah But it does have a hash map inside so It uses a lot of methods which could be similar to that It's it's like Because the hash map like implementation has appealing in projects where you have for instance supporting Multiple versions at the same time of the same API for instance, right And if the API evolves let's imagine we have Developed now with programming language name And then Programming language experience and then we get a version two with lm Experience so we have three fields So the new API is more flexible with the hash map because if you do Jason B You you have to make the difference Is this an valid attribute in this version or is this that attribute null not null You know or cannot be null in this version or may not exist in this version
And it was Jason P is just you know whatever comes it comes and I implement my own validator and I'm done So it is not like and of course default is Jason B But order find myself that currently lots of my project are that complicated Or complex that we just start with Jason P right Yeah, I think if you are familiar with the Jason P way It's very similar in this regard as well So but we try to avoid using those at the How it's called I don't recall for pop of my head right now But I think it's Jason factories and and supply that So we avoided those completely and We are very close and shading the right the right parser and generator you currently need you mean this Jason dot create Jason Object this is what you mean right Jason dot create Jason object. Oh that no no no I mean Sometimes when you needed to do some
When you needed to create a parser for example, you needed a factory for Jason brighter jc Yeah, yeah, yeah, yeah, yeah, yeah, yeah, yeah, yeah, yeah, okay, okay, so we avoided that and we are basically having there two main entry points And that's the Jason parser and Jason generator those are low level components which will allow you to generate the Jason or our pars it and then you can just Use the But for example Having said that the Jason B is a little bit different to Jason P but the What I appreciate is the the entry point is always cool if you have Jason and say dot and you get from the idea you know all the possibilities It's easier the discoverability is better Then you know knowing in advance new parser whatever so from the developer experience maybe An interface we just points to all this is what you just said this is Exactly something we were talking about during the Monday with my colleague
Because we want to yeah, I listen to you to your meeting We were discussing exactly that That we are missing that and we want to edit that we want to have one centralized point because The Jason binding is very easy to use because of that because there is one point which you need to remember and then you have everything And so you can decide what you want to do with the Jason exactly the the parser or the processing We are having it's it's a bit different because then you need to remember two classes or interfaces in this case and Then you can work work with that there is not a one single Central point which you could use and I absolutely agree with that and this is something we will be enhancing in the next version Because we want to introduce this this centralized point for that. That's a absolutely valid point. So yeah
So that's cool Is anything we missed I'm thinking about No, I don't think so I think We covered the What did generates how it generates and I think it's it's So it's a nice thing to mention that basically when you have those generated condo burgers created You don't have to register them yourself anywhere or or or anything like that basically you let us generate it But and it's actually converters. Yeah If I just do my developer and I put the annotation of the package info. Let's say later on now on the class And the Java record comprises string integer flow just basic data types. I don't need any converters in this case You do have do need a converter for that given record because you need to know how to handle the record itself because you need to handle each of the
Components of it components You need to handle it Separately you need to handle it as a string. You need to write it. You need to write this as a But again, I already annotated with Jason entity the person if I annotated you can generate the infrastructure Yes, and in your article We have a Jason at entity and the person so what I will do is lowercase person create a person object and string name is string component and h And I need to reflection at built time And with the reflection at built time I could generate the infrastructure for runtime right And I could have defaults. I would understand that I need converter if I need to know very specific Jason format But I already see the person person is a lowcase p the name and age as a as a Jason fields You don't need to do anything. I mean if you annotate this That's it. Yeah, you don't need to do anything Exactly. I thought that you are basically reasoning whether we do need to even have this this
This generated converter. That's what I thought you are you are basically asking about no the generated converter We need for sure. Yeah, so we will because we already talk about the annotation. Okay, so you will generate the converter from me exactly And and because let's say I would like to have the name of the person in Jason must not be named rather than first name Then can I specify something in the annotation you know similar to Jason B like name is yeah Absolutely as mentioned I was trying to do it very close to Jason B In terms of available annotations what it can do and can't do and So I took pretty much the very similar design and to be fair I think it's worth mentioning that all of our annotations are centralized in the in the Jason Class so if you so because of that you don't have to remember all the annotations or you don't have to read the documentation Jason dot is pretty cool at Jason dot at Jason dot and
You will get the all the complete list of all the available annotations and you'll just choose the right one for you So that's a that's a very cool feature and There you will see that there are for example Jason property Which is pretty much the same thing as how was that Jason B property? I think it was called and it's pretty much the same thing And you will specify your custom name and this custom name gets resolved at the compilation time as well And the general the converter gets Generated with this custom name directly. So there is absolutely no resolving whatsoever During the compilation. Oh, sorry during the runtime And that's that's that's super cool. I think that we can analyze basically everything at the compilation time And we will generate the converter which is Exactly how you need it which contains everything You would like us to do any customizations and we will use it directly you can even specify your own
Convertors or sorry this realizes or this relies those or serializers there and We will handle They're instantiating and we will use those rather some built-in ones or those which are registered At the runtime for example So yeah, but to be is there any reason for me that I would ever have to create a converter by hand no For example if if you couldn't Uh Right now, well, I'm just trying to think some some some reason for that maybe jpeg right if I would like to serialize Jpeg or png with some strange stuff maybe then yeah, if you would like to Do something which is not standard and there would be no Okay, so that's okay. Definitely you would then have to do it do it yourself But this is exception. Yeah, yeah pretty much so or it would be about the class which You can't change you can't add the annotation there
Right now at this point we are not able to generate a converter for you We are currently working on some some design some API for that as well So you could provide us over some annotation for example The class you want us to generate the converter for even though when you are not having Access to this class itself like some third-party class and you want to just You want us to handle it. So okay. Yeah, so from the user perspective It is like Jason B But in order to avoid Reflection and provide high-speed serialization desialization in the background you convert the you generate the converters but they No one cares about them. So you will see them you can debug them. So there's no magic no black magic because there's source code is source code high-performance source code and And it is based on the technology we talk about earlier with the service registry
So we already covered in all the source code generation and and stuff like that. So in our earlier episode Pretty cool. So will you attend the geek on conference? You mean in Cracco Yes, I don't think so if I if I'm not accepted and I didn't check whether my talk was accepted there Uh Then probably not unfortunately okay But if if the if the uh my YouTube audience will find a short with you So it's a who are you and what are you doing here? This is my conference shorts If they won't see this means your talk was not accepted if they find you on YouTube with geek on geek on banner then you are If it's it's very I would be there so we can we have a short coffee and yeah, it would be it was a pleasure. Yeah It was as always where people can find you on social media. So you are vertent, right? Yes
I'm on a social media. I think Twitter if anyone would be interested in talking with me just pick me there We can talk I'm happy. I help you with with these stuff So we can we can talk about it our I think blue sky but I'm not that much there anymore And actually now I realize that Twitter is not to Twitter anymore about X But my ex is still didn't accept it so But I'm on X and I'm checking it pretty regularly there or LinkedIn If you find me there feel free to pick me there as well and there's a one comment to the article And the comment is That whether you have an object pulling yes and We were talking about the question is why someone asked why why someone would be interested in object pulling if we have if we already four times faster than Jackson Uh or what's the background of that? Yeah, I think that basically background for that is that we didn't that we wouldn't have to create
A new arise for example for serializers and stuff like that Every single time when we are using that but and we could just reuse that and we could Avoid basically new instances This is I like this idea But we are struggling with it a bit because we are designing it to be virtual threats friendly So we can't use so for example some thread locals and structures like that. So We would have to use some some some blocking mechanism I'm not sure whether scope values are suitable for that I mean if this is a request bound if this is pulling within a request would be is pulling with it within a threat This would work But if you would like to pull between threats. Yeah Exactly. Then we need a different stuff right and so I was trying to
Basically this this person is suggesting us to Uh have some support for for that and He even reached out to us and proposed some some solution We are currently in the middle of investigation whether it's whether it's something worth and whether Uh We can use it but from my initial tests which I have done on this Uh actually the creation of the new array was faster than using the pool. So I don't know I yeah This is why I'm asking so what's the background because if you perform these detests and they already very very fast The assumption would be with pulling it would be even faster a lot faster. Yeah, and this is the question right So this is what what I ask. Okay, but we will cover this and um after you shipped your next pet project Right and uh you are always invited back always fun to talk with you. Yeah, it's and think about the Jason B and Jason P support and yeah and uh thank you a lot. Yeah, thank you very much for for inviting me back and as you said
It's it's always fun. I really like it. I really enjoy it. Bye Right inspired
More episodes
More from airhacks.fm podcast with adam bien

Pauseless Java: Inside Azul's C4, Falcon and ReadyNow
airhacks.fm podcast with adam bien

Turning Back Time: Strings, Locks and Garbage Collectors in Java
airhacks.fm podcast with adam bien

From PHP to Java: Building Tools, Frameworks, and AI-Assisted IDEs
airhacks.fm podcast with adam bien

Smalltalk, Blocks, and the Origins of Eclipse Collections
airhacks.fm podcast with adam bien