Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-09 Thread Jim Graham
Hi Laurent, Quick questions - which benchmarks were run before/after? I see a lot of benchmark running in your Pisces improvement thread, but but none here. Also, this should be tested on multiple platforms, preferably Linux, Windows and Mac to see how it is affected by differences in the pla

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-09 Thread Laurent Bourgès
Dear Jim, I advocated I only looked at the netbeans memory profiler's output: no more megabytes allocated ! The main question is: how to know how GC / hotspot deals with such small allocations ? Is there any JVM flag to enable to see real allocations as does jmap -histo. > > Quick questions - wh

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-09 Thread Jim Graham
Hi Laurent, The allocations will always show up on a heap profiler, I don't know of any way of having them not show up if they are stack allocated, but I don't think that stack allocation is the issue here - small allocations come out of a fast generation that costs almost nothing to allocate

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Laurent Bourgès
Andrea, I am running benchmarks on my laptop (i7 - 2 core 2.8Ghz + HT => 4 virtual cpus) on linux 64 (fedora 14). Note: I always use cpufrequtils to set the cpu governor to performance and use fixed frequency = 2.8Ghz: [bourgesl@jmmc-laurent ~]$ uname -a Linux jmmc-laurent.obs.ujf-grenoble.fr 2.6.3

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Laurent Bourgès
Dear Jim, 2013/4/9 Jim Graham > > The allocations will always show up on a heap profiler, I don't know of > any way of having them not show up if they are stack allocated, but I don't > think that stack allocation is the issue here - small allocations come out > of a fast generation that costs a

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Peter Levart
Hi Laurent, Could you disable tiered compilation for performance tests? Tiered compilation is usually a source of jitter in the results. Pass -XX:-TieredCompilation to the VM. Regards, Peter On 04/10/2013 10:58 AM, Laurent Bourgès wrote: Dear Jim, 2013/4/9 Jim Graham

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Laurent Bourgès
Peter, 1/ I modified your TestRunner class to print total ops and perform explicit GC before runTests: http://jmmc.fr/~bourgesl/share/AAShapePipe/microbench/ 2/ I applied your advice but it does not change much: -XX:ClassMetaspaceSize=104857600 -XX:InitialHeapSize=134217728 -XX:MaxH

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Andrea Aime
On Wed, Apr 10, 2013 at 10:14 AM, Laurent Bourgès wrote: > Andrea, > I am running benchmarks on my laptop (i7 - 2 core 2.8Ghz + HT => 4 virtual > cpus) on linux 64 (fedora 14). > Note: I always use cpufrequtils to set the cpu governor to performance and > use fixed frequency = 2.8Ghz: > [bourgesl

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Sergey Bylokhov
Hi, Laurent. I am not an expert here but just my 50 cents. This optimization shall take place only if it is really hotspot. But if it is a really hotspot - probably it would be better to remove these array/object allocation at all and use plane bytes? I see that some methods which take it as arg

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Laurent Bourgès
Sergey, I am not an expert here but just my 50 cents. > This optimization shall take place only if it is really hotspot. But if it > is a really hotspot - probably it would be better to remove these > array/object allocation at all and use plane bytes? > Java2D calls AAShapePipe for each shape (l

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Sergey Bylokhov
On 4/10/13 11:46 PM, Laurent Bourgès wrote: I see that some methods which take it as argument doesn't use them. And most of the time we pass AATileGenerator and abox[] to the same methods, so it could be merged? For now I did not want to modify the AAShapePipe signatures: abox[] is filled by AA

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-10 Thread Jim Graham
I'm pretty familiar with all of this code and there aren't any places that save the tile array that I remember. The embedded code that Pisces was taken from had some caching of alpha arrays, but we didn't use or keep that when we converted it for use in the JDK... It occurs to me that since y

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-11 Thread Laurent Bourgès
Jim and Sergey, 1/ Here are few benchmarks (based on mapBench again) running several modified versions of AAShapePipe: http://jmmc.fr/~bourgesl/share/AAShapePipe/mapBench/ - ref: 1 threads and 20 loops per thread, time: 3742 ms 2 threads and 20 loops per thread, time: 4756 ms 4 threads and 20 loop

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-11 Thread Laurent Bourgès
Last idea: I will enhance Andrea's mapBench benchmark to have statistics per threads: number of loops, avg, min, max, stddev; I guess that the total bench time is not so representative as the thread pool can distribute the work load differently at each test => statistics will help to have better t

Re: [OpenJDK 2D-Dev] AAShapePipe concurrency & memory waste

2013-04-11 Thread Jim Graham
Hi Laurent, Yes, these kinds of minor optimizations (i.e. optimizations that don't make a clear 2x type of savings) can be frustrating at times. It looks like there is potential for a decent return there if we can find the right change. Sometimes rearranging a couple of things that don't loo