# .NET ElasticLowLevelClient 7.4.1 serializer extremely slow

**URL:** <https://discuss.elastic.co/t/net-elasticlowlevelclient-7-4-1-serializer-extremely-slow/210332>\
**Category:** Elasticsearch\
**Created:** [December 3, 2019, 11:21am UTC](https://discuss.elastic.co/t/net-elasticlowlevelclient-7-4-1-serializer-extremely-slow/210332 "2019-12-03T11:21:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewolfman](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@ewolfman](https://discuss.elastic.co/u/ewolfman)\
**Post date:** [December 3, 2019, 11:21am UTC](https://discuss.elastic.co/t/net-elasticlowlevelclient-7-4-1-serializer-extremely-slow/210332/1 "2019-12-03T11:21:17Z")

</div>

Hi,

I recently switched from ES 6.8.5 to 7.4.2. I noticed that bulk loading became extremely slow. I narrowed down the problem to the .NET's ElasticLowLevelClient serialization.

For example, serializing the following code 100K times in ES 6 takes ~1 second where as in ES 7 takes about **70** seconds (!!). As I have millions of records, this becomes a real problem.

```
var o = es.Serializer.SerializeToString(new
{
    index = new
    {
        _index = indexName,
        _id = session.SESSION_ID
    }
}, SerializationFormatting.None);

```

I also tried using MemoryStreamFactory.Default for the serialization but results are the same.

When the serialized class is bigger, the performance is even worse.

Currently I temporarily (?) switched to Newtonsoft JSON and the results are satisfying.  
Can you please advise? Is there anyway to get the previous serializer or its performance?

Thanks.

---

<div class="post-metadata">

**Author:** ![ewolfman](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@ewolfman](https://discuss.elastic.co/u/ewolfman)\
**Post date:** [December 10, 2019, 6:41am UTC](https://discuss.elastic.co/t/net-elasticlowlevelclient-7-4-1-serializer-extremely-slow/210332/2 "2019-12-10T06:41:07Z")

</div>

Submitted bug: [https://github.com/elastic/elasticsearch-net/issues/4260](https://github.com/elastic/elasticsearch-net/issues/4260)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2020, 6:41am UTC](https://discuss.elastic.co/t/net-elasticlowlevelclient-7-4-1-serializer-extremely-slow/210332/3 "2020-01-07T06:41:13Z")

</div>

Closed on January 7, 2020, 6:41am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
