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

Add benchmarks for `GlobalRole`s and `FolderRole`s #13

Merged
merged 2 commits into from Jul 23, 2019

Conversation

@AbhyudayaSharma
Copy link
Member

commented Jul 22, 2019

Adds a benchmark to compare the performance of hasPermission() checks for global roles with those from the Role Strategy Plugin.

The benchmark emulates https://github.com/jenkinsci/role-strategy-plugin/blob/master/src/test/java/jmh/benchmarks/RoleMapBenchmark.java

@AbhyudayaSharma AbhyudayaSharma requested a review from jenkinsci/gsoc2019-role-strategy Jul 22, 2019

@AbhyudayaSharma AbhyudayaSharma self-assigned this Jul 22, 2019

@AbhyudayaSharma

This comment has been minimized.

Copy link
Member Author

commented Jul 22, 2019

For 500 global Roles, the average time for one hasPermission() is 0.130 microseconds (on my machine). The latest build of Role Strategy Plugin has an average of 121.4 microseconds for one hasPermission() call:

            "scorePercentiles" : {
                "0.0" : 120.53523934042522,
                "50.0" : 121.5185190145392,
                "90.0" : 122.6657498752239,
                "95.0" : 122.7264551434821,
                "99.0" : 122.7264551434821,
                "99.9" : 122.7264551434821,
                "99.99" : 122.7264551434821,
                "99.999" : 122.7264551434821,
                "99.9999" : 122.7264551434821,
                "100.0" : 122.7264551434821
            },
            "scoreUnit" : "us/op",
@AbhyudayaSharma

This comment has been minimized.

Copy link
Member Author

commented Jul 22, 2019

The pull request build verifies the observations on my machine:

            "scorePercentiles" : {
                "0.0" : 0.157471799470619,
                "50.0" : 0.1620496203417448,
                "90.0" : 0.1688005135869144,
                "95.0" : 0.16915351346210927,
                "99.0" : 0.16915351346210927,
                "99.9" : 0.16915351346210927,
                "99.99" : 0.16915351346210927,
                "99.999" : 0.16915351346210927,
                "99.9999" : 0.16915351346210927,
                "100.0" : 0.16915351346210927
            },
            "scoreUnit" : "us/op",

Therefore this implementation is 933.84 x faster for 500 roles (would be even faster for a larger number of global roles) than the global roles in Role Strategy plugin🎉

@AbhyudayaSharma AbhyudayaSharma changed the title Add a benchmark for `GlobalRole`'s `hasPermission()` Add benchmarks for `GlobalRole`s and `FolderRoles` Jul 22, 2019

@AbhyudayaSharma AbhyudayaSharma changed the title Add benchmarks for `GlobalRole`s and `FolderRoles` Add benchmarks for `GlobalRole`s and `FolderRole`s Jul 22, 2019

@AbhyudayaSharma

This comment has been minimized.

Copy link
Member Author

commented Jul 22, 2019

The added benchmark for Folder Roles follows from the configuration @Straber gave us and which was implemented for https://github.com/jenkinsci/role-strategy-plugin/blob/master/src/test/java/jmh/benchmarks/FolderAccessBenchmark.java . Benchmarks on Role Strategy c2bef11 takes an average time of ~77 us. On my machine, the task completes in 4.3 us. So the folder roles are faster too...

@oleg-nenashev
Copy link
Member

left a comment

👍

@AbhyudayaSharma

This comment has been minimized.

Copy link
Member Author

commented Jul 23, 2019

Attaching results for future reference because the artifacts may be discarded by the Jenkins CI

@oleg-nenashev

This comment has been minimized.

Copy link
Member

commented Jul 23, 2019

🚢 🇮🇹 ? :)

@AbhyudayaSharma AbhyudayaSharma merged commit eb9ff1d into jenkinsci:master Jul 23, 2019

2 checks passed

continuous-integration/jenkins/incrementals Deployed to Incrementals.
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details

@AbhyudayaSharma AbhyudayaSharma deleted the AbhyudayaSharma:benchmarks branch Jul 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.