LinkedList Object in SimpleJwkFilter possibly leading to increased CPU usage under high volume

Issue #165 closed
Jason Obert created an issue

Hello,

We recently upgraded to version 0.7.0 to resolve a performance issue in SimpleJwkFilter.getCrv() method.

We have since seen the CPU usage lower, but still higher than we’d like to see under high volumes.

In the filter() method, could you investigate changing the filtered object from type LinkedList to ArrayList(Line 89)?

public List<JsonWebKey> filter(Collection<JsonWebKey> jsonWebKeys)
{
    List<JsonWebKey> filtered = new ArrayList<>();
    for (JsonWebKey jwk : jsonWebKeys)
    {

I’ve attached a screenshot from our Dynatrace scan.

Comments (10)

  1. Brian Campbell repo owner

    Sure, using LinkedList there was little more than a guess (that was apparently wrong) ~5 years ago that seemed like it maybe might be better by avoiding internal resizing. But there’s otherwise no reason for it.

  2. Jason Obert reporter

    Running locally with this and I see improved performance. What is your normal release schedule or workflow?

    Also, in the future is this the best avenue to discuss any questions about the framework? You’ve answered questions on StackOverflow for me also.

  3. Brian Campbell repo owner

    There’s not a normal release schedule per se. It’s really just ad hoc based on whatever changes have been made and any associated need or feeling. But I can look at pushing out a new one with this in it sometime soon.

    This is probably the best avenue, yeah, but that’s somewhat ad hoc too. I try and be reasonable responsive here and StackOverflow. But I’m also just a guy and it’s free software and all that.

  4. Log in to comment