Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-45842

Reads from java are slow due to many system calls?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 15w46a
    • Minecraft 14w04b, Minecraft 14w18b, Minecraft 14w31a
    • None
    • Linux, very likely unrelated just easier to proof on Linux
    • Unconfirmed

      I decided to strace minecraft for fun and giggles to find out that it does many read() system calls with a buffer length of 1, I found this kind of disturbing and decided to investigate. And I could only reproduce this by creating a 1 byte buffer to read into from Java. Now what's the bug? Well this seems kind of really weird, chunk files are padded to 4096 bytes, so why not read those in well 'chunks' of 4096 bytes instead? Causes less system calls and is in theory faster. Attached is a small portion of the strace where the odd read system call behavior is visible.

            grum [Mojang] Grum (Erik Broes)
            schoentoon Toon Schoenmakers
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: