- changed title to LinkedList Object in SimpleJwkFilter possibly leading to increased CPU usage under high volume
LinkedList Object in SimpleJwkFilter possibly leading to increased CPU usage under high volume
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)
-
reporter -
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.
-
repo owner 374f7e9 makes that change.
-
repo owner - attached jose4j-0.7.1-SNAPSHOT.jar
Here's a snapshot build with that change (and very little else) in it.
-
reporter Awesome. Thanks Brian!
-
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.
-
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.
-
reporter Totally understand. Appreciate that.
-
repo owner - changed status to resolved
-
repo owner - changed status to closed
released in v0.7.1
- Log in to comment