Don't decompress responses by default
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
### Use case
When an HTTP Response is received, it is always decompressed before storing it in the 'responseData'. This is a waste of cpu and memory resources in the majority of the cases when the responseData is never used. Especially for heavy javascript and stylesheets, it can be a waste when the response isn't used for an extractor or assertion.
Imagine how much memory can be saved if we store the compressed content and don't decompress by default, and only decompress when the responseData is accessed. We could even safe more memory if we never store the response headers and body if the result isn't used.
### Possible solution
Best solution:
Check if a sampler has extractor or assertion, only then decompress and store response data (header and body)
Improved solution
In case it is hard to detect whether the result will be accessed by code (jsr223, preprocessor of subsequent sampler etc), we can store the response data as is without decompressing upfront. In case the response data is accessed, then it should be decompressed.
We can even consider not storing the response data by default and use a flag on the sampler if we need to store it because future code need to access the data.
### Possible workarounds
_No response_
### JMeter Version
5.6.3
### Java Version
*
### OS Version
*
Contributor guide
Research direction
Start by tracing the HTTP sampler path that populates and later accesses responseData, including extractor and assertion handling. Review how compressed responses, headers, and bodies are currently retained, then define tests that verify deferred or conditional decompression without breaking code that accesses the response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100