diff --git a/pom.xml b/pom.xml index b6dbb91609c..9a7e9a73d7e 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,8 @@ **/CodeChecker.java + 15 + 15 @@ -1200,6 +1202,22 @@ + + xerces + xercesImpl + 2.12.2 + + + org.openjdk.jmh + jmh-core + 1.37 + + + org.openjdk.jmh + jmh-generator-annprocess + 1.37 + provided + org.apache.httpcomponents diff --git a/src/main/java/org/htmlunit/platform/util/XmlUtilsSunXercesHelper.java b/src/main/java/org/htmlunit/platform/util/XmlUtilsSunXercesHelper.java index f4594f149b1..c0150dff886 100644 --- a/src/main/java/org/htmlunit/platform/util/XmlUtilsSunXercesHelper.java +++ b/src/main/java/org/htmlunit/platform/util/XmlUtilsSunXercesHelper.java @@ -20,13 +20,13 @@ import java.util.Map; import java.util.Objects; +import org.apache.xerces.dom.DeferredDocumentImpl; +import org.apache.xerces.dom.DeferredNode; import org.htmlunit.platform.XmlUtilsHelperAPI; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl; -import com.sun.org.apache.xerces.internal.dom.DeferredNode; /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
diff --git a/src/test/java/org/htmlunit/benchmarks/HtmlUnitBenchmark.java b/src/test/java/org/htmlunit/benchmarks/HtmlUnitBenchmark.java new file mode 100644 index 00000000000..07a03ccda9e --- /dev/null +++ b/src/test/java/org/htmlunit/benchmarks/HtmlUnitBenchmark.java @@ -0,0 +1,784 @@ +package org.htmlunit.benchmarks; + +import org.htmlunit.BrowserVersion; +import org.htmlunit.SimpleWebTestCase; +import org.htmlunit.WebClient; +import org.htmlunit.html.HtmlPage; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Timeout; +import org.openjdk.jmh.annotations.Warmup; + +@State(Scope.Benchmark) +public class HtmlUnitBenchmark extends SimpleWebTestCase { + + String html = """ + + + + +
+ + +
+
+
+
+
+
+

+ + Stella Levinson + +

+
+
+

+ + Project manager + + + Project manager + + + Project manager + + Project manager + + + +

+
+
+

+ + Looking for my next opportunity to make a change. The digital way. + +

+
+ +
+
+
+ + + +
+
+
+
+
+
+
+
+ +
+
+
+
+

+ + I advise companies and NGOs in initiatives and campaigns + +

+
+
+

+ + For more than 15 years, I've been working with international clients on a range of projects, gathering experience in diverse areas. I look forward to hearing about your project and plan its success together.  + +

+
+ + + + + + + SEE RESUME + + +
+
+
+
+
+
+
+

+ + Recommendations + +

+
+
+ +
+
+
+
+
+
+
+
+

+ + Work Experience + +

+
+
+
+
+
+
+
+
+
+ + 2020-2021 + +
+
+
+

+ + Advisor, South Company + +

+
+
+
+
+

+ + In this position, I led a team of more than 40 professional and volunteer staff members, from various company departments.  + + + + + +

+
+
+
+
+
+
+
+
+
+ + 2019-2020 + +
+
+
+

+ + Consultant, North Company + +

+
+
+
+
+

+ + In this position, I led a team of more than 40 professional and volunteer staff members, from various company departments.  + +

+
+
+
+
+
+
+
+
+
+ + 2018-2019 + +
+
+
+

+ + Project manager, East Company + +

+
+

+ + Project manager, East Company + +

+

+ + Project manager, East Company + +

+

+ + Project manager, East Company + +

+

+ + Project manager, East Company + +

+

+ + Project manager, East Company + +

+
+ + +
+
+
+
+

+ + + In this position, I led a team of more than 40 professional and volunteer staff members, from various company departments. + + +

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ + Education + +

+
+
+
+
+
+ + 2014-2018 + +
+
+
+

+ + New York University + +

+
+
+

+ + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + +

+
+
+
+ + 2010-2014 + +
+
+
+

+ + Texas University + +

+
+
+

+ + Bachelor of Arts in International Studies (BAIS) + +

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ + Professional skills + +

+
+
+
+
+

+ + Entrepreneurial Mindset + +

+
+
+

+ + Go-to-Market Planning + +

+
+
+
+
+

+ + Teamwork & Collaboration + +

+
+
+

+ + Digital Analytics + +

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ + Languages + +

+
+
+
+
+

+ + English + +

+
+
+

+ + French + +

+
+
+ + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + + MBA in International Studies and Economics + + + + MBA in International Studies and Economics + + + + +
+
+

+ + Dutch + +

+
+
+

+ + Spanish + +

+
+
+
+
+
+
+
+
+

+ + Get in Touch + +

+
+
+

+ + + Want to hear more about how I can help your project succeed. Send me an email or call me and let's talk about your needs. + + +

+
+
+

+ + Call: 123-456-7890 + +

+

+ +
+
+

+

+ + Write: info@mysite.com + +

+
+ + +
+
+
+

+

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+ + +
+ +
+ + + + +
+
+ + +
+
+
+
+
+
+
+ + + + + """; + + @Benchmark + @Fork(1) + @Warmup(iterations = 3) + @Timeout(time = 1000) + @Measurement(iterations = 4) + @BenchmarkMode(Mode.All) + public void JMH() throws Exception { + + setBrowserVersion(BrowserVersion.CHROME); + WebClient webClient = new WebClient(BrowserVersion.getDefault(), false, null, -1); + webClient.getOptions().setJavaScriptEnabled(false); + webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); + webClient.getOptions().setCssEnabled(false); + webClient.getOptions().setHistoryPageCacheLimit(0); + webClient.getOptions().setHistorySizeLimit(0); + webClient.getOptions().setWebSocketEnabled(false); + webClient.setFrameContentHandler(baseFrameElement -> false); + HtmlPage pageFromString = loadPage(webClient, html, null, URL_FIRST); + + assert !pageFromString.querySelector("h1").asNormalizedText().contains("Stella"); + } + +}