I am using the operation JSON.stringify which is taking a lot of time.Do we have other options that can reduce the time?

Not applicable

The response is coming as a JSON which is around 230KBs. We are using a javascript to convert the JSON into a format that makes it around 1.6MB. During this conversion, the JSON.Stringify operation alone is consuming around 100ms. (The total time taken by the policy is in the range 80ms-200ms) Is there any way to reduce the time?

0 2 6,064
2 REPLIES 2

Former Community Member
Not applicable

If you can use node.js,you might want to consider using the JSONStream package. JSON.parse and JSON.stringify do have performance impacts (esp. when dealing with large payloads). When dealing with large documents, streaming can help.

@Mrinmaya Shrivastava

There are options discussed in this link on how to optimize performance of json.Stringify :

https://github.com/svaarala/duktape/issues/204

for your consideration.