Bug 23123

Summary: CanvasPixelArray performance is too slow
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: DOMAssignee: Oliver Hunt <oliver>
Status: CLOSED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Devirtualise byte array logic
none
Fixed issues pointed out by mark barraclough: review+

Description Oliver Hunt 2009-01-05 13:45:34 PST
CPA perf is too slow, esp. when compared to pure array
Comment 1 Oliver Hunt 2009-01-05 15:13:07 PST
Created attachment 26444 [details]
Devirtualise byte array logic

devirtualisation-fu
Comment 2 Oliver Hunt 2009-01-05 15:40:56 PST
Created attachment 26445 [details]
Fixed issues pointed out by mark

Minor updates
Comment 3 Gavin Barraclough 2009-01-05 15:53:34 PST
Comment on attachment 26445 [details]
Fixed issues pointed out by mark

If bdash is happy with the style, then I'm happy with the logic.
Comment 4 Oliver Hunt 2009-01-05 17:52:43 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	C	WebCore/bindings/js/JSImageDataCustom.cpp => JavaScriptCore/runtime/ByteArray.h
	R	WebCore/bindings/js/JSCanvasPixelArrayCustom.h => JavaScriptCore/runtime/ByteArray.cpp
	D	WebCore/html/CanvasPixelArray.cpp
	D	WebCore/html/CanvasPixelArray.h
	D	WebCore/html/CanvasPixelArray.idl
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/GNUmakefile.am
	M	JavaScriptCore/JavaScriptCore.exp
	M	JavaScriptCore/JavaScriptCore.pri
	M	JavaScriptCore/JavaScriptCore.scons
	M	JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
	M	JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
	M	JavaScriptCore/interpreter/Interpreter.cpp
	M	JavaScriptCore/interpreter/Interpreter.h
	A	JavaScriptCore/runtime/JSByteArray.cpp
	A	JavaScriptCore/runtime/JSByteArray.h
	M	WebCore/ChangeLog
	M	WebCore/DerivedSources.make
	A	WebCore/ForwardingHeaders/runtime/ByteArray.h
	A	WebCore/ForwardingHeaders/runtime/JSByteArray.h
	M	WebCore/GNUmakefile.am
	M	WebCore/WebCore.pro
	M	WebCore/WebCore.scons
	M	WebCore/WebCore.vcproj/WebCore.vcproj
	M	WebCore/WebCore.xcodeproj/project.pbxproj
	M	WebCore/WebCoreSources.bkl
	M	WebCore/bindings/js/JSImageDataCustom.cpp
	M	WebCore/html/CanvasRenderingContext2D.cpp
	M	WebCore/html/ImageData.cpp
	M	WebCore/html/ImageData.h
	M	WebCore/html/ImageData.idl
	M	WebCore/platform/graphics/cg/ImageBufferCG.cpp
Committed r39625

Comment 5 Dean McNamee 2009-01-14 10:10:52 PST
Is it appropriate for WebCore to be using this JSC runtime/ class?  I don't know the rules, but this moved from using a WebCore type (CanvasPixelArray), to the new ByteArray JSC class.  It seems like it would be preferred to have the type in WebCore...

Thanks
Comment 6 Oliver Hunt 2009-01-14 10:33:28 PST
This is necessary to achieve acceptable performance, pulling bytearray into webcore would result in a cyclic dependency.

(In reply to comment #5)
> Is it appropriate for WebCore to be using this JSC runtime/ class?  I don't
> know the rules, but this moved from using a WebCore type (CanvasPixelArray), to
> the new ByteArray JSC class.  It seems like it would be preferred to have the
> type in WebCore...
> 
> Thanks
> 

Comment 7 Oliver Hunt 2009-01-14 10:57:32 PST
It may be possible to pull bytearray into WTF actually, which seems betterer