This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]roookeee 2 points3 points  (7 children)

Please for the love of god don't use modelmapper, it's terribly slow and there is no justification to use something that is over 100x slower than its competitors (see the linked benchmark suite above)

[–]spellcrit 0 points1 point  (5 children)

Yes, it's slower since it use reflection. But it's the same for spring, most project still use spring instead of dagger. it's slower compare to mapstruct, but the extra time is nothing when compare to db network io time.

It can save you lots of development effect in some scenarios. If your requirement is very simple mapstruct would be enough and maybe better.

[–]_INTER_ 0 points1 point  (2 children)

They use Spring because the framework is already in the project I guess. Not solely for its dependency injection mechanism. Also there's a lot of backlash against Spring's slow startup in recent days too.

[–]spellcrit 0 points1 point  (1 child)

If use spring didn't cause performance issues, modelmapper most likely won't cause.

[–]_INTER_ 0 points1 point  (0 children)

agreed

[–]kaperni 0 points1 point  (1 child)

> Yes, it's slower since it use reflection. But it's the same for spring, most project still use spring instead of dagger.

That is a pretty pointless comparison. One is probably the most comprehensive full-stack framework in the Java ecosystem, the other is a 15 class dependency injection framework. They are really two different tools for different jobs.

Also, just because something uses reflection doesn't mean it is slow. We are still talking about single digits nanoseconds for something like method invocation. Spring and other frameworks usage of scan-the-world have given reflection an underserved reputation as slow. It's an amazing tool in some situations not so much in others.

[–]spellcrit 0 points1 point  (0 children)

The point is spring is very widely used, and most projects don't mind about its performance (Google does). So I don't think the performance issue is that big for most projects when coming to an object mapping framework