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

HV 6 Memory and performance improvements #814

Closed
wants to merge 0 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@gsmet
Member

gsmet commented Jul 19, 2017

Note 2: the order of the commits displayed below is not exactly the one I have in my branch - the order of the HV-1439 commits is more consistent in my branch.

It's a big one. I started working on the different subjects separately but as I touched the same code and had the same issues, I had to cherry-pick some of the commits in other branches and finally ended up joining the efforts in one branch. The commits are well isolated and should be easily understandable by reading the commit comment and the code.

HV-1438

There are several things here:

  • I removed completely the ObjectValueExtractor. It's not a good idea to rely on the extractor infrastructure to validate the annotated object itself. Funnily enough, removing it revealed a few issues (these are the commits before the "Remove the ObjectValueExtractor" commit);
  • Narrowing down the value extractors considered is a necessity as cascading is real slow now, mostly due to the calls to TypeVariableBindings. What I did work, but I think I found an issue in the TCK: beanvalidation/beanvalidation-tck#149 .

HV-1437

These are memory footprint improvements. The idea was mostly to reduce the size of the metadata. The example reported by Stuart is kinda extreme: see https://github.com/keycloak/keycloak/blob/master/model/jpa/src/main/java/org/keycloak/models/jpa/entities/RealmEntity.java .

6.0 was already better than 5.x as I introduce the CollectionHelper.toImmutable* utilities: they trim down the empty and one element collections to the minimum but there was still some room for improvements.

All in all, we reduced the BeanMetaDataImpl of RealmEntity from ~177 kB in the original snapshot of Stuart (using 5.x) to ~60 kB (using this branch).

I'll post something on the list about some other things I'd like to discuss.

HV-1439

Benchmark improvements

The benchmarks were a bit painful to use when you wanted to compare closely 2 versions and switch from one to the other.

I pushed some clean ups to them.

I also removed the iterative benchmarks which were useless.

Some runtime performance improvements

Nothing big but a few things I noticed while benchmarking and it definitely improved the performances.

Quite a lot of parsing/metadata building improvements

The situation was quite bad here so I made quite a lot of improvements to reduce the startup cost of HV.

HV-1443

A small fix required by the other changes.

@gsmet

This comment has been minimized.

Show comment
Hide comment
@gsmet

gsmet Aug 1, 2017

Member

@gunnarmorling force pushed an update fixing your remarks.

I answered to the others, let me know if there's something else you want me to fix.

Member

gsmet commented Aug 1, 2017

@gunnarmorling force pushed an update fixing your remarks.

I answered to the others, let me know if there's something else you want me to fix.

@gsmet

This comment has been minimized.

Show comment
Hide comment
@gsmet

gsmet Aug 2, 2017

Member

@gunnarmorling added 2 more commits to remove the metadata of the unconstrained methods (one is purely cosmetic).

Member

gsmet commented Aug 2, 2017

@gunnarmorling added 2 more commits to remove the metadata of the unconstrained methods (one is purely cosmetic).

@gsmet gsmet closed this Aug 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment