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

Significant overhead caused by AbstractContext's internal ArrayDeque stacks that created even if there are no VisitListeners #4651

Closed
lukaseder opened this issue Oct 17, 2015 · 0 comments

Comments

@lukaseder
Copy link
Member

Once #3935 is resolved, we might end up with no VisitListeners in the AbstractContext type, if clients aren't using any visit listeners. This means that we don't need to create any related instances of ArrayDeque in the AbstractContext:

    // [#2665] VisitListener API
    final VisitListener[]             visitListeners;
    private final Deque<Clause>       visitClauses; // Unneeded, if visitListeners.length == 0
    private final DefaultVisitContext visitContext; // Unneeded, if visitListeners.length == 0
    private final Deque<QueryPart>    visitParts; // Unneeded, if visitListeners.length == 0

Neither do we need to push and pop QueryParts onto these stacks. Avoiding to do so will decrease the pressure on GC, as well as speed up AST traversal in general. In a benchmark run against H2, this accounts for an improvement of 20%!

This is a finding from analyses made after a third-party benchmark comparing jOOQ with JDBC, Hibernate, Spring Data:
https://github.com/nithril/sandbox-query-benchmark-jooq-hibernate-jdbc

@lukaseder lukaseder added this to the Version 3.8.0 milestone Oct 17, 2015
lukaseder added a commit that referenced this issue Oct 17, 2015
…ayDeque stacks that created even if there are no VisitListeners
lukaseder added a commit that referenced this issue Nov 12, 2015
================================================================================

This is a patch release with some useful fixes for the 3.7 branch

Features and Improvements
-------------------------
#3073 - Distribute commercial jOOQ artifacts under a different groupId to avoid conflicts
#4620 - Change error message when jOOQ-meta database type could not be found
#4659 - Significant overhead caused by type lookup when using DSL.val(T) or DSL.inline(T) in org.jooq.impl.Limit
#4721 - Add Javadoc examples to DSL.using(String), showing proper use with try-with-resources

Bug Fixes
---------
#3935 - InternalVisitListener accounts for a lot of CPU load
#4624 - Column of type "TIMESTAMP WITH TIME ZONE" lead to invalid TableImpl in 3.7.0
#4626 - Zero-length DAO source files generated for non-updatable tables
#4634 - Significant CPU overhead in CursorImpl$CursorIterator#fetchOne() due to frequent HashMap access
#4637 - Regression in Table.onKey(ForeignKey) with multiple joins
#4638 - Misleading ReferenceImpl.toString() implementation
#4642 - Significant schema mapping initialisation overhead when schema mapping isn't even used
#4646 - Significant overhead from Scope.data() Map access
#4651 - Significant overhead caused by AbstractContext's internal ArrayDeque stacks that created even if there are no VisitListeners
#4664 - Inefficent initialisation of SortFieldList and other QueryPartLists
#4668 - Significant overhead caused by check if FROM clause is needed
#4672 - Too many context objects are created when generating SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant