Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use multiple locks in ByteBuddyMockFactory to reduce lock contention #1778

Merged
merged 1 commit into from Sep 10, 2023

Commits on Sep 6, 2023

  1. Use multiple locks in ByteBuddyMockFactory to reduce lock contention

    Changed locking scheme in ByteBuddyMockFactory from a
    single global lock CACHE to cacheLocks with size 16.
    The used TypeCachingLock from cacheLocks depends on
    the hashcode of TypeCache.SimpleKey, which aggregates the types to mock.
    
    The old global CACHE lock did block Threads regardless,
    if they try to mock the same type or not.
    
    This is a similar fix as in Mockito:
    mockito/mockito#3095
    
    Co-authored-by: Björn Kautler <Bjoern@Kautler.net>
    AndreasTu and Vampire committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    171cee9 View commit details
    Browse the repository at this point in the history