search methods faster
I am trying to search 33 .dll to find references for a method, It takes more than 10 minutes to through all the dlls and find references. Is there a way to speed up things.
each of these dll's approximately has 450 classes and each of this class has approximately 200 methods each
Step that I follow:
assemblyName = System.IO.Path.GetFullPath(file)
assembly = System.Reflection.Assembly.LoadFile(assemb开发者_StackOverflow社区lyName)
Dim types = assembly.GetTypes()
For Each Type In types
methods = Type.GetMethods()
For Each method In methods
'save method info, class type
Next
Next
You could go through your 33 libraries and store the result of what you're looking for in a database. And then instead of asking your libraries, ask your database, it will be faster and give you directly the right door to knock on...( I mean you can then point directly to the good library and the good class to get more information or instanciate some object,...)
My comment is not that clear so I update my answer.
Before launching a new version , you fill out the database with the new values of your project with a key refering to your version of course. Doing so, when launching the new application, you will not have to wait 10 minutes to get your stuff, because you will have already used 10 minutes before , hidden, to fill the database. If your application restarts but with no changes in your libraries, the information will still be here too, because the version will be the same.
I wish you good luck anyway for your project...
I know a lot of fancy tools, including PostSharp and NDepend (which is a great tool) use Cecil. It's supposed to be better than .NET reflection for some stuff.
Try it out...
精彩评论