masif icon indicating copy to clipboard operation
masif copied to clipboard

PyMol plugin slow

Open fwaibl opened this issue 3 years ago • 0 comments

Dear Masif-Team,

thanks for publishing MaSIF as open-source :-) I find the PyMol plugin very useful, and I would like to use it also for general visualization tasks. However, I found that the current version of Simple_mesh is loading very slowly when the number of vertices is high. I managed to fix it (at least for my purposes) by changing the following:

        for jj in range(len(self.attributes["vertex_x"])):
            self.vertices = np.vstack(
                [
                    self.attributes["vertex_x"],
                    self.attributes["vertex_y"],
                    self.attributes["vertex_z"],
                ]
            ).T

to

        self.vertices = np.vstack(
            [
                self.attributes["vertex_x"],
                self.attributes["vertex_y"],
                self.attributes["vertex_z"],
            ]
        ).T

This reduces the loading time from >5 minutes (I killed PyMol at some point) to about 1 sec, for a surface with about 100000 vertices. I think this is safe to change because the jj variable is not used anywhere in the loop (maybe one could also do if len(...):?). I don't need any help with this, I just thought I'd report it in case you want to fix it on GitHub.

Best regards, Franz Waibl

fwaibl avatar Dec 13 '21 14:12 fwaibl