You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2007/05/29 08:59:16 UTC

[jira] Resolved: (HARMONY-3842) [classlib][io][perf] CharArrayWriter.write(int) method works slowly

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

Paulex Yang resolved HARMONY-3842.
----------------------------------

    Resolution: Fixed

Ruth, patch applied at r542432, thanks a lot.

Vera, please verify, thanks.

I also wonder if the methods in CharArrayWriter needs to be locked or not, because specification says nothing on thread safety, so maybe the synchronized can be removed?

> [classlib][io][perf] CharArrayWriter.write(int) method works slowly
> -------------------------------------------------------------------
>
>                 Key: HARMONY-3842
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3842
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Vera Petrashkova
>            Assignee: Paulex Yang
>            Priority: Minor
>         Attachments: Harmony-3842.diff
>
>
> The following test demonstrates that CharArrayWriter.write(int) on DRLVM works slower than on RI.
> It is needed 
> --------------CharArrayWriterTest.java-------------------
> import java.io.*;
> public class CharArrayWriterTest {
>    public static void main (String[] args) {  
>         int size = 100000;   
>         try {        
>             long startTime = System.currentTimeMillis();
>             CharArrayWriter ww = new CharArrayWriter();
>             for (int i = 0; i < size; i++) {
>                 ww.write(i);
>                 if (i % 10000 == 0) {
>                     System.err.println("Step: "+i);
>                 }
>             }            
>             ww.close();
>             long endTime = System.currentTimeMillis();
>             System.err.println("Size: " + size+"  time: "+(endTime - startTime));
>         } catch (Throwable e) {
>              e.printStackTrace();
>         }
>     }
>   
> }
> -----------------------------------------
> Output on Linux:
> ==============
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)
>  
> Step: 0
> Step: 10000
> Step: 20000
> Step: 30000
> Step: 40000
> Step: 50000
> Step: 60000
> Step: 70000
> Step: 80000
> Step: 90000
> Size: 100000  time: 40
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0" 
> pre-alpha : not complete or compatible
> svn = r536744, (May 10 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Step: 0
> Step: 10000
> Step: 20000
> Step: 30000
> Step: 40000
> Step: 50000
> Step: 60000
> Step: 70000
> Step: 80000
> Step: 90000
> Size: 100000  time: 7360
> Output on Windows:
> ===================
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> Step: 0
> Step: 10000
> Step: 20000
> Step: 30000
> Step: 40000
> Step: 50000
> Step: 60000
> Step: 70000
> Step: 80000
> Step: 90000
> Size: 100000  time: 15
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its l
> icensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r536744, (May 10 2007), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> Step: 0
> Step: 10000
> Step: 20000
> Step: 30000
> Step: 40000
> Step: 50000
> Step: 60000
> Step: 70000
> Step: 80000
> Step: 90000
> Size: 100000  time: 6140
> This issue causes the failure of the following test from Stress test suite (http://issues.apache.org/jira/browse/HARMONY-3536)
> stress/org/apache/harmony/test/stress/api/java/io/stress/readers/CharArrayReader/CharArrayReaderWriterStressTest

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