Re: [Jmol-users] JSmol applet creation of mo surfaces or contour plot is slow
Thanks to Dr. Bob Hanson and Dr. Angel Herráez for their very helpful advice about this. The problem was that, on a page displaying MOs for teaching purposes, I was offering both a translucent orbital surface, produced using the mo command, and a two-dimensional contour plot on a plane through the orbital, produced using the isosurface command. It was the isosurface command which was taking most of the time. Thus, for the pi_nb_in_plane HOMO orbital (mo 16) of BF3 in https://www.staff.ncl.ac.uk/bruce.tattershall/teaching/maingrps/bf3mo/bf3.php Chrome using the HMTL5.0 JSmol option took 5 seconds to produce the 3D orbital surface but 16 seconds to produce the 2D line contour plot. (This speeds up to 3 s and 10 s respectively on the more powerful PCs our U provides for student class use.) I took the suggestion of calculating the surface immediately after loading the model, but waiting for the student to request the contour plot by clicking a Jmol button. I also took the suggestion to put in echoes to tell the user what they were waiting for in each case. Although the two representations are each calculated in less than 2 seconds using the Java Jmol option in Java enhanced IE11, I think that, for students stuck with using a browser without Java, then a 3 - 5 second initial wait is tolerable if they are given information about what is happening. The original offering of a 13 - 21 second unexplained wait was putting such students off. Bruce (original post 20 March 2017) -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] JSmol applet creation of mo surfaces or contour plot is slow
Hello Bruce I will gladly take a look at your page when I have time, but here are a few comments in advance: 1. Using JSmol-html5 with IE is very slow, indeed. Other browsers are recommendable. 2. Given the current state of Java support, you'd better forget chances of using Jmol-Java. I agree that it is an advantage for large models or, as in your case, isosurface computations. But we are loosing that battle. Firefox just dropped support for plugins, as Chrome did before. I am switching to PaleMoon as my main browser (they will support plugins indefinitely), but Oracle will eventually abandon the offering of the Java plugin. 3. What you might try to do is to save the isosufaces to a file. Loading them later is very fast. I have not a clear idea to what extent your calculation is unique or can be done in advance and the result used repeatedly. 4. If you have the control and expertise, you culd run the calculation in the server (using Jmol.jar or the JmolData.jar that does not use graphics), save the file and then serve it to the client browser. That would be faster, running in Java and not in JSmol-html5. 5. Although you are fine with JSmol.min.js + Jmol2.js, if it safer to move to direct implementation without Jmol2.js. Probably this has no effect on performance, though, but it safer for the future. I would not think you are doing anything wrong, you are just hitting the inherent speed limitations of JSmol. More later, I hope. --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
[Jmol-users] JSmol applet creation of mo surfaces or contour plot is slow
Over the last couple of years I have created a number of web pages using Jmol, to support research publications in inorganic main-groups chemistry or for undergraduate teaching. I have created a portfolio web page https://www.staff.ncl.ac.uk/bruce.tattershall/jmolapps/portfolio.html showing six different examples of these, to try to encourage my colleagues to do likewise, but I have to start by telling them to use a Java-enabled browser. It would be much better if I didn't need to. All of my web pages offer the user a choice of using the Java Jmol applet or the HTML5.0 JSmol applet, implemented using the concatenation of JSmol.min.js and Jmol2.js as recommended in http://wiki.jmol.org/index.php/Jmol_JavaScript_Object and patching the value of use in the Info variable for Jmol.getApplet("JmolApplet0", Info) accordingly. For all of my web pages, using IE11 and the Java plugin, and taking my offered Java Jmol applet option, works excellently, producing Jmol_S models. Firefox for Windows with the Java plugin is also fine. Moving to Chrome and necessarily taking the HTML5.0 JSmol applet option also works very well for models of molecular geometry, including reaction path animations. However, models of orbital surfaces, or contour plots of orbitals on a plane, are much too slow to load. An example is provided from https://www.staff.ncl.ac.uk/bruce.tattershall/teaching/chy135/co2mo/co2.php in which MOs for CO2 may be picked from an energy level diagram. This calling page is fine with either applet, but the called page which generates the model for the chosen MO, is not. An example, with the query string set for HTML5.0 JSmol use, is https://www.staff.ncl.ac.uk/bruce.tattershall/teaching/chy135/co2mo/showjmol.php?use=HTML5&filestem=co2&basis=MO&orbital=sigma_C(2p)O(2p)&orbno=9&winno=1 In Chrome, this takes 20 seconds, and about the same in Firefox (compared with 4 seconds for the Java Jmol applet option), while IE11 takes 35 seconds, in each case running in a dual core 2.93GHz 32-bit PC running Windows 7. (IE11 without Java is unacceptable anyway because its mouse response in rotating models is too slow and jerky, for any kind of model.) The orbital data comes from an NBO calculation, so the orbital distribution is calculated entirely within the applet. By calling the functions to calculate an mo surface or to calculate a contour plot on the yz plane, from a LoadStructCallback function, I can ensure that the data loading is done only once. Putting on breakpoints in a debugger shows that this is not the time-consuming part. It appears to be that it is calculating the mo surface which is taking the bulk of the time. I should be very happy if someone more expert in using JSmol could look at the page source of the example above, and let me know if I am doing something poorly. The .php script is only doing the obvious in interpreting the query string: everything of consequence in using JSmol is visible in the delivered HTML/Javascript page source. Thanks Bruce Tattershall School of Chemistry, Newcastle University, England -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users