Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#133): Add MeasuredXsl And Tweak line-is-absent Check #147

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

volodya-lombrozo
Copy link
Member

In this PR I've:

  1. Added MeasuredXsl that can measure time of all xsl transformations and prints messages into a log:
18:35:05 [WARN] org.eolang.lints.MeasuredXsl: XSL transformation 'sparse-decoration' took 473ms, whereas threshold is 100ms
  1. I tweaked line-is-absent check:

From ProgramTest#lintsLargeJnaClass(@Mktmp final Path home):

Before:

org.eolang.lints.MeasuredXSL: XSL transformation 'line-is-absent' took 4s, whereas threshold is 100ms

After:

17:51:22 [WARN] org.eolang.lints.MeasuredXSL: XSL transformation 'line-is-absent' took 117ms, whereas threshold is 100ms

Benchmark

Before:

Input: com/sun/jna/Pointer.class
Size of .class: 22Kb (22Kb bytes)
Size of .xmir after disassemble: 1Mb (1Mb bytes, 29630 lines)
Lint time: 9s (9332 ms)

After:

Input: com/sun/jna/Pointer.class
Size of .class: 22Kb (22Kb bytes)
Size of .xmir after disassemble: 1Mb (1Mb bytes, 29630 lines)
Lint time: 7s (7200 ms)

Realted to #133.

@volodya-lombrozo
Copy link
Member Author

@yegor256 Could you have a look, please?

* XSL that measures the time of transformation.
* @since 0.1
*/
public final class MeasuredXsl implements XSL {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@volodya-lombrozo maybe it's better to put it into test/ directory? It's only for tests, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yegor256 I can't place it into test/ directory, since I use in in LintByXsl class.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@volodya-lombrozo let's make it package private then

Copy link
Member

@yegor256 yegor256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@volodya-lombrozo let's make this class package-private, since it's not part of external API of this library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants