Skip to content

Each call to json.provider() is effectively call to class loader -> java.io.RandomAccessFile with locking #414

@KliminV

Description

@KliminV

I recently discovered an throughput bottleneck within my micronaut application which using kafka streams and micnronaut serde. After using JFR, i see blocked threads on monitors on java.io.RandomAccessFile call.

After investigation, i found out that bottleneck happens when trying to load class from classloader - effectively calls RandomAccessFile with file locking.

Each time we call Json.createGenerator with bytes we effectively will lock filesystem and block on monitor (if parallel processing happens)

I propose to cache generator in Api

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