-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Hi Packy!
It's me again. I've spend some time profiling a little CLI app I made to interact with our JIRA instance at work, trying to make it faster. If you're interested, here is what I found so far:
-
This is a big one. Whenever an instance of JIRA::REST::Class::Issue is created, init() will create a method per issue type like is_bug() or is_story(). But to be able to do this, it needs to query JIRA for a list of all issue types (i.e. it will call $jira->issue_types). Although this is done only once, this call will cost some 500 ms which gives me a noticeable delay. Since all those is_$foo methods aren't even documented, I suggest making this either optional or completely getting rid of it.
-
This can be a big one. JIRA::REST::Class::Mixins::JIRA_REST() gets called quite often. In most cases, this will in turn call JIRA::REST->new(). Now, I use JIRA::REST's ability to load my jira credentials from ~/.jira. If I gpg-encrypt that file like a good employee, all the calls to JIRA::REST->new() result in one gpg decryption per call. My little script takes approximately 1s with a plain text .jira file and 18 s(!) with an encrypted one. Hacking JIRA::REST::Class::Mixins::JIRA_REST() so that it caches the JIRA::REST instance in a package variable, encrypting the file gives me almost no performance penalty.
Please let me know if you want a pull request or two. Or if you have better ideas that tackle those problems.
Cheers,
Manni