Skip to content

Commit 15862b8

Browse files
committed
add test case used for some profiling
1 parent a21efe1 commit 15862b8

File tree

2 files changed

+97222
-0
lines changed

2 files changed

+97222
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2002-2024 Gargoyle Software Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* https://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
package org.htmlunit.html.performance;
16+
17+
import java.io.IOException;
18+
import java.net.URL;
19+
20+
import org.htmlunit.BrowserVersion;
21+
import org.htmlunit.WebClient;
22+
23+
/**
24+
* Tests for handling huge content.
25+
*
26+
* @author Ronald Brill
27+
*/
28+
public final class HugePagePerformanceTest {
29+
30+
private HugePagePerformanceTest() {
31+
}
32+
33+
public static void main(final String[] args) throws IOException {
34+
final URL fileURL = WebClient.class.getClassLoader()
35+
.getResource("testfiles/huge-pages/html-standard-2024-10-17.html");
36+
37+
try (WebClient webClient = new WebClient(BrowserVersion.CHROME, false, null, -1)) {
38+
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
39+
40+
final long start = System.currentTimeMillis();
41+
for (int i = 0; i < 20; i++) {
42+
webClient.getPage(fileURL);
43+
System.out.println(" " + i);
44+
}
45+
System.out.println("## " + (System.currentTimeMillis() - start));
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)