incubator-awf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Stevenson (Moved) (JIRA)" <j...@apache.org>
Subject [jira] [Moved] (AWF-60) Native arrays are inefficient in java
Date Wed, 29 Feb 2012 10:10:04 GMT

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

Tony Stevenson moved DEFT-77 to AWF-60:
---------------------------------------

    Reporter: Niklas Gustavsson
         Key: AWF-60  (was: DEFT-77)
     Project: Apache AWF  (was: Deft)
    
> Native arrays are inefficient in java
> -------------------------------------
>
>                 Key: AWF-60
>                 URL: https://issues.apache.org/jira/browse/AWF-60
>             Project: Apache AWF
>          Issue Type: Bug
>            Reporter: Niklas Gustavsson
>
> Its expensive to allocate a native array because of a constraint/rule (in JLS) that says
that a newly allocated array, e.g. byte[], must have each of its elements default initialized.
(0 for byte)    
> In org.deftserver.web.protocol.HttpResponse:
>     private final static int WRITE_BUFFER_SIZE = 1500;	// in bytes
>     private DynamicByteBuffer responseData = DynamicByteBuffer.allocate(WRITE_BUFFER_SIZE);
> Changing this to 64/128 increased the performance (ab -k -c25 -n800000) by ~30%. (21
#/sec -> 27#sec, in 0.1.0/0.1.1 we used String concatenation, maybe thats why we saw that
kind of performance)
> Did another quick try (with the changes mentiond above): 
> In Application:
>     private int readBufferSize = 128;	// in bytes
> gave: 33905.68 [#/sec] (mean) 
> (same ab execution)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message