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

Performance optimization #352

Merged
merged 6 commits into from
Jul 19, 2024
Merged

Performance optimization #352

merged 6 commits into from
Jul 19, 2024

Commits on Jun 30, 2024

  1. #340 optimize CPU and memory consumption in ClassCondition

    My profiler shows that some remarkable % of CPU is spent on generating this string: (" " + c + " "). Now we check for CSS class without generating the new string. The code is longer, but faster.
    asolntsev committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    6612ce5 View commit details
    Browse the repository at this point in the history
  2. #340 optimize CPU and memory consumption in LangCondition

    Now we check the "lang" attribute without calling `String.split` method which generates new strings.
    asolntsev committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    6d7d6d1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6c6f3ee View commit details
    Browse the repository at this point in the history
  4. #340 remove "synchronized" modifiers that seemed unneeded to me

    in some places, I replaced them with `synchronizedMap()` or `ConcurrentHashMap`.
    Not 100% sure nothing gets broken. :)
    But at least all tests are still green.
    asolntsev committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    f8b331c View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. #340 change parameter type from Object to Node

    I don't know what was the initial idea, and was it intended to pass any other parameters, but currently only `org.w3c.dom.Node` is passed there.
    asolntsev committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    fc6312f View commit details
    Browse the repository at this point in the history
  2. #340 cache attribute values of xml elements

    My profiler shows that `nsh.getClass((Element) e)` consumes quite a remarkable percentage of total CPU time.
    So I hope caching these value could improve performance (though, my profiler doesn't show it :) ).
    asolntsev committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    749ff44 View commit details
    Browse the repository at this point in the history