> On Sept. 19, 2012, 4:34 p.m., Dan Dumont wrote:
> > Committed r1387677
> > Please close this review.
> >

Marshall, could you please attach the patch here to the JIRA?


- Dan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7074/#review11697
-----------------------------------------------------------


On Sept. 19, 2012, 8:04 a.m., Marshall Shi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7074/
> -----------------------------------------------------------
> 
> (Updated Sept. 19, 2012, 8:04 a.m.)
> 
> 
> Review request for shindig, Ryan Baxter, Dan Dumont, Stanton Sievers, and 
> Rich Thompson.
> 
> 
> Description
> -------
> 
> The AllJsIframeVersioner causes a massive memory allocation executing the 
> following:
> 
> StringBuilder jsBuf = new StringBuilder();
> for (FeatureResource resource : registry.getAllFeatures().getResources()) {
>  jsBuf.append(resource.getContent()).append(resource.getDebugContent());
>  }
>  this.allJsChecksum = HashUtil.checksum(jsBuf.toString().getBytes());
>  
> The two problems with this are:
> (1) Creates a massive char[] for that string (we tested with a 4M resource)
> (2) Then allocates a new byte[] for that giant string
> 
> Proposed solution is to just use a simple message digest object against each 
> resource content. And concat all the bytes for HashUtil.checksum.
> 
> 
> This addresses bug SHINDIG-1867.
>     https://issues.apache.org/jira/browse/SHINDIG-1867
> 
> 
> Diffs
> -----
> 
>   
> http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/AllJsIframeVersioner.java
>  1373213 
>   
> http://svn.apache.org/repos/asf/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/uri/AllJsIframeVersionerTest.java
>  1373213 
> 
> Diff: https://reviews.apache.org/r/7074/diff/
> 
> 
> Testing
> -------
> 
> Done.
> 
> 
> Thanks,
> 
> Marshall Shi
> 
>

Reply via email to