Menu

#1 Performance imp (for nested loops and many vars)

open
nobody
None
5
2009-07-17
2009-07-17
No

Hi Andrei,

the current code copies on every loop-entry all of the variables into a new map, so that it can overwrite parent vars with local variables.
That is exponential complexity - too much in my case.

Here I propose using a chainable map - which brings the complexity as far as loop-nesting and variables are concerned.

Thanks for providing this code, it has helped us get up to speed quickly!
Cheers,
Georg

Discussion

  • Köster Georg

    Köster Georg - 2009-07-17
     
  • Andrei Taranchenko

    Georg,

    Do your tests pass with the patch? I ran this with GCC 4.4.5, and I get segmentation faults when trying to create a reference test file, as in: ./test create t/loop.tmpl

     
  • Anonymous

    Anonymous - 2011-03-28

    Andrei,

    currently I don't have a dev environment for Linux, sorry.

    At the time it was running well, even in production. I really don't remember if I ran the tests! But certainly if I didn't run them, than because they didn't work right from the start. I guess you checked for that already. ; )

    I am not joking about the speed : )

    Best regards,
    Georg

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.