Closed
Bug 609121
Opened 14 years ago
Closed 14 years ago
nanojit: handle small immediates specially in CseFilter
Categories
(Core Graveyard :: Nanojit, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
(Whiteboard: fixed-in-nanojit,fixed-in-tracemonkey,fixed-in-tamarin)
Attachments
(2 files, 1 obsolete file)
22.74 KB,
patch
|
wmaddox
:
review+
|
Details | Diff | Splinter Review |
321.87 KB,
text/plain
|
Details |
More than half of all int immediates used in TraceMonkey code are in the range 0..16. This patch modifies CseFilter to not hash such immediates but just put them directly in an array of size 17. It also changes the prefix of the NLKind values from "LIns" to "NL". It's a small win for TM on SunSpider with just the tracejit (with the methodjit and profiling on not much gets trace in SunSpider any more), so it seems worth doing. --------------------------------------------------------------- | millions of instructions executed | | total | on-trace (may overestimate) | --------------------------------------------------------------- | 77.651 77.589 (1.001x) | 22.612 22.613 (------) | 3d-cube | 39.294 39.292 (------) | 22.697 22.697 (------) | 3d-morph | 167.387 167.128 (1.002x) | 15.699 15.703 (------) | 3d-raytrace | 130.527 130.522 (------) | 538033 538072 (------) | access-binary- | 85.137 85.119 (------) | 75.983 75.983 (------) | access-fannkuc | 27.636 27.635 (------) | 15.194 15.194 (------) | access-nbody | 34.513 34.513 (------) | 23.344 23.344 (------) | access-nsieve | 7.010 7.009 (------) | 2.858 2.858 (------) | bitops-3bit-bi | 34.367 34.366 (------) | 30.097 30.097 (------) | bitops-bits-in | 14.072 14.072 (------) | 10.215 10.215 (------) | bitops-bitwise | 36.823 36.822 (------) | 31.634 31.634 (------) | bitops-nsieve- | 149.070 149.070 (------) | 0 0 (------) | controlflow-re | 64.895 64.824 (1.001x) | 27.033 27.035 (------) | crypto-aes | 33.184 33.012 (1.005x) | 4.379 4.379 (------) | crypto-md5 | 19.163 19.132 (1.002x) | 6.316 6.317 (------) | crypto-sha1 | 99.536 99.534 (------) | 11.670 11.670 (------) | date-format-to | 69.422 69.374 (1.001x) | 9.548 9.550 (------) | date-format-xp | 42.244 42.243 (------) | 28.679 28.679 (------) | math-cordic | 22.382 22.381 (------) | 6.158 6.158 (------) | math-partial-s | 21.469 21.459 (------) | 13.188 13.188 (------) | math-spectral- | 49.359 49.358 (------) | 34.579 34.579 (------) | regexp-dna | 29.161 29.159 (------) | 9.067 9.067 (------) | string-base64 | 84.494 84.490 (------) | 23.533 23.533 (------) | string-fasta | 143.171 143.169 (------) | 12.273 12.273 (------) | string-tagclou | 128.437 128.436 (------) | 7.663 7.664 (------) | string-unpack- | 43.204 43.201 (------) | 8.220 8.221 (------) | string-validat ------- | 1653.623 1652.922 (------) | 453.206 453.220 (------) | all
Attachment #487708 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #487708 -
Flags: review? → review?(edwsmith)
Assignee | ||
Comment 1•14 years ago
|
||
Oh, and something that's been bugging me for a while: LirBuffer::_bytesAllocated is always zero, so LirBuffer::bytesCount() is wrong. Both of those members are dead so this patch removes them.
Attachment #487708 -
Attachment is obsolete: true
Attachment #487712 -
Flags: review?(edwsmith)
Attachment #487708 -
Flags: review?(edwsmith)
Comment 2•14 years ago
|
||
Comment on attachment 487712 [details] [diff] [review] patch, v2 (against TM 56615:2098bd53381e) The prior table size was 128, the new size is 64 + 17, just curious if you had some data which prompted the shrinkage. BTW byteCount is used by TR via CodegenLIR, but if its wrong lets remove it unless the fix is trivial.
Assignee | ||
Comment 3•14 years ago
|
||
(In reply to comment #2) > > The prior table size was 128, the new size is 64 + 17, just curious if you had > some data which prompted the shrinkage. IIRC Cachegrind told me that reducing to 64 was a tiny bit better. > BTW byteCount is used by TR via CodegenLIR, but if its wrong lets remove it > unless the fix is trivial. It's only used for profiling dumps, AFAICT.
Comment 4•14 years ago
|
||
Comment on attachment 487712 [details] [diff] [review] patch, v2 (against TM 56615:2098bd53381e) I need to delegate the review since I'm travelling this week. The only part I'm curious about is what the range of small constants is used by TR.
Attachment #487712 -
Flags: review?(edwsmith) → review?(wmaddox)
Comment 5•14 years ago
|
||
I instrumented nanojit in TR and collected some data on integer constants presented to CSE when running the performance test suite. I omitted the microbenchmarks in the hope that the results might be more representative of real applications. The results show that integer constant values cluster in the [0,15] range. It may be reasonable to consider expanding the range of "direct-mapped" values, but the cost of clearing the tables at labels would have to be considered. We might revisit the choice of small integer if we implemented a constant-time invalidation scheme.
Comment 6•14 years ago
|
||
Comment on attachment 487712 [details] [diff] [review] patch, v2 (against TM 56615:2098bd53381e) Looks good. R+
Attachment #487712 -
Flags: review?(wmaddox) → review+
Assignee | ||
Comment 7•14 years ago
|
||
(In reply to comment #5) > We might revisit the choice of small integer if we implemented a constant-time > invalidation scheme. Any thoughts on what a constant-time invalidation scheme would look like?
Comment 8•14 years ago
|
||
(In reply to comment #7) > Any thoughts on what a constant-time invalidation scheme would look like? The standard way would be with a timestamp that gets incremented to invalidate the table. Each entry is tagged with the timestamp at which it was created, and which is checked on access. This is beneficial for tables that are cleared frequently, but sparsely populated and accessed between clears. See the following patch for a version of the nanojit HashMap that uses this scheme: https://bugzilla.mozilla.org/attachment.cgi?id=465838&action=diff
Assignee | ||
Comment 9•14 years ago
|
||
http://hg.mozilla.org/projects/nanojit-central/rev/04d7771f3f85 http://hg.mozilla.org/tracemonkey/rev/993c90c046ff
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey
Comment 10•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/993c90c046ff
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey → fixed-in-nanojit,fixed-in-tracemonkey,fixed-in-tamarin
Updated•10 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•