Last post Aug 31, 2018 09:49 AM by Brando ZWZ
Aug 28, 2018 06:46 AM|shreenidhi|LINK
There is a single method which is being called about close to 5 times in each line back to back. I need to re-write it for performance.
Written in simplified way.
public String GetAlternateAdress(int SSN, enum typeCode)
case 1: address = "A";
string Alt1 = GetAlternateAdress(123,enum.value);//1
string Alt2 = GetAlternateAdress(123,enum.value);//2
string Alt3 = GetAlternateAdress(123,enum.value);//3
string Alt4 = GetAlternateAdress(123,enum.value);//4
Aug 28, 2018 07:05 AM|PatriceSc|LINK
Seeing the slowpart could help. If it deals just with memory variables it shouldn't be that slow (or you have db access code at some point ? .It seems it could be exposed as an array a basically you get a value based on numeric index ???
Aug 28, 2018 07:19 AM|shreenidhi|LINK
This method is being called in different Components. Yes it makes a DB call and thats why i wanted to change it.
Aug 31, 2018 09:49 AM|Brando ZWZ|LINK
According to your description, I suggest you could consider converting the method to async method.
Then it could be more faster.
Moer details about how to use async and the effect in asp.net, you could refer to below article.