|
From: | Mohamed_Ben_Hedi . Sghaier |
Subject: | [Mibble-devel] ObjectIdentifierValue performance |
Date: | Fri, 21 Apr 2006 16:00:45 +0200 |
User-agent: | Thunderbird 1.5 (X11/20051201) |
Hi,We started using MIBBLE parser in our product, and as in the testing phase we performed some charge tests I noticed that there's a real impact of the toString() method of the ObjectIdentifierValue class on the performance of our product as we try to supervise about 5000 Network elements and for each element this method is called about 300 times
So we have 1500000 calls to this recursive method. I tried to modify this method and this is my new code: private valueString=null; public String toString() { if(valueString==null) { String tempValue; if (parent == null) { tempValue= String.valueOf(value); } else { tempValue= parent.toString() + "." + String.valueOf(value); } valueString=tempValue; } return valueString; }by this way the recursive process is called only once and after that the cached value is returned, this is better for the performance improvement. and I don't think that this will cause some problems as it's not thread-safe.
Thanks. --Mohamed
[Prev in Thread] | Current Thread | [Next in Thread] |