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

Improve performance of parsing #126

Merged
merged 2 commits into from
Sep 30, 2018
Merged

Commits on Sep 30, 2018

  1. Improve performance of parsing

    Looping through strings in Javascript land is a lot slower than having
    the JS engine do it natively.  String's indexOf does this faster than
    looping through each character.
    
    This change deals with parsed data (i.e. the raw text between the
    tags), attribute values (what's in the quotes) and inside XML
    comments.  These three types of data account for a very large portion
    of characters in any XML document, leaving behind mainly names of tags
    and of attributes.
    
    It might be worth it to rewrite the switch statement, or move the
    optimisations into the switch statement itself.
    Erik Mogensen committed Sep 30, 2018
    Configuration menu
    Copy the full SHA
    b9fccbc View commit details
    Browse the repository at this point in the history
  2. Changed benchmark to reflect larger text/attributes

    This is to ensure that the benchmarking isn't skewed towards small
    attribute values, and documents without significant portions of text,
    which it was before xmppjs#126
    Erik Mogensen committed Sep 30, 2018
    Configuration menu
    Copy the full SHA
    dc90ab2 View commit details
    Browse the repository at this point in the history