You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/08/17 15:38:52 UTC
[jira] Created: (MPLINKCHECK-15) [PATCH] FileToCheck does not use BufferedInputStream
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MPLINKCHECK-15
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MPLINKCHECK-15
Summary: [PATCH] FileToCheck does not use BufferedInputStream
Type: Improvement
Status: Open
Priority: Minor
Original Estimate: 10 minutes
Time Spent: Unknown
Remaining: 10 minutes
Project: maven-linkcheck-plugin
Versions:
1.3.2
Assignee: Ben Walding
Reporter: Stephane Mikaty
Created: Tue, 17 Aug 2004 9:37 AM
Updated: Tue, 17 Aug 2004 9:37 AM
Environment: N/A
Description:
This results in an unacceptably long parse time for large
html files, as the file seems to be read one byte at a time,
incurring a native call each time.
On my machine, the disk utilization is very high as a result
of this. I discovered this because my checkstyle-report.html
is 40 megs big. the workaround is simple (do not include the
linkcheck report in the site generation), however everyone
will benefit from a faster parsing of big html files. So i
submitted the issue.
Index: src/main/org/apache/maven/linkcheck/FileToCheck.java
===================================================================
RCS file: /home/cvspublic/maven-plugins/linkcheck/src/main/org/apache/maven/linkcheck/FileToCheck.java,v
retrieving revision 1.17
diff -u -r1.17 FileToCheck.java
--- src/main/org/apache/maven/linkcheck/FileToCheck.java 1 Aug 2004 22:23:33 -0000 1.17
+++ src/main/org/apache/maven/linkcheck/FileToCheck.java 17 Aug 2004 13:26:32 -0000
@@ -17,6 +17,7 @@
* ====================================================================
*/
+import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -146,13 +147,13 @@
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter errOut = new PrintWriter(baos);
- FileInputStream in = new FileInputStream(fileToCheck);
+ BufferedInputStream bin = new BufferedInputStream(new FileInputStream(fileToCheck));
try
{
Tidy tidy = getTidy();
tidy.setErrout(errOut);
LOG.debug("Processing:" + fileToCheck);
- org.w3c.dom.Document domDocument = tidy.parseDOM(in, null);
+ org.w3c.dom.Document domDocument = tidy.parseDOM(bin, null);
// now read a dom4j document from
// JTidy's W3C DOM object
@@ -165,7 +166,7 @@
}
finally
{
- close(in);
+ close(bin);
close(baos);
}
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
[jira] Closed: (MPLINKCHECK-15) [PATCH] FileToCheck does not use BufferedInputStream
Posted by ji...@codehaus.org.
Message:
The following issue has been closed.
Resolver: Carlos Sanchez
Date: Tue, 17 Aug 2004 1:22 PM
Fixed. Thanks
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MPLINKCHECK-15
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MPLINKCHECK-15
Summary: [PATCH] FileToCheck does not use BufferedInputStream
Type: Improvement
Status: Closed
Priority: Minor
Resolution: FIXED
Original Estimate: 10 minutes
Time Spent: Unknown
Remaining: 10 minutes
Project: maven-linkcheck-plugin
Fix Fors:
1.4
Versions:
1.3.2
Assignee: Carlos Sanchez
Reporter: Stephane Mikaty
Created: Tue, 17 Aug 2004 9:37 AM
Updated: Tue, 17 Aug 2004 1:22 PM
Environment: N/A
Description:
This results in an unacceptably long parse time for large
html files, as the file seems to be read one byte at a time,
incurring a native call each time.
On my machine, the disk utilization is very high as a result
of this. I discovered this because my checkstyle-report.html
is 40 megs big. the workaround is simple (do not include the
linkcheck report in the site generation), however everyone
will benefit from a faster parsing of big html files. So i
submitted the issue.
Index: src/main/org/apache/maven/linkcheck/FileToCheck.java
===================================================================
RCS file: /home/cvspublic/maven-plugins/linkcheck/src/main/org/apache/maven/linkcheck/FileToCheck.java,v
retrieving revision 1.17
diff -u -r1.17 FileToCheck.java
--- src/main/org/apache/maven/linkcheck/FileToCheck.java 1 Aug 2004 22:23:33 -0000 1.17
+++ src/main/org/apache/maven/linkcheck/FileToCheck.java 17 Aug 2004 13:26:32 -0000
@@ -17,6 +17,7 @@
* ====================================================================
*/
+import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -146,13 +147,13 @@
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter errOut = new PrintWriter(baos);
- FileInputStream in = new FileInputStream(fileToCheck);
+ BufferedInputStream bin = new BufferedInputStream(new FileInputStream(fileToCheck));
try
{
Tidy tidy = getTidy();
tidy.setErrout(errOut);
LOG.debug("Processing:" + fileToCheck);
- org.w3c.dom.Document domDocument = tidy.parseDOM(in, null);
+ org.w3c.dom.Document domDocument = tidy.parseDOM(bin, null);
// now read a dom4j document from
// JTidy's W3C DOM object
@@ -165,7 +166,7 @@
}
finally
{
- close(in);
+ close(bin);
close(baos);
}
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
[jira] Updated: (MPLINKCHECK-15) [PATCH] FileToCheck does not use BufferedInputStream
Posted by ji...@codehaus.org.
The following issue has been updated:
Updater: Stephane Mikaty (mailto:mikaty@ecircle-ag.com)
Date: Tue, 17 Aug 2004 9:40 AM
Comment:
patch file.
Changes:
Attachment changed to patch.txt
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.codehaus.org/browse/MPLINKCHECK-15?page=history
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/MPLINKCHECK-15
Here is an overview of the issue:
---------------------------------------------------------------------
Key: MPLINKCHECK-15
Summary: [PATCH] FileToCheck does not use BufferedInputStream
Type: Improvement
Status: Open
Priority: Minor
Original Estimate: 10 minutes
Time Spent: Unknown
Remaining: 10 minutes
Project: maven-linkcheck-plugin
Versions:
1.3.2
Assignee: Ben Walding
Reporter: Stephane Mikaty
Created: Tue, 17 Aug 2004 9:37 AM
Updated: Tue, 17 Aug 2004 9:40 AM
Environment: N/A
Description:
This results in an unacceptably long parse time for large
html files, as the file seems to be read one byte at a time,
incurring a native call each time.
On my machine, the disk utilization is very high as a result
of this. I discovered this because my checkstyle-report.html
is 40 megs big. the workaround is simple (do not include the
linkcheck report in the site generation), however everyone
will benefit from a faster parsing of big html files. So i
submitted the issue.
Index: src/main/org/apache/maven/linkcheck/FileToCheck.java
===================================================================
RCS file: /home/cvspublic/maven-plugins/linkcheck/src/main/org/apache/maven/linkcheck/FileToCheck.java,v
retrieving revision 1.17
diff -u -r1.17 FileToCheck.java
--- src/main/org/apache/maven/linkcheck/FileToCheck.java 1 Aug 2004 22:23:33 -0000 1.17
+++ src/main/org/apache/maven/linkcheck/FileToCheck.java 17 Aug 2004 13:26:32 -0000
@@ -17,6 +17,7 @@
* ====================================================================
*/
+import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -146,13 +147,13 @@
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter errOut = new PrintWriter(baos);
- FileInputStream in = new FileInputStream(fileToCheck);
+ BufferedInputStream bin = new BufferedInputStream(new FileInputStream(fileToCheck));
try
{
Tidy tidy = getTidy();
tidy.setErrout(errOut);
LOG.debug("Processing:" + fileToCheck);
- org.w3c.dom.Document domDocument = tidy.parseDOM(in, null);
+ org.w3c.dom.Document domDocument = tidy.parseDOM(bin, null);
// now read a dom4j document from
// JTidy's W3C DOM object
@@ -165,7 +166,7 @@
}
finally
{
- close(in);
+ close(bin);
close(baos);
}
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org