문제

I have some jython code with JNotify, like this:

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

It costs about 98.4 seconds to complete the code.

But when I run time java -jar jnotify-0.94.jar command, it is very fast and costs less than 1 second.

What's wrong with Jython and JNotify?

도움이 되었습니까?

해결책

the time is related with the count of files. NOT Jython or JNotify's problem. !-_-

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top