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

Reads from java are slow due to many system calls?

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 14w04b, Minecraft 14w18b, Minecraft 14w31a
    • Fix Version/s: Minecraft 15w46a
    • Labels:
      None
    • Environment:

      Linux, very likely unrelated just easier to proof on Linux

    • Confirmation Status:
      Unconfirmed

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: