[ 
https://issues.apache.org/jira/browse/IOTDB-4791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17626457#comment-17626457
 ] 

Liuxuxin commented on IOTDB-4791:
---------------------------------

Test program:

 

public static String getRandomString(int length) {
String str = "abcdefghijklmnopqrstuvwxyzABCDEGHIJKLMNOPQRSUVWXYZ";
Random random = new Random();
StringBuffer sb = new StringBuffer();
int len = str.length();
for (int i = 0; i < length; i++) {
int number = random.nextInt(len);
sb.append(str.charAt(number));
}
return sb.toString();
}

public static void main(String[] args) {
long totalCost = 0;
for (int i = 0; i < 1000000; ++i) {
StringBuilder builder = new StringBuilder().append("root.");
for (int j = 0; j < 5; ++j) {
builder.append(getRandomString(5));
builder.append(".");
}
builder.append(getRandomString(5));
long startTime = System.nanoTime();
new Path(builder.toString(), true);
totalCost += System.nanoTime() - startTime;
}
System.out.println(totalCost);
}

> readChunkMetadataAndConstructIndexTree is too slow for sealing TsFile
> ---------------------------------------------------------------------
>
>                 Key: IOTDB-4791
>                 URL: https://issues.apache.org/jira/browse/IOTDB-4791
>             Project: Apache IoTDB
>          Issue Type: Improvement
>          Components: Core/TsFile
>            Reporter: yusicheng
>            Assignee: Liuxuxin
>            Priority: Major
>         Attachments: image-2022-10-28-16-48-57-842.png
>
>
>  !image-2022-10-28-16-48-57-842.png! 
> you can see this method spend almost half time on Path:<init>, is there any 
> possible to speed up this method?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to