Author Topic: Hourglass in long operations (project loading)  (Read 30607 times)

takeshimiya

  • Guest
Re: Hourglass in long operations (project loading)
« Reply #15 on: July 27, 2006, 07:15:36 am »
What I mean is that now the code is slow and takes a long time.
When the new code will be ready, we will speak about that way of working.
Now we have another code, a slow code.
I agree with that philosophy. It's called a quick & dirty fix.

Quote
Its usage is popular among hackers, who use it to describe a crude solution or programming implementation that is imperfect, inelegant, or otherwise inadequate, but which solves or masks the problem at hand, and is generally faster and easier to put in place than a proper solution.

Quick-and-dirty solutions often attend to a specific instance of a problem rather than fixing the cause of the more general problem. As such, they are sometimes used to keep an item of software or hardware working temporarily until a proper fix can be made.

And in this case, it's just a matter of philosophy.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #16 on: July 27, 2006, 09:51:04 am »
I agree with that philosophy. It's called a quick & dirty fix.
No Takeshi, it's called a no-fix.

A real quick and dirty fix would be to insert Freeze() and Thaw() into MainFrame::OnDropFiles. This indeed fixes something, even if not in a pretty way. It removes flicker and speeds up loading DnD files quite noticeably (on a rough estimate by a factor of 3 or 4).

Another quick and dirty fix is to disable plugin notifications for each individual opened file while walking through the list of dropped files, but that would change SDK behaviour.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Hourglass in long operations (project loading)
« Reply #17 on: July 27, 2006, 10:10:23 am »
It does not solve anything. Absolutely. So I do NOT want to discuss that. Just 'feedback' to the user.

A few weeks ago, I installed CB on a colleagues pc, and opened there a project. CB loaded the project and had it's little share of unresponsiveness (clicking somewhere sometimes turn the menu bar white). I did not say a word, well i said, it takes sometime but so does MSVC ;-)

The fact the hourglass is there looks to me as a good compromise, when people see the hourglass the get a first impression somethings happening (but to be honest I have seen programs cras/freeze while looking at their hourglass ;-) ) and as long as the cursor does not have it's normal looks it prevents most of the users to click anywhere else.
My "personal opinion" : for that purpose I like it.

And even when the loading is optimized in future, you always have people with very big projects/workspaces and even then it might serve the same purpose.


Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #18 on: July 27, 2006, 10:53:15 am »
You see, I am not against showing that hourglass cursor. What I am against is to show a hourglass cursor instead of actually digging for the root of the evil.

For example, in the case of drag and drop, a simple Freeze() and Thaw() works wonders, and if you process a paint event just before freezing the window, then it is not even visually unpleasing.
This is still not pretty, but it successfully works around some of the problem. It actually causes 20 files to be loaded almost instantly when in the cache (and in well under a second otherwise), as the massive GUI overdraw is not done any more.
Add the busy cursor to that? I shan't be bothered, it will only be visible for a fraction of a second anyway...

Of course it would be better to fix the problem in another place, since even without overdraw, we are having unnecessary overhead. For example, when opening 25 files, we rebuild the "Recent Files" menu 25 times from scratch, which fires around 75 update UI events, which are processed by several handlers each. Rebuilding the menu only once at the end of the batch would be the right thing to do. However, this is of course a lot more work than calling Freeze() and Thaw().
There's more to it than just that, but that's one example.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline kidmosey

  • Multiple posting newcomer
  • *
  • Posts: 95
    • MUSITU International
Re: Hourglass in long operations (project loading)
« Reply #19 on: July 27, 2006, 11:37:26 am »
I can see the merit in wanting to optimize the loading procedures, and I completely agree that locking the user out is not a very good option; but for every PC that can load 20 files in under a second, there are likely 100 PC's that will take several seconds to load the same files.  Optimizations, IMO, only allow the user to do more things to get the same slow-down.  I am running about 8 different apps, now (encoding, compiling, etc...), because that is what my PC can handle while still having tolerable performance.

I do think there should be some indicator that the application is doing something, besides just a frozen workspace icon in the manager pane or a cursor that lets you do nothing.  Maybe insert a small progress bar at the base of the pane to let the user know there IS something happening, and to also notify them when the loading is completed.

This will also let you know if the app has frozen, because the progress indicator will not change for a while.  True, this is yet another feature that could slow down the loading, and it may be difficult to implement, but it seems like a better solution than the antiquated hourglass.

3 years until google knows more than god.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Hourglass in long operations (project loading)
« Reply #20 on: July 27, 2006, 12:01:51 pm »
since we were talking here about DnD of several files in CB, does anyone else also have the following :

1) open CB --> (with no default workspace, if so close it) --> shows the start here page
2) Dnd several "source" files on CB
3) close all those source files  ----> the start here page does NOT reappear !

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #21 on: July 27, 2006, 12:59:27 pm »
Yes, though I have the "Start Here" page available all the time until closing all. It looks like "close all" closes the "Start Here" page, too.

Thinking about it... this makes sense too, since it is a EditorBase, and therefore part of the list of open editors returned by EditorManager. "Close all" loops through all editor bases and closes each one.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Hourglass in long operations (project loading)
« Reply #22 on: July 27, 2006, 01:09:26 pm »
 :lol: you are 100% correct

menu entry to force to show the start here page ??

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #23 on: July 27, 2006, 01:15:21 pm »
I've already fixed it, trivial one-liner.  Well, not even a complete one-liner... :)

EDIT:
Only one problem, I cannot commit due to "no space left on device" from the side of BerliOS...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #24 on: July 27, 2006, 01:33:04 pm »
Hmm... df reports zero free blocks on /, looks like they're really serious about "no space left".

Although it is probably a different physical machine, I'll have a look what happens after deleting a few old nightly builds. We have so much stuff that's many weeks (or even months) old. Maybe we're lucky and that gives us a breather...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Defender

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Hourglass in long operations (project loading)
« Reply #25 on: July 27, 2006, 01:54:03 pm »
Hmm... df reports zero free blocks on /, looks like they're really serious about "no space left".

Although it is probably a different physical machine, I'll have a look what happens after deleting a few old nightly builds. We have so much stuff that's many weeks (or even months) old. Maybe we're lucky and that gives us a breather...
The question is, why you can't even download from svn?

sethjackson

  • Guest
Re: Hourglass in long operations (project loading)
« Reply #26 on: July 27, 2006, 02:03:56 pm »
You see, I am not against showing that hourglass cursor. What I am against is to show a hourglass cursor instead of actually digging for the root of the evil.

Exactly. Fix the problem not hack around it. :)
« Last Edit: July 27, 2006, 02:08:37 pm by sethjackson »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Hourglass in long operations (project loading)
« Reply #27 on: July 27, 2006, 02:07:38 pm »
Hmm... df reports zero free blocks on /, looks like they're really serious about "no space left".

Although it is probably a different physical machine, I'll have a look what happens after deleting a few old nightly builds. We have so much stuff that's many weeks (or even months) old. Maybe we're lucky and that gives us a breather...

busy cleaning up nightlies

sethjackson

  • Guest
Re: Hourglass in long operations (project loading)
« Reply #28 on: July 27, 2006, 02:08:46 pm »
Hmm... df reports zero free blocks on /, looks like they're really serious about "no space left".

Although it is probably a different physical machine, I'll have a look what happens after deleting a few old nightly builds. We have so much stuff that's many weeks (or even months) old. Maybe we're lucky and that gives us a breather...

busy cleaning up nightlies

Tried running SVN update. No go. "No connection could be made because the target machine actively refused it". :P

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Hourglass in long operations (project loading)
« Reply #29 on: July 28, 2006, 12:29:42 am »
Returning in thread...

I'je just updated the source from SVN: the hourglass is ok for project/workspace loading, but there are troubles with the OnDropFiles() function.
1) the hourglass is called, but never shown
2) the GUI freezes more than before
3) while the files are being loaded, you can click on the window below C::B
Please try 3) because I've never seen something like that! You see C::B window, but the clicks go to the window below (and the repaints are done over C::B too).

Another note:
Why not add the hourglass at the beginning of the function?
It would be only 1 line of code and all switch cases would be affected while now some are skipped.