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有什么问题?