The most efficient way to archive files using coldfusion or java

I am looking for the most efficient way to store a zip of a large number of files using ColdFusion or Java. I tried using <cfzip>and using zip.cfcNate Nielsen ( http://farmancreative.com/womenskiteboarding/admin/dccom/components/dcFileManagerV3/actions/cfc/zip.cfc ). For tests, I pinned a directory containing 80 mp4 files for a total of 1.18 GB. The results are shown below. I could not tell the difference at all, when the tag <cfzip>worked, the normal ColdFusion “steps” did not change. But with zip.cfcthat, it was more than using saw tooth memory.

So my question is: the best result? Or is there another newer way that I don't know about this, better than both of these?

I like memory usage more than speed. But as far as speed goes, it <cfzip>was a little faster. <cfzip>time was 100,871. zip.cfctime was 141,285.

Thank! enter image description here

<cfzip> Test code:

<cfoutput>
    <cfset tBegin = GetTickCount()>
    <cfzip
        action="zip"
        source="#dir#"
        file="#zipFile#"
        storepath="false"
        overwrite="true"
        />
    <cfset tEnd = GetTickCount()>
    <cfset scriptTime = (tEnd - tBegin)>
    Script Time: #scriptTime#
</cfoutput>

zip.cfc Test code:

<cfdirectory directory="#dir#" name="d" recurse="false">
<cfoutput>
    <cfset tBegin = GetTickCount()>
    <cfset zipper = createObject("component", "zip")>
    <cfscript>zipper.newZip(zipFile);</cfscript>
    <cfloop query="d">
        <cfset zipper.addFile(dir&d.name)>
    </cfloop>
    <cfscript>zipper.createZip();</cfscript>
    <cfset tEnd = GetTickCount()>
    <cfset scriptTime = (tEnd - tBegin)>
    Script Time: #scriptTime#
</cfoutput>
+2
source share
1 answer

I need to run, so I can’t print a lot now, but I will return to this tomorrow. Here are my test results after running it with real-world files (.txt, .ppt, .doc, .swf, etc.). It seems a <cfzip>lot better than that zip.cfc.enter image description here

+1
source

Source: https://habr.com/ru/post/1532337/


All Articles