-
Notifications
You must be signed in to change notification settings - Fork 99
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
IGNITE-24163 Optimize EventLog #5004
base: main
Are you sure you want to change the base?
Conversation
43c78cc
to
0adaae8
Compare
modules/eventlog/src/main/java/org/apache/ignite/internal/eventlog/api/EventLog.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/ignite/internal/eventlog/impl/ConfigurationBasedChannelRegistry.java
Outdated
Show resolved
Hide resolved
guard.readLock().unlock(); | ||
} | ||
Set<EventChannel> result = typeCache.get().get(igniteEventType); | ||
return result == null ? Set.of() : new HashSet<>(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to copy result
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I return the collection outside and I do not want anybody to modify it.
e48737e
to
9ac4c34
Compare
* Get rid of unnecessary locking in `log` method * Add one more "lazy" log method to the interface
9ac4c34
to
7fbdc5b
Compare
@AMashenkov applied most of your suggestions. Also, added a couple of additional optimizations (return null instead of empty collection) wich have improved the performance of the critical path. The PR now is ready for review. |
log
methodisEmpty()
call was contributing about 20% execution time toEventLog.log
method)https://issues.apache.org/jira/browse/IGNITE-24163