Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Warm up the Newtonsoft serializer #8
The first call to Newtonsoft.Json SerializeObject is very slow, taking 90-100ms on a slower VM. Subsequent calls are 3-4 orders of magnitude faster.
This change executes a dummy serialization before the test starts in order to avoid paying that cost while the measurement is running, reducing the observer effect. Branch with logging is available here. The CPU cost of the exe while running against a light page comes down ~20% with this change (395ms to 321ms in our lab measured starting from navigation start).
Example run before the change:
After the change: