Hacker Newsnew | past | comments | ask | show | jobs | submit | latonz's commentslogin

Automapper generates all mappings at runtime with reflection. Mapperly in contrast uses roslyn based source generators and generates all mapping code at compile time. This leads to improved runtime performance with less allocations [1]. Since no reflection is used at runtime, the generated code is completely trimming save and AOT friendly.

[1] https://github.com/mjebrahimi/Benchmark.netCoreMappers


And what's the advantages over Mapster? (haven't used it yet, but I see it's mentioned often as a "better Automapper" alternative)


Never used Mapster myself, but as far as I can see, Mapster does not provide a Roslyn based source generator. By default, it seems to create mappings at runtime (if not using the Mapster Tool to create mappings at build time).


Even though AutoMapper of course uses reflection to construct mappings, executing mappings does not involve reflection if not necessary. AutoMapper builds expression trees, compiles them on first use, and uses the resulting function to perform the mapping. If your mapping involves things only accessible through reflection, then the compiled mapping function will of course still have to rely on reflection.


Those are pretty compelling advantages. Thanks for sharing.


Kreya[1] does exactly that. It stores all it‘s data in easy diffable text formats in the filesystem. Currently kreya is limited to gRPC. However, REST support should land soon.

Disclaimer: I‘m one of the creators of Kreya.

[1]: https://kreya.app


One of the creators here: We started developing Kreya a year ago when we felt some necessary GUI tooling around the gRPC ecosystem was missing. We didn't just want to create a simple gRPC client, but wanted to add powerful features such as environments/templating or global authentication configurations, so you don't have to enter the same values and configurations tediously again and again. We're curious to hear your opinions on Kreya, so hit us with any questions or feedback!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: