Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONPath performance tuning #2629

Merged
merged 14 commits into from
Mar 26, 2024
Merged

JSONPath performance tuning #2629

merged 14 commits into from
Mar 26, 2024

Conversation

tomakehurst
Copy link
Member

Improves match performance when using matchesJsonPath in multiple stubs by per-request caching parsed JSON documents and values resolved via evaluated JSONPath expressions.

Also includes some other tunings based on profiler output.

@tomakehurst tomakehurst requested a review from a team as a code owner March 8, 2024 13:49
@@ -102,6 +103,8 @@ public void handle(Request request, HttpResponder httpResponder, ServeEvent orig

serveEvent.afterSend();
afterResponseSent(serveEvent, response);

RequestCache.onRequestEnd();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is the risk that if, for any reason, an exception is thrown, the cache never gets to be cleaned.

@tomakehurst tomakehurst merged commit 0be7371 into master Mar 26, 2024
6 of 7 checks passed
@tomakehurst tomakehurst deleted the jsonpath-performance-tuning branch March 26, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants