Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[JENKINS-48349] - Cache permission id to avoid allocating of new strings #3155
Every request that comes from Jelly is checked against Permissions.
Now to help Jenkins to recover we need to turn off nginx for 1 minute :(
Proposed changelog entries
svanoort left a comment
Great catch here @Jimilian -- I think we do a lot of needless object allocation in Jenkins in general and removing some of that will help with performance. Especially when the method is called frequently -- this will help with more efficient CPU cache use potentially.
I do think we probably should include the null-check on the field though, to protect against some obscure usage that serializes a permission (maybe picking the Permission to apply for some feature from a list).
Maybe being overly cautious here, but for pure optimizations, best to limit potential negative impact.
Every request that comes from Jelly is checked against Permissions. As result it leads to a call of `getId` method that produces the new string. Usually it's not a problem, but in case of stop-the-world pause user requests are accumulated. So, once pause is finished, we forcibly allocated tons of strings for every request. That leads to new stop-the-world pause. (And this cycle can repeat multiple times)
@Jimilian has created a placeholder issue for it: https://issues.jenkins-ci.org/browse/JENKINS-48349.