Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Scrolling. Why use Quartz?

Scrolling. Why use Quartz?
Thread Tools
foamy
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Dec 27, 2001, 04:06 PM
 
If you want to actually see why scrolling is so pathetically slow, fire up Quartz Debug found in the Developer Tools Applications folder. Check the "flash screen updates" and "no delay after flashing" boxes, then go scroll a window. Any time you see yellow flashing it means that Quartz (the CPU, not the video card) is doing the drawing. Everytime the pages moves any distance whatsoever, the CPU has to redraw it (and double buffer it presumably). This can tax even the fastest machine. Type some text in a window and after each keystroke, the contents are redrawn by the CPU. Now drag a window around...only the drop shadow flashes. Notice the contents don't flash... this means the GPU (video card) is doing the drawing.

So if you do the calculations (I'm not going to) every time a window being scrolled moves, the CPU has to redraw millions and millions of pixels, twice for double buffering. Why is this done in the first place? AFAICT it is for the transparency effect of Quartz. However herein lies the problem. How often in real life use, would transparency ever be needed while scrolling? I can think of three instances.

1. Your window is under the dock. In this case you would want Quartz to render the scrolled contents or else you would get those nasty white blocks like you see in Classic. However, if windows "respect the dock" then this shouldn't be an issue. Furthermore, the only time this would occur is if the use purposefully places a window under a right or left hand oriented dock.

2. During that fleeting instant when the volume or brightness icons on a powerbook are floating over your window to be scrolled.

3. If you have some 3rd party application which floats on top and has transparency.

So for the sake of these three instances which will likely never occur in "real" use, we suffer poor scrolling performance.

Disclaimer. I am not a programmer, so I don't know how hard this would really be to implement.

The Solution. When you click the scroll arrow or scroll with the keyboard.

1. if (something transparent above me)
use Quartz for all scrolling
2. else
use the poor lowly video card to draw the pixels
3. when done #i.e. you let up the mouse
use Quartz to rebuffer the window

Since Quartz is so fast the instant you release the mouse, the window could be double buffered in preparation for dragging your transparent terminal over your omniweb window to show your PC friends how cool transparency is on your mac.

Any programmers care to comment on how hard this would be?
     
Hash
Mac Elite
Join Date: Apr 2001
Status: Offline
Reply With Quote
Dec 27, 2001, 05:03 PM
 
It was already discussed million times. Search in past threads

     
Colonel Panic
Senior User
Join Date: Mar 2001
Location: NY, NY
Status: Offline
Reply With Quote
Dec 27, 2001, 08:08 PM
 
was foamy's particular solution discussed? i haven't seen it and i've wondered if it were (even remotely) possible as well.
     
Cipher13
Registered User
Join Date: Apr 2000
Status: Offline
Reply With Quote
Dec 27, 2001, 10:03 PM
 
Incredibly lame...
When QuickDraw can outperform Quartz, you know theres a problem.

This is what I mean by form over function... screw transparency if it causes this much trouble. Scrolling in OSX is pathetically slow.
     
foamy  (op)
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Dec 27, 2001, 10:22 PM
 
Exactly. Form over Function.

If my "solution" could be implemented, then Form and Function could peacefully coexist.

For me it boils down to this.

When I am directly interacting with the OS, I want it done now if at all possible. This includes scrolling, typing, menus, previews, etc.

When I want my OS to show-off, the OS can take its time. Dock mag, Genies, dragging transparent windows around, etc. Just typing that last phrase it makes me wonder... if all this transparent hoopla is so important, then why isn't there a transparent Terminal pref built in?

Remember Moki's copyblitz test? Another example of form over function. He clearly showed that the method Apple used to copy the window bits into the buffer was not optimal and that it was not optimized for the G4.

That said, I'm willing to give Apple the benefit of the doubt... maybe they have something up their proverbial sleeve and all this Quartz mumbo-jumbo will really be put to use.
     
edddeduck
Mac Elite
Join Date: Mar 2001
Location: London
Status: Offline
Reply With Quote
Dec 28, 2001, 12:30 AM
 
Cipher when Mac Paint runs faster than Photoshop you know there is something wrong !!!!!

By saying this I hope you might understand that every upgrade to the OS will bring in new things. Quartz has a lot of clever things under the hood and of course is a little slower (although I think I remember someone actually said its the memory bandwidth not the code that is the problem). If it ain't broke don't fix it is not a good solution. If people didn't evolve we would have no computers we would actually all be one celled amiba (sp?).

I listened to someone like you when apple released the Mac. He had a ][e, he went on saying the ][e did everything he needed and how the window thing was a gimic and slowed him down. Mouse he said just an "executive toy". His biggest grip was the possibility of colour monitors. Colour monitors he said why? Black and White or green and white is fine what would you ever need colour for?

Now you might be saying this is all out of context and unfair but THAT'S WHAT HE SAID TOO.

I am actually interested in ways to speed up OS X but if it means going backwards no thanks.

Cheers Edd

[EDIT] Rant over just it pisses me off when everything in OS X sucks and is worse than OS 9 according to some people. Cipher you have finally baited me into a flame. I apologize for the rant but I am not going to delete the post and claim I wrote something different. These are my views just written in rant mode. [/EDIT]

[ 12-27-2001: Message edited by: edddeduck ]
     
Drizzt
Mac Elite
Join Date: Jan 2001
Location: Saint-Jean-sur-Richelieu, Québec, Canada
Status: Offline
Reply With Quote
Dec 28, 2001, 01:44 AM
 
Well.. look at that.. even Quickdraw apps flash... (I opened Quartz Debug for that..)

I think most of the people speaking against MacOS X are for almost nothing.. shure.. it's a little slower.. but right now everything's fine for me on my iBook SE 366 (with a Rage Pro). The only thing I miss is 6h battery life and OpenGL.. except that I love MacOS X as it is...

One thing Quartz does for you that Quickdraw did not (b4 OS X)..

just scroll in IE.. and notice the difference (you may say it's slower.. but at least it's not redrawing the part you just scrolled.. it goes smooth and nice!).
     
yukon
Mac Elite
Join Date: Oct 2000
Location: Amboy Navada, Canadia.
Status: Offline
Reply With Quote
Dec 28, 2001, 02:17 AM
 
ehh, quartz is slow. so was system7. Big deal, I own a supercomputer and I expect at least a responsive system. powerwindows does the same thing in os9, if only hackishly and unreliably.

OS X is an attempt at a "future proofed OS" if you will. It is expected to be slower. But we all know many things are ever so much faster is OS X because they can be, and that a dual (dual!) cpu supercomputer with 1gb (how many x640k?) of ram and 20gb (how many x my old 20mb? hard drive, should be able to handle at least its own operating system with grace and (BLAZING!) speed.

I say apple should have a "turn off-make fast" option to make its users happy. geez, its just alpha channel!
[img]broken link[/img]
This insanity brought to you by:
The French CBC, driving antenna users mad since 1937.
     
Severed Hand of Skywalker
Addicted to MacNN
Join Date: Apr 2001
Location: The bottom of Cloud City
Status: Offline
Reply With Quote
Dec 28, 2001, 02:53 AM
 
Originally posted by Cipher13:
<STRONG>Incredibly lame...
When QuickDraw can outperform Quartz, you know theres a problem.

This is what I mean by form over function... screw transparency if it causes this much trouble. Scrolling in OSX is pathetically slow.</STRONG>
Shame Cipher13 doesn't work for Apple. If so we wouldn�t have transparencies, we would have bevels and outer glows like in his signature.

Darn.

"Ahhhhhhhhhhhhhhhh"
     
leperkuhn
Senior User
Join Date: Feb 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Dec 28, 2001, 03:35 AM
 
A fundamental of computing is "make it work, then make it fast." apple will fix the drawing issue, they aren't stupid. I have a hard time believing they won't, if you can get 50fps in quake 3 with 20 bots running around, I think they can MAKE STUFF FEEL FAST in the finder.

optimization is always last. you don't do it along the way. I dont know what programming any of you have done, but i have about 10 years behind me.

My 2 cents.
     
Severed Hand of Skywalker
Addicted to MacNN
Join Date: Apr 2001
Location: The bottom of Cloud City
Status: Offline
Reply With Quote
Dec 28, 2001, 03:48 AM
 
Originally posted by leperkuhn:
<STRONG>
optimization is always last. you don't do it along the way. I dont know what programming any of you have done, but i have about 10 years behind me.</STRONG>
The thing is people have been saying that for 2 years. Is it Quartz optimization time yet?

"Ahhhhhhhhhhhhhhhh"
     
Developer
Addicted to MacNN
Join Date: Apr 2001
Location: europe
Status: Offline
Reply With Quote
Dec 28, 2001, 07:21 AM
 
Quartz Debug doesn't show you if drawing is done by the CPU or the GPU, it shows screen updates. It doesn't matter if an app draws only the revealed portion and shifts the rest or draws everything new when scrolling. The whole view is updated, that's why it flashes.
Nasrudin sat on a river bank when someone shouted to him from the opposite side: "Hey! how do I get across?" "You are across!" Nasrudin shouted back.
     
Spheric Harlot
Clinically Insane
Join Date: Nov 1999
Location: 888500128, C3, 2nd soft.
Status: Offline
Reply With Quote
Dec 28, 2001, 07:55 AM
 
Originally posted by Severed Hand of Skywalker:
<STRONG>

Shame Cipher13 doesn't work for Apple. If so we wouldn�t have transparencies, we would have bevels and outer glows like in his signature.

Darn.</STRONG>
...and cooperative multitasking and non-protected memory. And we'd be working in black and white.

Darn.
     
squiggy
Junior Member
Join Date: Oct 2001
Status: Offline
Reply With Quote
Dec 28, 2001, 08:30 AM
 
Originally posted by Developer:
<STRONG>Quartz Debug doesn't show you if drawing is done by the CPU or the GPU, it shows screen updates. It doesn't matter if an app draws only the revealed portion and shifts the rest or draws everything new when scrolling. The whole view is updated, that's why it flashes.</STRONG>
If that were the case then live window dragging wouldn't show like it does. Quartz debug only flashes what is painted by the window server.

I mentioned this (about using hardware acceleration for scrolling) some time ago, and someone else posted the same question a while later to a developer list and the only answer was that they didn't think it was (hardware accelerated) but that they weren't sure.

It does seem like it'd be possible to have the video card scroll the region of the window that is already present on the screen and just transfer the updated region. This is something that any video card capable of running OS X should be able to do, but it's not something you could do with just an updated driver - it'd take rewriting Quartz as well (but it wouldn't be that hard). I'm not sure what kind of speedup it'd be, as you'd still be doing compositing and whatnot, but at least the bus traffic would be less.

Ideally you might be able to work out some sort of fuzzy logic to delay updating the backing store (since when you hit the down arrow button in the scrollbar it's likely you're going to hit it again fairly soon, or hold it down, so constantly updating the backing store when you're scrolling down a page is really thrashing the memory around). Right now the "solution" is to scroll multiple lines (around six seems to be common in the web browsers) at a time so you don't scroll as much. Of course, it'd probably be pretty ugly and hacky and I'm not sure that Apple feels like it's worth it. The people complaining about this are mostly users with older machines. I know my system scrolls pretty fast with IE or OmniWeb (unless, say, there's another browser window loading in the background). That's my beef with the current setup - it's not so much that it's horribly slow as it sucks up so much processor power to do it.
     
moki
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status: Offline
Reply With Quote
Dec 28, 2001, 02:41 PM
 
Originally posted by foamy:
<STRONG>
The Solution. When you click the scroll arrow or scroll with the keyboard.

1. if (something transparent above me)
use Quartz for all scrolling
2. else
use the poor lowly video card to draw the pixels
3. when done #i.e. you let up the mouse
use Quartz to rebuffer the window

Any programmers care to comment on how hard this would be?</STRONG>
What you're stating is essentially what we do in Deimos Rising. When you play it "in a window", there are two modes: "safe mode" and "fast mode". When you're at the main screen, the game is paused, etc. we act like a nice citizen and then just use the Quartz APIs.

When you're actually playing the game, we bypass the normal double buffering, so that you get good performance while you're actually playing the game.

Why other games don't do this, I don't know. Perhaps because they are used to not having to do it. The same thing could in principal be done for any kind of application, but this is really something that other than for special-case things like games, Apple should be the one providing the solution.

One scenario is a set of APIs that let you bypass this double buffering in a way that will make it easy for application developers to do this in a standardized way. A better solution is for them to come up with a way to make video drivers smarter, and take better advantage of the hardware available if at all possible. Note: the nature of Quartz doesn't easily allow this, or it would already have been done.

It is extremely true that the sluggishness you feel in Mac OS X is at least in part due to the window double buffering, and that the CPU has to handle most of the drawing done by the window server. There are still a number of other areas that could use optimization also, though.

Apple made great strides with 10.1 -- let's see what they do with 10.2. Mac OS X does run quite well on all of the hardware they are selling now, though -- I played around with a dual 800 a while ago, and man. Mac OS X was a silky dream on that machine. I suspect they are targeting current and future hardware more than older machines (under the presumption that you can run Mac OS 9 on those older machines if you don't like the speed).

Didn't say I agreed with it or like it, but I assume that's the mentality.
Andrew Welch / el Presidente / Ambrosia Software, Inc.
     
foamy  (op)
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Dec 28, 2001, 06:50 PM
 
Well it's good to read that Ambrosia is working around this apparent design flaw in Quartz. Also, if 3rd parties can do it on a per app basis then surely it is possible for Apple to code a similar behavior into the Quartz or the window manager (or wherever it needs to be done).

Unless Apple has something dramatic up their sleeves in the *near* future, whereby the power of Quartz is really necessary, then it only seems logical that the default API would behave in a way where things that don't require immediate double buffering, transparency, etc., like scrolling, would be sent off to the video card. By extension, it would seem logical if you (the dev) want all the fancy stuff on all the time that you could write to a different API. Maybe all this fancy stuff will make sense in the future, but for now it literally feels like a hindrance.

That said, I use OSX 100% of the time and love it. As Moki pointed out, Apple made great strides with 10.1. Let's hope that in order to get a "zippy" OSX experience those of us that just purchased 550Mhz TiBooks don't have to make another $2000.00+ purchase in the near future.
     
moki
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status: Offline
Reply With Quote
Dec 28, 2001, 10:54 PM
 
Originally posted by foamy:
<STRONG>Well it's good to read that Ambrosia is working around this apparent design flaw in Quartz. Also, if 3rd parties can do it on a per app basis then surely it is possible for Apple to code a similar behavior into the Quartz or the window manager (or wherever it needs to be done). [/b]
There were a lot of developers who were asking about a way to disabled double buffering on the various developer mailing lists initially.

Originally posted by foamy:
[QB]Unless Apple has something dramatic up their sleeves in the *near* future, whereby the power of Quartz is really necessary, then it only seems logical that the default API would behave in a way where things that don't require immediate double buffering, transparency, etc., like scrolling, would be sent off to the video card. By extension, it would seem logical if you (the dev) want all the fancy stuff on all the time that you could write to a different API. Maybe all this fancy stuff will make sense in the future, but for now it literally feels like a hindrance.[/b]
The ironic thing is that the method we're using still doesn't use the video card hardware to do the copy, near as I can tell. I actually managed to find a little bug in their 32 &lt;-&gt; 16 bit copies (that's part of what those CopyBlitz tests were about) which would cause it to be way slower than it needed to be. Apparently the info got to the right people at Apple.

Originally posted by foamy:
[QB]That said, I use OSX 100% of the time and love it. As Moki pointed out, Apple made great strides with 10.1. Let's hope that in order to get a "zippy" OSX experience those of us that just purchased 550Mhz TiBooks don't have to make another $2000.00+ purchase in the near future.</STRONG>
hrm. OS X runs pretty nicely on my TiBook to be honest with you. I don't have any speed issues with it on there for the most part.
Andrew Welch / el Presidente / Ambrosia Software, Inc.
     
Cipher13
Registered User
Join Date: Apr 2000
Status: Offline
Reply With Quote
Dec 28, 2001, 11:17 PM
 
Originally posted by Severed Hand of Skywalker:
<STRONG>

Shame Cipher13 doesn't work for Apple. If so we wouldn�t have transparencies, we would have bevels and outer glows like in his signature.

Darn.</STRONG>
Well, they'd be options anyway

Your idiocy amazes me no end.
     
naden
Dedicated MacNNer
Join Date: Sep 2000
Location: Perth, Western Australia
Status: Offline
Reply With Quote
Dec 28, 2001, 11:37 PM
 
Originally posted by Cipher13:
<STRONG>

Well, they'd be options anyway

Your idiocy amazes me no end.</STRONG>
My dream ..

a) Apple includes transparency/drop shadow option
b) Cipher realises it makes exactly zero difference to effective 'speed'
c) Cipher apologises on here for his postings.

Nearly 10000 posts and still coming up with great material.
     
Scrod
Mac Elite
Join Date: Jan 2001
Location: Sad King Billy's Monument on Hyperion
Status: Offline
Reply With Quote
Dec 29, 2001, 12:59 AM
 
I don't know, I think you're being a little too harsh--compared to some morons who post on the MacFixit discussion forums, cipher is a fully enlightened individual with respect to OS X! I saw one guy's tirade about how Virtual PC 5 was slow in OS X due to the excessive use of drop shadows and translucent menus! I mean, come on--those things aren't even being updated while you're using VPC!
I abused my signature until she cried.
     
Cipher13
Registered User
Join Date: Apr 2000
Status: Offline
Reply With Quote
Dec 29, 2001, 09:46 AM
 
Originally posted by naden:
<STRONG>

My dream ..

a) Apple includes transparency/drop shadow option
b) Cipher realises it makes exactly zero difference to effective 'speed'
c) Cipher apologises on here for his postings.

Nearly 10000 posts and still coming up with great material.</STRONG>
Wow. Three strikes, so my crystal ball tells me...

Drop shadows and transparency probably don't impact on speed; I don't want them because they annoy me.

What DOES impact on the responsiveness (however illusionary), the GUI speed (the 'feel') are things such as fading menu's.

People mix up why I don't want certain things because in my rants I don't seperate and define the reasons well enough anymore... I just can't be bothered. You've all heard it before

Quartz is just plain shoddy.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:56 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,