[ 
https://issues.apache.org/jira/browse/CAMEL-13399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Cosentino resolved CAMEL-13399.
--------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0.M5
                   3.0.0

> ZipAggregationStrategy become slower when size of zip grows
> -----------------------------------------------------------
>
>                 Key: CAMEL-13399
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13399
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-zipfile
>    Affects Versions: 2.23.1
>            Reporter: Mykhailo Kozik
>            Assignee: Jan Bednar
>            Priority: Major
>             Fix For: 3.0.0, 3.0.0.M5
>
>         Attachments: Screenshot 2019-04-08 18.41.10.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I have a simple route which runs by demand and archives multiple files in one 
> zip archive.
> {code:java}
> from(file:/path/to/source)
> .aggregate(constant(1), new ZipAggregationsStrategy(true, true))
> .completionFromBatchConsumer()
> .eagerCheckCompletion()
> .to(file:/path/to/target){code}
> It works fine when the number of files in source folder is relatively small.
> After adding tracing logs to test size of input files / time taken by 
> process, the following chart could be drawn. 
> !Screenshot 2019-04-08 18.41.10.png!
> That means, to make zip archive from 500mb of files takes over 12 minutes!
> Looks like in order to add a file, camel extracts zip archive to input 
> stream, put file inside it, and build zip archive again. So that becomes near 
> quadratic complexity, and not acceptable for large folders.
> The workaround is to add completionSize or completionPredicate to flush every 
> 100mb, so we got all files archived but splitted into several archives, which 
> works but not the best choice.
>  
> Is there a general solution how to make ZipAggregationStrategy to work in 
> near linear time, so the process does not become slower with large number of 
> files?



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to