Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewforum
Creator II
Creator II

How to optimize the given code!

Hi All,

We are using the below code to list down all the QV related files on disk. Below code works fine without any issue and gives the expected result. But the problem is it is generating the bigger log file and whereas the size is much lesser than the logfile(Almost 100 times smaller than the size of the logfile).

So I would like to know is there is any way optimize the below code so that logfile which is generated is not bigger. Also it would be great if doesn't take much time also.

Though we don't have control over what is logged but we may need to improve the code. For example, if one piece of code is using variable and another using table. Always variable based code generates huge log files than the second one which is using table but in more efficient way where the logged information is smaller.

Can someone help on this.

// list all QV related files on disk

sub DoDir (Root)

for each Ext in 'qvw', 'qva', 'qvo', 'qvs'

for each File in filelist (Root&' \*.' &Ext)

Load '$(File)' as Name, FileSize( '$(File)' ) as

Size, FileTime( '$(File)' ) as FileTime

autogenerate 1;

next File

next Ext

for each Dir in dirlist (Root&' \*' )

call DoDir (Dir)

next Dir

end sub


call DoDir ('C:')

3 Replies
Gysbert_Wassenaar

Put the subroutine in the hidden script. That way the subroutine won't generate logging.


talk is cheap, supply exceeds demand
qlikviewforum
Creator II
Creator II
Author

Thank you Gysbert.

I guess this may not be the rightway to optimize the code. Correct me if I am wrong. I agree that this may reduce the logging. We do need the logfile to be generated so that we can look into the logfile in case of any failures.

So can you suggest some other thing(Without the use of hidden script) where I can show that I really done some optimization in the code.

Hope my requirement is understandable!

qlikviewforum
Creator II
Creator II
Author

Any help from anyone on this? I am not getting any idea on how to optimize the above code . Please help!