0
太慢我有JNotify一些Jython代碼,就像這樣:JNotify的Jython在OS X 10.8.5
mask = JNotify.FILE_CREATED | JNotify.FILE_DELETED | \
JNotify.FILE_MODIFIED | JNotify.FILE_RENAMED
class Listener(JNotifyListener):
def fileRenamed(self, wd, rootPath, oldName, newName):
pass
def fileModified(self, wd, root, name):
add_file(root, name)
def fileDeleted(self, wd, root, name):
add_file(root, name)
def fileCreated(self, wd, root, name):
add_file(root, name)
st = time.time()
JNotify.addWatch("some_path", mask, True, Listener())
print time.time - st
費用大約98.4秒完成的代碼。
但是,當我運行time java -jar jnotify-0.94.jar
命令時,它非常快速並且成本低於1秒。
Jython和JNotify有什麼問題?