# Nx vs. Python performance for sentence-transformer encoding

**URL:** <https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502>\
**Category:** Questions\
**Tags:** benchmark, nx\
**Created:** [June 14, 2023, 3:53pm UTC](https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502 "2023-06-14T15:53:14Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![josevalim](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/32/1787_2.png) [@josevalim](https://forum.elixirforum.com/u/josevalim)\
**Post date:** [July 25, 2023, 7:18pm UTC](https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/35 "2023-07-25T19:18:09Z")

</div>

> [@steffend](#):
>
> So it seems like Ortex does not benefit that much from using Nx.Serving, as the model does not need to be precompiled to certain input shapes, in contrast to when using EXLA, is that right?

I am not sure if we should generalize that to Ortex but we can conclude that’s true for Ortex+sberts running on CPU. I assume GPUs will be happier with batching than CPUs, even if not compiled. 🙂

---

_[View the full topic](https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502)._
