WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: script that generates .tree files  (Read 1648 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1841
Re: script that generates .tree files
« Reply #30 on: Today at 06:55:33 AM »
I think we have a winner. ;D
Hi Rich. Good to hear. I'll be using this version myself :)

Out of curiosity, how long does this latest version take on your hardware?
Here you go:

Code: [Select]
$ time treegen vlc-dev.tcz >/tmp/vlc-dev.tcz.tree
real 0m 0.67s
user 0m 0.40s
sys 0m 0.22s
So 1.86 sec before, 0.67 sec now. Your optimizations help a whole lot: The new version gets the job done in less than half the time, even with the call to gsub.

Thank you for your collaboration with this. Always a pleasure.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12731
Re: script that generates .tree files
« Reply #31 on: Today at 08:39:16 AM »
Hi GNUser
Beautiful.

Overall, I'd say your script stacks up quite well against the C++ version:
Code: [Select]
awk C++
     Size     ~900 bytes      ~25K bytes
Time to generate vlc-dev.tcz.tree     0.67 Secs.      0.31 Secs.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1541
Re: script that generates .tree files
« Reply #32 on: Today at 09:55:18 AM »
For processing hundreds of tree files, I’ll take the speed of C++, but was there a robustness change needed for the repo, related to spaces and/or blank lines?