Re: [amibroker] Can a fast GPU speed up drawing complex charts?

 

Hello,

That depends on many factors, including operating system you are using and graphic card drivers.
AmiBroker currently uses GDI which is pretty fast because it is simple.

Depending on OS and graphic card that you use GDI may or may not be hardware accelerated.
To surprise of many people Windows XP and earlier had hardware accelerated GDI but
Vista does not, Win 7 and higher only in small portion (BitBlt and AlphaBlend).
In the old days, all graphic card drivers have hardware accelerated 2D primitives.

Microsoft expects people to use new APIs every now and then but new APIs have many compatibility
problems (not working on Terminal server for example) and are not necessarily faster.
For example GDIPlus is 10 times slower.

Direct2D that is newest API from MS for 2D rendering requires modern graphic card
and most recent OS (Windows 7 or higher) and does not work in some scenarios.

It produces nicely anti-aliased output BUT... there is no 2D hardware on the graphic card.
So it does that using 3D hardware and
this makes it not as fast as you would expect,
because to actually draw a single line it sends two 3D triangles to graphic card 3D rendering engine.
Single pixel is also rendered as two 3D triangles (because all hardware 3D rendering on graphic cards is based on triangles).

So, you won't gain much speed with newest Direct2D and even most modern graphic card .
Actual measured difference is just 1.5....2x.
Bigger difference can only be seen if rendering on very high resolutions (4K and higher).


The gains are small because most of the time is not spent on rendering but on CPU => GPU communication.


Best regards,
Tomasz Janeczko
amibroker.com

On 2016-02-20 12:15, milosz.mazurkiewicz@yahoo.com [amibroker] wrote:

Hello,

This question may seem trivial at first but I want to point out - I am not talking about taking advantage of CUDA or OpenCL technology. I am aware of TJ point of view on that matter. Tomasz has menshioned here, that this is not the way in case of Amibroker.

It is usually said, that all that matters in trading computers is a powerful CPU(s), lots of RAM and fast SSD drive(s). But the speed of GPU is usually neglected. Traders are usually only concerned about how many displays can they connect to their workstation. In most scenarios that is the case - especially when backtesting is concerned - CPU is the most important part of the computer. But what about charts/indicators - especially complex ones or when the chart is zoomed out, and there is lots of data to display?  If we take a look at chart timing (Tools/Preferences/Miscellaneous/Display chart timing) we can see what are the components of a chart/indicator total formula execution time. There are two main components: AFL execution time and GDI render time. In my case a typical AFL execution time is no more than 1 - 10% of total chart timing. For example when I zoom out a really complex chart, I can see, that AFL execution time is 10 ms  whereas GDI render time is 100 ms. In some cases the difference is even bigger -  0.5 ms versus 50 ms - so AFL execution takes 100 x less time than GDI rendering !!! 


If someone has many charts in the layout with complex formulas (especially when the charts are refreshed very often), system may become sluggish. I really appreciate that Amibroker is blazing fast comparing to other competitive products - but I have a question:


1) Can a fast GPU really speed up drawing complex charts/indicators? 


2) Lets say AFL execution time is 10 ms and GDI render time is 100 ms (total: 110 ms). Can we roughly expect, that 10 times faster GPU will make GPU render time drop to 10 ms (and total chart timing will drop from 110 ms to 20 ms)?


Best regards


Miłosz





__._,_.___

Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon