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

DELTASPIKE-1426: Improve ProxyFactory performance on start #117

Merged
merged 2 commits into from Sep 19, 2021

Conversation

skybber
Copy link
Contributor

@skybber skybber commented Mar 26, 2021

Class.getMethond(name, args) is expensive operation, that is used
intensively on start, when DeltaspikeProxyFactory generates new proxies.
It was used even for checks of public abstract
methods of proxy's base class, but this methods cannot be overridden.
This patch collects all leave methods and skips them in the check.

Class.getMethond(name, args) is expensive operation, that is used
intensively on start, when DeltaspikeProxyFactory generates new proxies.
It was used even for checks of public abstract
methods of proxy's base class, but this methods cannot be overridden.
This patch collects all leave methods and skips them in the check.
@skybber
Copy link
Contributor Author

skybber commented Mar 30, 2021

I've created project with 300 repositories demonstrating this problem:

https://github.com/skybber/expensive-300-ds-repositories

there are 2 flame graphs showing results with not optimized versus optimized code:

https://github.com/skybber/expensive-300-ds-repositories/blob/main/not_optimized_flame_graph.png

https://github.com/skybber/expensive-300-ds-repositories/blob/main/optimized_flame_graph.png

in case of 300 repositories the startup improvement is 2.2s on Ryzen3600 architecture.

@tandraschko
Copy link
Member

can you add some unittests, to verify that collectAllMethods still collects all methods from all inhertiance levels?

@skybber
Copy link
Contributor Author

skybber commented Mar 31, 2021

I'll do that, give me some time for it .

Check correct output of DeltaspikeProxyFacotry.ignoreMethod
@skybber
Copy link
Contributor Author

skybber commented Mar 31, 2021

Its not clear for me , what should be correct output in this case:

    public class Class_NonAbstract
    {
        public void test()
        {
        }
    }
    
    public abstract class Class_NonAbstractToAbstract extends Class_NonAbstract
    {
        public abstract void test();
    }

DS currently removes test() method from set of collected methods, sou that output collection does not have neither Class_NonAbstract.test and neither Class_NonAbstractToAbstract.test

@tandraschko tandraschko merged commit c529592 into apache:master Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants