Search the Community
Showing results for tags 'load class'.
I have an application where I am loading plugins from disk and executing them. Each plugin is a child class of my plugin class. I am using the factory pattern. During development, I started out by having a static plugin class object for testing purposes and then later switched to loading the plugin class default value from disk. My architecture works by dynamically launching a generic plugin handler that then loads the required plugin class and dynamically launches a method in that class. So, the handler and the plugin are disconnected from the main application. They communicate using messages. I am launching many of these plugins at the same time. A common use case would be in the 100's (this is a test system) When I switched from the static object to loading the classes, I noticed a significant slowdown, especially with higher #s of plugins (100+) loading at once. I did an experiment to make all the plugins being loaded be the same so it should only incur the disk load of the class a single time. When I compare this to the static plugin version, there is a 4x reduction in execution speed. So, it seems that the function that gets the default value of a class is much slower and more resource intensive than using a static object, even if the class is already loaded into memory. I also suspect that this function runs in the root loop, causing blocking issues. Does anyone know of a way to speed this up or mitigate the slowdown? In the past I used to cache refs of dynamically loaded plugins (before LVOOP) so I would not incur the load penalty. There does not seem to be a way to do this here that I am seeing. thanks for any ideas. -John