Skip to content

Startup time slower in 1.5.x due to excessive calls to RandomAccessFile #11152

@alexanderuv

Description

@alexanderuv

Bug Report
I have a project that is using Spring Boot 1.2.2. Now, I'm planning to migrate to 1.5.8.
I started by upgrading the packaging (maven plugin - repackage goal) first. Although there's no functional issue, I was surprised to see the startup time in the DEV server DOUBLED (at the very least). However, I can't reproduce this behavior locally - where the startup time actually went down by at least 20%.

In order to understand where the problem was, I tried using every possible version between those two to understand what was the version that introduced the problem. Unfortunately, for some reason versions 1.4.x to 1.5.1 didn't work. Looks like there was some bug that was fixed as I had some classpath issue.

However version 1.3.8 still worked and the startup time was fine. After some more profiling, I finally found something interesting. The number of calls to RandomAccessFile had grown a lot from 1.3.8 to 1.5.2.

  • v1.3.8 -> ~291,000 calls
  • v1.5.2 -> ~647,000 calls

This didn't seem like a problem when running locally, but when on the DEV server, it was. Now, the apps running on the DEV server are executed from a Network share, and every file operation has way more latency, so I figured the slowness might be due to the increase in file operations.

Would it be possible to cache some of these calls? or pre-read bigger chunks of the file? Even an extension point would be useful in this case.

SpringBoot 1.5.2 startup

SpringBoot 1.3.8 startup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions