RBerenguel wrote:If you know how I can get some profiling working let me know and I'll look into it. Of course in a Mac the X system has to launch, but today I had it already opened, so this does not look like the issue.
I do not have a great idea how to do this. Here is one possibility that might help: Instead of kombilo.py, let us work with the viewer script v.py, so that loading the databases does not come in.
In v.py, at the very beginning of the file, add
Code: Select all
## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE⌴
## SOFTWARE.
import time # add these
t = time.time() # two lines
import cPickle
Then, add some print statements at the very end of the file, for example:
Code: Select all
if __name__ == '__main__':
print 'Step 1', time.time() - t
root = Tk()
root.withdraw()
print 'Step 2', time.time() - t
if sys.path[0].endswith('library.zip'): SYSPATH = os.path.split(sys.path[0])[0]
else: SYSPATH = sys.path[0]
try:
if os.path.exists(os.path.join(SYSPATH, 'kombilo.app')):
root.option_readfile(os.path.join(SYSPATH, 'kombilo.app'))
except TclError:
showwarning('Error', 'Error reading v.app')
app = Viewer(root)
print 'Step 3', time.time() - t
root.protocol('WM_DELETE_WINDOW', app.quit)
root.title('v.py')
app.boardFrame.focus_force()
root.tkraise()
if len(sys.argv) > 1: # load sgf file given as first argument
app.openFile(os.path.split(sys.argv[1])[0], os.path.split(sys.argv[1])[1])
app.changeCurrentFile(None, 1)
app.delFile()
if len(sys.argv) > 2: # jump to move given as second argument
try:
for i in range(int(sys.argv[2])):
app.next()
except: pass
print 'Step 4', time.time() - t
root.mainloop()
When you invoke v.py, what does it print to the console? Maybe we can narrow down the problem a little in this way.
@Laman: thanks for your input. I agree that loading the databases should occur in the background, but it does not seem trivial to implement this because of the way the Python and C++ parts of the program are connected.
Best regards
Ulrich