[CHALLENGE] Faster YAML Library

Discussion in 'Plugin Development' started by codename_B, Sep 6, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    codename_B

    So I've run into a little bit of a bottleneck with bPermissions enabling.
    SnakeYAML is sloooow!

    http://pastebin.com/R0DUxBbw

    I want to parse this file in as little as time possible.
    Fancy YAML stuff not necessary.

    Requirements:
    • Must be able to read that file
    • Must be able to write it back
    • Must store data in a Map<String, Object> table post-load to allow manipulation and access
    What I've managed
    • 8351 users in 803ms (FakeYaml, my little project)
    • 8351 users in 3512ms (SnakeYAML)
    Your challenge
    • Beat my time!
     
  2. Offline

    codename_B

  3. Offline

    QuantumDev

    What's the time you have there? Reading time? Writing time? Putting it all in a Map? All of them?
     
  4. Offline

    hawkfalcon

  5. Offline

    JOPHESTUS

    I got 799ms
     
  6. A bit more information, please :p
    You said it had to "parse this file". How specific to that file is it allowed to be? I mean, I could just hardcode everything in there in the script, read over the file for no reason and present you a pre-built result, then I got the file parsed ;)

    Or is it more like "any file with that rough structure" (like "permissions:" and "groups:" blocks that need to be parsed)? If so, how do you need the data, like how is the value part of the map supposed to be structured? I could just store all the lines per player as a String, and/or parse that string lazily on access.

    And ms time is different on everyone's PC, and you didn't really make clear where to start and stop measuring.

    Sounds like a fun challenge, if the requirements are given a little more specific.
     
  7. Offline

    codename_B

    Heh, well how about compare to the standard time to load into a Map<String, Object> hashmap (compared to SnakeYaml).
    And that's reading time, I've got writing time for a file of that size down to 66ms.
     
Thread Status:
Not open for further replies.

Share This Page