JSON.parse takes more time to parse the data

Surbhi Srivasta
Tera Expert

Hi,

We are currently facing an performance issue with use of JSON.parse() for one of our integration.

 

Current payload is not that huge within 1 MB of JSON string coming in from source system. When we try to parse the data to retrieve the attributes, it always take roughly ~7 to 8 seconds to parse the data. 

Problem is this parsing happens in sequence for many number of records so the total time if we add up becomes close to 15-20 mins of delay.

 

Question -

1. Is there a better way available to parse the incoming JSON string and retrieve details?

2. Any other alternative which I can use instead of JSON.parse?

 

Regards,

Surbhi

6 REPLIES 6

@Ankur Bawiskar 

JSON size is not that big, close to1 or 2 KB still Parsing is taking close 3-4 seconds to parse the incoming data. Incoming JSON contains only 10-30 objects only.

 

Any thoughts on this?

 

@Surbhi Srivasta 

the time script takes also depends on how many nodes etc an instance has.

I think 3-4 seconds is still fine.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader