Skip to content

Use BufferedInputStream in SimpleMetaDataReader to double performance [SPR-9528] #14162

@spring-projects-issues

Description

@spring-projects-issues

Michael Hunger opened SPR-9528 and commented

We have a customer who generated a lot of Spring Data Repositories, the startup time of his application was very long due to that (40 seconds).

When profiling I saw that most of the time was spent in ASM reading the files. As I know ASM to be very fast I looked into the issue and saw
that SimpleMetadataReader doesn't wrap the input stream in a BufferedInputStream. So I tried it in a copy of SimpleMetadataReader
and startup time halved from 40s to 20s.

{CODE}
SimpleMetadataReader(Resource resource, ClassLoader classLoader) throws IOException {
InputStream is = new BufferedInputStream(resource.getInputStream());
{CODE}


Sub-tasks:

Referenced from: commits 556c6a7, fdb9de1

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions