jasonk000 opened a new pull request #12113:
URL: https://github.com/apache/druid/pull/12113


   Reduce the number of times a timestamp is parsed and read if the row is a 
transformed row.
   
   During ingestion the parsing and appending functionality requires repeated 
access to the timestamp information from the row. In the case of a 
TransformedInputRow, this could be an expensive step:
   
   ```
   {
     "type": "expression",
     "name": "__time",
     "expression": "(point_seconds * 1000.0) + (point_nanos / 1000000.0)"
   },
   ```
   
   By caching this row, a significant reduction in CPU time can be achieved, in 
this example from 14% to 4% of CPU involved in reading Timestamps, a 10% 
reduction. This change converts the processing from lazy load of timestamp 
during Transform to an eager transform, and then keeps the result.
   
   Before:
   
![image](https://user-images.githubusercontent.com/3196528/147988949-ed26c604-2c8a-478e-be13-9a476eff70b7.png)
   
   After:
   
![image](https://user-images.githubusercontent.com/3196528/147988927-922f14f5-2e97-4f0e-a105-8b0fe79e8912.png)
   
   This PR has:
   - [x] been self-reviewed.
      - [ ] N/A using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [x] added documentation for new or modified features or behaviors.
   - [x] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] N/A added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [x] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] N/A added unit tests or modified existing tests to cover new code 
paths, ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] N/A added integration tests.
   - [x] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to