carlrobertoh / llm-client

User-friendly Java HTTP client that provides access to large language model APIs and services
https://central.sonatype.com/artifact/ee.carlrobert/llm-client
MIT License
17 stars 27 forks source link

feat: Use ObjectMapper constants to reduce overhead #22

Closed reneleonhardt closed 5 months ago

reneleonhardt commented 5 months ago
reneleonhardt commented 5 months ago

ObjectMapper is thread-safe, a single instance is sufficient.

If you want I can switch from jackson to fastjson2, should be much faster: https://github.com/fabienrenaud/java-json-benchmark

Would updating to Java 17 possible?

carlrobertoh commented 5 months ago

Perhaps it's better to have a shared single instance instead?

If you want I can switch from jackson to fastjson2, should be much faster:

It's fine. Jackson seems to be defacto standard across Java projects, and performance doesn't really play a huge role in our usecases.

Would updating to Java 17 possible?

Yep, this is still on my bucket list. I recently upgraded the plugin from 11 -> 17 and haven't had the chance to update the client library yet.

reneleonhardt commented 5 months ago

Perhaps it's better to have a shared single instance instead?

It's only a few unnecessary instances, but I can consolidate them, sure.

Yep, this is still on my bucket list. I recently upgraded the plugin from 11 -> 17 and haven't had the chance to update the client library yet.

No stress, it's great to see that projects are actively upgrading, Java 21 is awesome! 🚀