Mac NSPR should not calls Microseconds for thread scheduling

RESOLVED WONTFIX

Status

NSPR
NSPR
P2
normal
RESOLVED WONTFIX
17 years ago
15 years ago

People

(Reporter: Simon Fraser, Assigned: Simon Fraser)

Tracking

4.0.2
PowerPC
Mac System 8.5

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

17 years ago
_MD_GetInterval() on Mac calls Microseconds()

http://lxr.mozilla.org/seamonkey/source/nsprpub/pr/src/md/mac/mactime.c#234

and Microseconds is known to have some performance and accuracy problems:

http://developer.apple.com/technotes/tn/tn1063.html#Microseconds

We should use UpTime() instead.

Comment 1

17 years ago
Simon, please advise on when this bug needs to be fixed.
Thanks.

Updated

17 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

17 years ago
I collected some data on this, and have a patch.

Using the current Microseconds call, which is a 68k call, the average time spent 
in _MD_GetInterval() is 8.48ms. Changing that to use UpTime() and 
AbsoluteToNanoseconds() reduces the average time in this call to 2.83ms.

I actually think we should change the NSPR timing implementation (PR_IntervalNow, 
PR_MillisecondsToInterval and friends) to use more of the Multiprocessing and 
Driver Services APIs under the hood, since these provide efficient absolute time 
and time interval APIs.
(Assignee)

Comment 3

17 years ago
Created attachment 25405 [details] [diff] [review]
Patch to replace Microseconds() call by UpTime()
(Assignee)

Comment 4

17 years ago
Created attachment 25406 [details] [diff] [review]
Patched with fixed spacing

Updated

17 years ago
Priority: P3 → P1
(Assignee)

Comment 5

17 years ago
Those times I gave above are of course microseconds, not milliseconds

Comment 6

17 years ago
I tried this patch and kept landing in macsbug (dsFSErr) and had to reboot my 
Mac.  I'm running OS 9.1.  I did try running other TCP/IP apps before mozilla but 
I still couldn't get past the profile picker dismissal.
(Assignee)

Comment 7

17 years ago
brade: did you try just this patch, or this and the MP Task one? I'd be surprised 
if just this one caused dsFSErrs.

Comment 8

17 years ago
sorry; my previous comment was intended for the other bug... I'll copy it over.

I haven't seen any errors attributable to this patch yet.

Updated

17 years ago
Target Milestone: --- → 4.2
Version: 3.0 → 4.0.2

Comment 9

17 years ago
Assigned the bug to Steve.
Assignee: wtc → sdagley
Status: ASSIGNED → NEW

Comment 10

16 years ago
Any progress on this improvement ? It might seems something very small to a non-
Mac developer, but I can assure you that it makes a huge difference. I used the 
same trick in my driver for an ADSL modem (not yet announced, so don't ask me for 
details).

Updated

16 years ago
Keywords: mozilla0.9.3

Updated

16 years ago
Priority: P1 → P2

Comment 11

16 years ago
What is the status of this bug (besides "sdagley is on sabbatical"); can we check 
it in or is it insufficient or ?
(Assignee)

Comment 12

16 years ago
Fixing this would make a very minor performance difference (probably below the 
noise).
Assignee: sdagley → sfraser
what is the current status on this? Is this something that is still an issue?
(trying to help focus)

Would I be remembering wrong, if I said that, I remembered reading next 
releases of Mozilla wouldn´t be supported pre 9.0? I guess my next question 
would be, are older versions of Mozilla supported still?
(Assignee)

Comment 14

15 years ago
No longer relevant since we don't care about CFM.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.