HTHou opened a new pull request, #11723: URL: https://github.com/apache/iotdb/pull/11723
## Description https://apache-iotdb.feishu.cn/docx/AlXqdy9PjoWoenx1WfBcjNOqnyg#JAN1dkRu9o2B4xxVVwfc4V7onze  In the insertRecords interface, the record scheduleLockCost occupies 2.2% of the global CPU overhead, while it is only 0.03% in insertTablet. One important reason for this is that when insertRows is executed, it iterates over Rows, applying insertRow once to each Row. Each time insertRow is called, Metrics will update cost. When there are very many rows, the overhead of updating the Histogram becomes significant. The simplest optimization is to return the cost as a result to the upper layer, and then update the Cost uniformly once all rows have been inserted. ## Test Benchmark config ``` DB_SWITCH=IoTDB-110-SESSION_BY_RECORDS LOOP=10 DEVICE_NUMBER=5000 SENSOR_NUMBER=20 VECTOR=false BATCH_SIZE_PER_WRITE=1000 ``` IOTDB config ``` Confignode ON_HEAP_MEMORY=8G Datanode ON_HEAP_MEMORY=8G ``` Before the optimization Throughput 8367755.72 point/s Profile <img width="872" alt="image" src="https://github.com/apache/iotdb/assets/25913899/06c26b50-343f-4dc4-ba48-24b70c511524"> After the optimization Throughput 6751503.68 point/s Profile <img width="994" alt="image" src="https://github.com/apache/iotdb/assets/25913899/f2a3c708-007b-4ad2-bd11-2b138d1949f6"> -- 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]
