Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 20, 2013, 06:36:15 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: More power to filebooleans  (Read 817 times)
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« on: January 22, 2011, 10:20:13 pm »

My idea is, syntax "like" regular expressions or regular expressions themselves could be used in filebooleans. For example, instead of

      FileName("*.7z")
      or FileName("*.arj")
      or FileName("*.avi")
      or FileName("*.bak")
      or FileName("*.bup")

MyDefrag could support something like

      FileName("*.7z|*.arj|*.avi|*.bak|*.bup")

evaluating this in a single run (using a single search tree) which would make evaluating such complicated filebooleans much faster. And it would be also nice to have support for full extended regular expression:

      FileNameRegex("\.7z$|\.arj$|\.avi$|\.bak$|\.bup$")

as regular expressions are much more powerful than filenames with wildcards.
There are already free implementations supporting such searches available, too.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: January 23, 2011, 06:13:04 am »

Thanks for sharing your idea, I appreciate it. I have looked at using regular expressions in the beginning of MyDefrag and tried a couple of free implementations. But it is an order of magnitude too slow. Even on a small harddisk there are typically hundreds of thousands of files, and running a regular expression for so many inputs simply takes too much time. Regular expressions work great for comparing a pattern with a single big input, not so great for comparing a pattern with lot's of small inputs, such as filenames. Searching for a solution for the speed problem I arrived at the current filebooleans, which run through all filenames in a tight loop with basic string comparions.
Logged
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« Reply #2 on: January 23, 2011, 07:54:35 pm »

That's strange as I'm pretty sure something we are using is able to perform hunders of thousands searches per second. I'll try to check what are we using there.
Logged
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« Reply #3 on: January 24, 2011, 11:30:51 am »

I have found we are using just GNU libc regex library, particularly the utf8regex port of it (http://jwilk.net/software/utf8regex).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!