You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Liyu Yi (JIRA)" <ji...@apache.org> on 2007/04/12 19:28:32 UTC

[jira] Created: (AXIS2-2516) Poor performance of File Caching caused by PartOnFile

Poor performance of File Caching caused by PartOnFile
-----------------------------------------------------

                 Key: AXIS2-2516
                 URL: https://issues.apache.org/jira/browse/AXIS2-2516
             Project: Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: om
            Reporter: Liyu Yi


I noticed that the performance of "File Caching" is not great, and I believe it is due to the implementation of  the constructor of "org.apache.axiom.attachments.PartOnFile" which reads and writes the inputSteam byte-by-byte (see the snippets below). Can we simply apply some buffering to improve it?

    public PartOnFile(PushbackFilePartInputStream inStream, String repoDir) {
            ...            
            cacheFile = File.createTempFile("Axis2", ".att",
                    repoDirFile);

            FileOutputStream fileOutStream = new FileOutputStream(cacheFile);
            int value;
            value = parseTheHeaders(inStream);
            fileOutStream.write(value);
            while (!inStream.getBoundaryStatus()) {
                value = inStream.read();
                if (!inStream.getBoundaryStatus()) {
                    fileOutStream.write(value);
                }
            }

            fileOutStream.flush();
            fileOutStream.close();
        } catch (IOException e) {
            throw new OMException("Error creating temporary File.", e);
        }
    }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-2516) Poor performance of File Caching caused by PartOnFile

Posted by "Thilina Gunarathne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thilina Gunarathne resolved AXIS2-2516.
---------------------------------------

    Resolution: Invalid
      Assignee: Thilina Gunarathne

I fixed that issue some time back... Please check using the latest axiom binaries (1.2.3 release)... 
Performance of the file caching was improved a lot recently...

http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/PartOnFile.java?revision=515594&view=markup

> Poor performance of File Caching caused by PartOnFile
> -----------------------------------------------------
>
>                 Key: AXIS2-2516
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2516
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: om
>            Reporter: Liyu Yi
>         Assigned To: Thilina Gunarathne
>
> I noticed that the performance of "File Caching" is not great, and I believe it is due to the implementation of  the constructor of "org.apache.axiom.attachments.PartOnFile" which reads and writes the inputSteam byte-by-byte (see the snippets below). Can we simply apply some buffering to improve it?
>     public PartOnFile(PushbackFilePartInputStream inStream, String repoDir) {
>             ...            
>             cacheFile = File.createTempFile("Axis2", ".att",
>                     repoDirFile);
>             FileOutputStream fileOutStream = new FileOutputStream(cacheFile);
>             int value;
>             value = parseTheHeaders(inStream);
>             fileOutStream.write(value);
>             while (!inStream.getBoundaryStatus()) {
>                 value = inStream.read();
>                 if (!inStream.getBoundaryStatus()) {
>                     fileOutStream.write(value);
>                 }
>             }
>             fileOutStream.flush();
>             fileOutStream.close();
>         } catch (IOException e) {
>             throw new OMException("Error creating temporary File.", e);
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2516) Poor performance of File Caching caused by PartOnFile

Posted by "Liyu Yi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488572 ] 

Liyu Yi commented on AXIS2-2516:
--------------------------------

Super! Thanks!


> Poor performance of File Caching caused by PartOnFile
> -----------------------------------------------------
>
>                 Key: AXIS2-2516
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2516
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: om
>            Reporter: Liyu Yi
>         Assigned To: Thilina Gunarathne
>
> I noticed that the performance of "File Caching" is not great, and I believe it is due to the implementation of  the constructor of "org.apache.axiom.attachments.PartOnFile" which reads and writes the inputSteam byte-by-byte (see the snippets below). Can we simply apply some buffering to improve it?
>     public PartOnFile(PushbackFilePartInputStream inStream, String repoDir) {
>             ...            
>             cacheFile = File.createTempFile("Axis2", ".att",
>                     repoDirFile);
>             FileOutputStream fileOutStream = new FileOutputStream(cacheFile);
>             int value;
>             value = parseTheHeaders(inStream);
>             fileOutStream.write(value);
>             while (!inStream.getBoundaryStatus()) {
>                 value = inStream.read();
>                 if (!inStream.getBoundaryStatus()) {
>                     fileOutStream.write(value);
>                 }
>             }
>             fileOutStream.flush();
>             fileOutStream.close();
>         } catch (IOException e) {
>             throw new OMException("Error creating temporary File.", e);
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org