c# - Performance issues with the existing coding approach using global :: keyword -
i have been asked refactor particular module in application , tweak
performance related issues (if any).
coming module,there portions needs strings
displayed. strings supplied language assembly(.dll)
referred in project, returns string xml file containing
strings if pass keyword.
for ex:
language.getstringfromid("txt_warning"); return warning !!
the original developer has generously used
global :: language.getinstance().getstringfromid("keyword") whenever fetch string
question 1, approach ??
i had second thoughts approach, ran performance profiler , see
everytime when string requested, takes 500ms return string
queried keyword.
before conclude indeed culprit, need thoughts .net experts
in stackoverflow
question 2
is there performance hit if use global :: in general ??
cheers
- it should used eliminate namespace conflicts.
- no performance hit using
global::
. it's handled compiler. theres nothing namespaces @ runtime.
the performance hit inside language.getstringfromid
Comments
Post a Comment