Skip to content

Commit

Permalink
feat(objectionary#889): add one more puzzle
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Dec 1, 2024
1 parent 69597eb commit 157b83b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ private static Node open(final Path path) {

/**
* Optimized schema for XMIR.
* It is an optimized version of {@link org.eolang.parser.Schema} class.
* @since 0.6
* @todo #889:30min Use the `Schema` class instead of `OptimizedSchema`.
* The `OptimizedSchema` class is a temporary solution to avoid the performance
* issues with the `Schema` class. We will be able to remove this class after
* the following issue is resolved:
* https://github.com/jcabi/jcabi-xml/issues/277
*/
private static class OptimizedSchema {
/**
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/org/eolang/jeo/representation/xmir/XmlNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
public final class XmlNode {

/**
* Parent node.
* XML node.
* Attention!
* Here we use the {@link Node} class instead of the {@link com.jcabi.xml.XML}
* by performance reasons.
* In some cases {@link Node} 10 times faster than {@link com.jcabi.xml.XML}.
* You can read more about it here:
* <a href="https://github.com/objectionary/jeo-maven-plugin/pull/924">Optimization</a>
*/
private final Node node;

Expand All @@ -57,7 +63,7 @@ public XmlNode(final String xml) {

/**
* Constructor.
* @param parent Parent node.
* @param parent Xml node.
*/
public XmlNode(final Node parent) {
this.node = parent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public final class XmlProgram {

/**
* Root node.
* Here we use the {@link Node} class instead of the {@link com.jcabi.xml.XML}
* by performance reasons.
* In some cases {@link Node} 10 times faster than {@link com.jcabi.xml.XML}.
* You can read more about it here:
* <a href="https://github.com/objectionary/jeo-maven-plugin/pull/924">Optimization</a>
*/
private final Node root;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ void failsToOpenBrokenXmirRepresentationFromFile(@TempDir final Path dir) throws
* This is a performance test, which is disabled by default.
* It is used to measure the performance of the conversion of the EO object
* into the bytecode representation and back.
* 1) Timings before the optimization were: 21s, 23s, 21s, 21s (500 attempts)
* 2) `XMLDocument` -> `org.w3c.Node` optimization: 11s, 10s, 11s, 10s (500 attempts)
* 3) Remove `XMLDocument` usage: 10s, 9s, 9s, 9s (500 attempts)
*/
@Test
@Disabled
Expand Down

0 comments on commit 157b83b

Please sign in to comment.