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 > Developer Center > Safari tweaking

Safari tweaking
Thread Tools
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 17, 2004, 11:02 PM
 
After reading David Hyatt's most recent post about the initial paint delay setting in Safari, I decided that since I couldn't get the latest build of Safari, I might as well look for a hidden pref to tweak the value to something more appropriate for my cable connection. So far I haven't found such a pref (I did defaults read com.apple.Safari). Any ideas on other places to look (I'm posting on this forum rather than the software one since I figure people will be more accustomed to working with the defaults database here)?
     
larkost
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
May 18, 2004, 08:37 AM
 
I would suspect that there is no defaults for this, and all of the values are hard-coded. This is a place where you do not want to be checking the disk for values all the time (kills performance), and so a place where compiling in a value makes a lot of sense.
     
Catfish_Man  (op)
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 18, 2004, 03:11 PM
 
Originally posted by larkost:
I would suspect that there is no defaults for this, and all of the values are hard-coded. This is a place where you do not want to be checking the disk for values all the time (kills performance), and so a place where compiling in a value makes a lot of sense.
Well, I would never, ever, not cache a defaults value if it was performance critical. Just do something like

float value = [defaults floatForKey:@"key"]; (or whatever the API on NSUserDefaults is) and then just use the float instead of loading it from defaults again.

You may be right though, they might not want people tweaking it
     
larkost
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
May 18, 2004, 03:24 PM
 
My point was even more than this that this value should be compiled in so that it can be optimized for. There is a good chance that even putting this into a register would not be as optimized as being compiled in. Any time there is any math with this value this could mean a hit, and since we are talking about 100's of ms, that could actually make a difference.
     
Tim2 at Omni
Dedicated MacNNer
Join Date: Aug 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
May 18, 2004, 06:02 PM
 
Originally posted by larkost:
My point was even more than this that this value should be compiled in so that it can be optimized for. There is a good chance that even putting this into a register would not be as optimized as being compiled in. Any time there is any math with this value this could mean a hit, and since we are talking about 100's of ms, that could actually make a difference.
The difference is maybe a single load, since you're going to have to store the value into a register to use it in any sort of computation, anyway.

Compared to the rest of what WebCore and Safari do during the transition between pages, it matters such an infinitesimal amount that you might as well not worry about it.

There are many defaults in OmniWeb which are used in the same way (cache it from defaults once, and then use many times).

More to the point: if you really want to find out if Safari uses a hidden default for this, there are a couple of ways I can think of to do that. You could run the 'strings' command on Safari from the Terminal, like so:

Code:
strings Safari
Find something that looks promising in the output, and try setting it via the 'defaults write' command.

Or, you could attach to Safari in GDB and set a breakpoint for -[NSUserDefaults objectForKey:] (also maybe some of the other somethingForKey: methods). Then print out $r5, like so:

Code:
(gdb) po $r5
You should get the key that Safari is looking up from defaults.

Hope that helps! Good luck!
Tim Omernick
Engineer, The Omni Group
     
Catfish_Man  (op)
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 19, 2004, 10:58 PM
 
Well... I think I found it.

WebKitInitialTimedLayoutDelay

However, I can't see any effect when changing it.
     
Catfish_Man  (op)
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
May 21, 2004, 09:11 PM
 
Turns out that it works, but Safari overwrites its prefs when you quit it, so it doesn't work if you do it while Safari is running (even if you then quit and relaunch).
     
steve1341
Fresh-Faced Recruit
Join Date: Dec 2003
Status: Offline
Reply With Quote
Jun 12, 2004, 08:36 AM
 
Anyone know how to increase the number of web addresses Safari rememers. Currently its 1000 but thats annoying when a work website has been cleared. I am pretty sure that tin Windows it is indefinite. Thanks
     
   
 
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:00 AM.
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.,