Jump to content
uniGUI Discussion Forums
Sign in to follow this  
vbdavie

Chart is slow

Recommended Posts

Hey, I noticed that the charting seems SLOW. If I have less than 50 items or so, it seems "reasonable". Not fast, but acceptable.

 

But if I have 300 points, then WOW, it's slow. And if I add several series then it's a magnified slowness.

 

Basically, I have a stock chart with 5 series in it. The differeent series keep track of different kinds of data over the same date range. I keep track of ONE YEAR (365 days) of data. It takes about 6 seconds for the graph to build and unlock the web page. So, if I have built the chart it takes a while to show it completly. OR if the chart is in a TAB, and I switch tabs to a non chart tab, it is fast, THEN I switch BACK to the chart with many points, THEN i have to wait many seconds before I can click on other things.

 

Have you any experience in this?

 

I turned off animate and it didn't make "much" of a difference.

 

Seems like a lot of people would be complaining about this.

 

Davie

P.S. I edited out EXTREMELY and SUPER slow... to be more accurate.

Share this post


Link to post
Share on other sites

Hi,

 

I have used unichart and the speed was OK.

 

If you complain about speed please specify the point where it's slow, I mean the slow maybe come from server side because there is a lot of data manipulation to do, or the respond time is extremely slow, or the drawing of the series is slow (client side).

 

When you know problem exactly then you can deal with it, I guess that the problem is with the data manipulation I mean it's very important to build the database (tables and fields) in the correct way (primary key and indexes- this is very important).

 

Once we had a problem of executing a queries in MySQL the action took a long time (about 3 hours) - I talk here about 800,000 records per day, and after that we change the definition of the indexes in our tables and we managed to reduce the time to 27 minutes !!

  • Upvote 1

Share this post


Link to post
Share on other sites

The problem has NOTHING to do with data base access. My datapoints are in a memory array. I assign the data points into the chart which goes fairly fast.

 

It's only in the DISPLAY of the chart where it's slow. For example: You can do this yourself. Make a chart with 300 points and have 5 series. So, I guess that's a total of 1500 distinct data points. Anyway, set up the 5 lineSeries each with 300 points. Then when the page displays, you can CLICK on one of the LEGEND items, so that the selected<clicked> lineSeries will become hidden. WAIT a bunch of seconds. Then if you click the same legend item, you will WAIT a bunch more seconds before the hidden lineSeries becomes visible again. I don't believe there is any server-side action going on here.

 

On my particular system, it's about 7 seconds that I have to wait before the graph is rebuilt and responsive.

 

Try it, you will see.

 

Davie

Share this post


Link to post
Share on other sites

Could you please post a test case ?

I tried to create 5 series with 5 x 300 points.  Hiding or showing a serie takes less than 1 second on my computer... 

Share this post


Link to post
Share on other sites

As a quick note, JS charts are not as fast as VCL charts. Yes, they are slow compared with desktop charts. For this you need to display only meaningful amount of data to user. For example showing a 1000 point series doesn't make sense, as user will not be able to see that much dots. If you see similar web apps such as Google or Yahoo Finance you'll that they re-sample data and only show a subset of full data when you try to display a big date interval.

Share this post


Link to post
Share on other sites

I noticed that "Animate" is enabled by default in uniGUI Charts. Disabling it may improve draw speed. Also removing markers can help too.

 

Fortunately next build will allow to configure above options.

Share this post


Link to post
Share on other sites

Okay, I have a TINY project that shows all the wierd stuff going on.

 

Plus the form contains a MEMO that shows how to re-create the issues/bugs. That way you don't have to keep refering to this forum. You can just run the program, load up your browser and use....

 

http://localhost:8077

 

as your URL and you are off and running. Just follow the instructions in the two memo fields.

 

In case you just want to run in, I have the EXE in there. It is compiled with XE3.

 

The browsers I tested with are Chrome(latest), FireFox(latest), IE version 9.

 

The issues are graphs not building, or line graphs showing odd legends and lines.

 

I attached a ZIP file that contains all the project files plus the pre-compiled EXE from my XE3 compiler.

 

Have a look and I'm sure you should get the same results that I mention in the two memo fields.

 

Thanks

Davie

ChartTest.zip

Share this post


Link to post
Share on other sites

Okay, I have a TINY project that shows all the wierd stuff going on.

 

Some of the weird stuff are already resolved as a result of improved layout management in latest build.

 

For hidden frame:

 

Drawing on hidden controls may have unwanted effects. It can also be a browser related bug as it works on chrome but fails on FF.

Instead of hiding and showing you can try creating and inserting your frame on demand when needed

Share this post


Link to post
Share on other sites

Hi Davie,

 

I just loaded and tried you "tiny" project (which is NOT so tiny).  I DIDN'T NOT note any slowness, even when clicking on "load valuation with 300 points": when I hide or show a series, it responds in LESS THAN 0,5 SEC (tried on Chrome and IE11). 

IMHO, your test case doesn't show any problem of slowness.  On IE9, it is a little bit slower... but that's IE9 :)

What is your version of uniGUI ?

 

I didn't notice your newer issues (graph not building or not refreshing) on Chrome, Firefox or MS Edge.  IE11 has some issues with javascript, that's a known thing, but it is not related to uniGUI.  And as Farshad says, it is probably related to the way you try to hide and show ExtJS components (IE probably doesn't execute scripts on hidden objects).

 

So as far as I can see, there is no bug related to "Chart is slow" (which is the title of this topic), is there ?

  • Upvote 1

Share this post


Link to post
Share on other sites

Farshad, that build# do I need then?

 

ZIG, thanks for taking time to look at it.

 

1. Did you run MINE or did you RE-compile your own?

2. Did you follow the TWO TMemo instructions on the right side of the form?

 

If you ran MINE and tested with chrome and FF and followed my two tmemo instructions and had no odd effects, please give me your version numbers for those two browsers that you used to test.

 

 

As for the speed, mine is about 1 full second, not real bad I suppose. I can live with that. It's mostly now the odd chart behaviour.

 

ZIG, sorry about project size, I honestly thought it was small.

 

Thanks for looking into this chart issue.

 

Davie

Share this post


Link to post
Share on other sites

Hi again Davie !

 

I didn't run YOUR executable because it is not compiled in same uniGUI version as mine (which is the last one), so my browser stops on "Loading" page.  That's why I asked you what is your uniGUI version, but you didn't answer.

As I wrote in my previous answer, I didn't notice odd effects on Chrome and FF.

 

If you consider that you can live with the current speed, I guess that this "Active bug" topic named "Chart is slow" can be close (especially when your first words are "EXTREMELY SLOW"). 

Share this post


Link to post
Share on other sites

Farshad;

 

The hidden frame is not drawn onto in a programatic way.

 

I have a form on the screen and the lower part contains a "hidden" frame. My program logic does not draw anything inside of it. I then click a checkbox on the form to SHOW the frame and the frame shows up<good>. THEN after I load my data points, the frame that USED to be hidden now shows the graph in a wierd way.

 

Now, I suppose it's possible that when the whole form is being displayed that INTERNALLY there may be some drawing on the hidden frame<i have no idea>. But my personal logic does not do any drawing on the frame while it's hidden.

 

Davie

Share this post


Link to post
Share on other sites

Zig;

 

You said " so my browser stops on "Loading" page.  That's why I asked you what is your uniGUI version, but you didn't answer".

 

I have version "Library Version: 0.99.50.1189".

 

When you say your browser STOPS, are you saying you never see my form? I'm confused because your earlier post suggested that you were able to test the web form.

 

I am curious if you followed the instructions on my Tmemo(s)

2. Did you follow the TWO TMemo instructions on the right side of the form?

 

Thanks

 

Davie

P.S. Can you give me YOUR EXE version of my test project?

Share this post


Link to post
Share on other sites

Farshad;

 

The hidden frame is not drawn onto in a programatic way.

 

I have a form on the screen and the lower part contains a "hidden" frame. My program logic does not draw anything inside of it. I then click a checkbox on the form to SHOW the frame and the frame shows up. THEN after I load my data points, the frame that USED to be hidden now shows the graph in a wierd way.

 

Now, I suppose it's possible that when the whole form is being displayed that INTERNALLY there may be some drawing on the hidden frame. But my personal logic does not do any drawing on the frame while it's hidden.

 

Davie

 

By saying drawing I mean Ext JS framework trying to draw a chart series on a hidden chart component.

Share this post


Link to post
Share on other sites

Farshad;

Thanks

 

Now where can I get build 1200?

 

Davie

Build 1200 is not available yet for trial edition.

 

Trial edition is not updated as frequent as regular edition.

Share this post


Link to post
Share on other sites

So, what should I be using in order to "possibly" correct the chart drawing wierdness?

Davie

 

If you seriously consider using uniGUI in your projects it is recommended to get your license.

Share this post


Link to post
Share on other sites

So, basically I'm in a situation where I can't tell if the system will meet the company's needs.

 

Trust me on this, whenever I talk with other Delphi developers on the phone or in person or via Email, I HIGHLY tout this software and boast the benfits of it over Radius, Intra-web, HTML-5 builder etc...

 

But what is "difficult", is to explain to the guy, at this small company, that we should spend hundreds and hundreds of dollars for a product that I don't know will work. And worse yet, for a Web-Site that they don't need. They want it but don't need it. The money man likes "mature" products that has been battle tested. I told him that this system is way bitch'n and cool and bad-ass, and that I'm working on deciding if it can do what we want. And if it can, the registration money will fly in your direction so fast it'll make your head spin. But it's hard to convince someone to pay a bunch of money for something to test out. Imagine having to buy a car before you could test drive it in actual sitiuations to see if it really performs the way you want. It's an up-hill battle. And "if" they ask for documentation to see the capabilities, I'll have to hang my head in shame.

 

I'm all in, as far as wanting to use this, it's a matter of convincing others to buy a non-finished product. I feel that I can stumble around with no docs and get basically what I need<generally>. But on some specifics, like the chart building, these are mission critical things that can be deal breakers. I will look like a fool if I tell them to fork over the money and then I find out the system can't do what we intended :(

 

If it were "me" personally and I had a spare cash laying around, I would just get it. But money is tight.

 

In order for me to not look foolish, can you please tell me the exact amount of the registration fee. I remember reading past posts about differeent prices and something about Sept. But I have no idea what the exact cost is. In fact, ANYBODY comming to your web site will have a hard time finding that cost.

 

I'm not saying these things to hurt or criticise you, I say them so that you understand the position I am in. Quite frankly, if this whole system is maintained by just you and a couple other dudes, I would say WHOLEY MOLEY, these guys are freakishly amazing and talented and doing the work of 20 guys. I've been in that situation before when it was just me, and I was selling over a million dollars of software in a year and advertising in PC-Mag<i got pcMag editor's choice award>, and PC-World<that dates me> and I had one secretary and one guy for shipping. That was it. And so, items that didn't bring in money didn't get the attention they needed.

 

 

Davie

Share this post


Link to post
Share on other sites

@davie

 

I will reply to your post later but before that please make a complete list of issues which prevent you from making your choice in favor of uniGUI.

Okay, I will. BTW, is it proper for forms to call their callback functions when you issue the CLOSE method on the form? Don't laugh. Here's what I noticed. I do a ShowModal on a form <login screen>. Then on the callback, I make certain things visible. Everything is fine at this point. Keep in mind that the login screen is now gone AND that the callback has already been called. So, everything is exactly as expected.

 

NOW, I have a button that says "Close". I click it and close the main form to essentially shut down the web page. Just like your demo program does with it's Exit1 function.

 

procedure TMainForm.Exit1Click(Sender: TObject);

begin

  Close;

end;

 

So, during the closing and destroying of the main form, it looks like <from the call stack> that the instantiated forms are also destroyed. So, the Login form gets destroyed, but during the destroying of the form, IT CALLS THE CALLBACK function. WOW. So, now the system blows up because the code for the callback has already been destroyed by destroying the main form. Why would the callback function get called when the login form has already become invisible?

 

Something doesn't seem right.

 

Davie

Share this post


Link to post
Share on other sites

Well, I ended up in this topic to see if I can find anything helpful and informative for me. I didn't have slow chart problem yet but I thought if one day I get this kind of problem, this topic could give me a deeper understanding about what beneaths the unigui charts.

 

But instead unfortunately after a couple of posts later it seems it turned into an argue with "no reason". So please calm down guys and remember that you are "developers". So develop a peace and keep going. You are both active users in this forum, I learnt much from your topics and we are only a bunch of people that could help each other in the world, we need each other. Of course Unigui's blossom day is coming soon, day by day and we'll have the luxury of arguing with the people we have chosen from thousands(!) :)

 

Seriously guys, make peace. You are in here nothing but to help each other.  :rolleyes:   B)   -_-

  • Upvote 6

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×