Skip to content
Success

Changes

Summary

  1. Improve EventBus by removing read locking. (commit: 59208aa) (details)
Commit 59208aad8678291f011da1435b1b390488ec303c by md_5
Improve EventBus by removing read locking.

This is primarily done by using ConcurrentHashMap, which has lock-free reads and thread-contention-based writes. Only one thread at a time can register threads, however, as baking events isn't thread safe (and there's no reason to make it thread-safe anyway).

My own benchmarks indicate 1.4-2.2 million operations/ms throughput and approximately ~1ns/event post for four threads posting events.
(commit: 59208aa)
The file was modifiedevent/src/main/java/net/md_5/bungee/event/EventBus.java (diff)