Closed Bug 424693 Opened 17 years ago Closed 17 years ago

js_ComputeFilename accounts for 10-12% of date-format-tofte

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: sayrer, Assigned: igor)

Details

(Keywords: perf)

Attachments

(2 files, 1 obsolete file)

This test uses eval, and the filename/line# calculations are expensive there.
Target Milestone: --- → Future
Version: unspecified → Trunk
Judging by the code, I think the culprit is js_PCToLineNumber. It walks through all source notes of the script containing the eval to find the note that contains the given pc. A simple fix would be to embed the line number into JSOP_EVAL.
Assignee: general → igor
Attached patch v1 (obsolete) — Splinter Review
The patch introduces JSOP_LINENO and always generates the new bytecode after JSOP_EVAL. I use this independent bytecode and don't extend JSOP_EVAL with an extra 2 bytes to store lineno to avoid extra checks in the shared implementation of JSOP_CALL and JSOP_EVAL.
Attachment #311301 - Flags: review?(shaver)
Attached patch v1 for realSplinter Review
Attachment #311301 - Attachment is obsolete: true
Attachment #311302 - Flags: review?(shaver)
Attachment #311301 - Flags: review?(shaver)
Comment on attachment 311302 [details] [diff] [review] v1 for real r=shaver, indeed. (The comment above JSXDR_BYTECODE_VERSION should really be changed, since we want to increment the second term, to decrement the expression's value!)
Attachment #311302 - Flags: review?(shaver) → review+
Comment on attachment 311302 [details] [diff] [review] v1 for real Asking for approval: this is a safe optimization to avoid expensive calculations of the line number based on script's pc pointer.
Attachment #311302 - Flags: approval1.9b5?
Attachment #311302 - Flags: approval1.9?
Comment on attachment 311302 [details] [diff] [review] v1 for real a1.9b5=beltzner
Attachment #311302 - Flags: approval1.9b5?
Attachment #311302 - Flags: approval1.9b5+
Attachment #311302 - Flags: approval1.9?
Attachment #311302 - Flags: approval1.9+
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
In the checked in patch I have used // FALL THROUGH. This patch fixes this. I will check it in when the tree will be green.
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: