Bug 196943 - Add a baseline tracelet JIT
Summary: Add a baseline tracelet JIT
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on: 197394
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-15 15:24 PDT by Saam Barati
Modified: 2020-03-20 07:28 PDT (History)
17 users (show)

See Also:


Attachments
WIP (10.17 KB, patch)
2019-04-17 19:08 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (42.60 KB, patch)
2019-04-18 15:57 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (51.01 KB, patch)
2019-04-22 12:48 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (63.28 KB, patch)
2019-04-22 17:05 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (129.20 KB, patch)
2019-04-22 19:53 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (135.18 KB, patch)
2019-04-25 17:46 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (139.74 KB, patch)
2019-04-25 20:34 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (140.97 KB, patch)
2019-04-26 15:00 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (144.19 KB, patch)
2019-04-26 16:01 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (146.42 KB, patch)
2019-04-26 17:19 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (146.50 KB, patch)
2019-04-26 18:36 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (154.87 KB, patch)
2019-04-29 15:52 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (158.84 KB, patch)
2019-04-29 18:30 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (158.81 KB, patch)
2019-04-29 18:48 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (103.35 KB, patch)
2019-04-30 18:21 PDT, Saam Barati
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-highsierra (3.26 MB, application/zip)
2019-05-01 04:18 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews105 for mac-highsierra-wk2 (2.81 MB, application/zip)
2019-05-01 04:30 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-wk2 (8.36 MB, application/zip)
2019-05-01 05:15 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-highsierra (4.07 MB, application/zip)
2019-05-01 05:25 PDT, EWS Watchlist
no flags Details
WIP (102.58 KB, patch)
2019-05-01 20:07 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (103.97 KB, patch)
2019-05-01 23:36 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (103.96 KB, patch)
2019-05-06 14:55 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (108.37 KB, patch)
2019-05-08 18:14 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (108.95 KB, patch)
2019-05-08 18:47 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (112.00 KB, patch)
2019-05-09 12:44 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (151.02 KB, patch)
2019-05-09 18:11 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (154.38 KB, patch)
2019-05-10 12:32 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (155.97 KB, patch)
2019-05-10 15:14 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (155.84 KB, patch)
2019-05-13 13:10 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (157.68 KB, patch)
2019-05-13 15:41 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (158.58 KB, patch)
2019-05-16 18:11 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (158.58 KB, patch)
2019-05-21 18:09 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2019-04-15 15:24:38 PDT
It would allow us to
1. Compile parts of a function in the baseline JIT more quickly. We could have super low tier up counts for a tracelet.
2. allow those parts to get the benefits the baseline JIT gives us: ICs, no dispatch overhead

If we find this is a successful avenue, extending this to the DFG could be a next step.

tracelet-DFG could be optimized to be a single basic block, with "jumps" that end up going outside of it. We'd probably want to modify what kind of optimizations we did in such a compiler to allow us to compile very quickly.
Comment 1 Radar WebKit Bug Importer 2019-04-15 15:25:41 PDT
<rdar://problem/49920297>
Comment 2 Saam Barati 2019-04-17 19:08:08 PDT
Created attachment 367712 [details]
WIP

it begins
Comment 3 Saam Barati 2019-04-18 15:57:19 PDT
Created attachment 367768 [details]
WIP
Comment 4 Saam Barati 2019-04-22 12:48:28 PDT
Created attachment 367960 [details]
WIP
Comment 5 Saam Barati 2019-04-22 17:05:29 PDT
Created attachment 367998 [details]
WIP

It can now (at least one program) with traces, although things are quite dumb at the moment and there are probably many bugs.

Gonna start to work on the mechanics of the data structures that represent traces, the JITCode we will use, etc.

Once that's rock solid and makes sense, I will work on tuning the perf and intelligently placing down trace_profile. Currently, the heuristic I dropped into bytecode generator generates way too many trace_profile ops.
Comment 6 Saam Barati 2019-04-22 19:53:26 PDT
Created attachment 368007 [details]
WIP
Comment 7 Saam Barati 2019-04-25 17:46:35 PDT
Created attachment 368292 [details]
WIP
Comment 8 Saam Barati 2019-04-25 20:34:38 PDT
Created attachment 368299 [details]
WIP

Got some fun crashers going on.
Comment 9 Saam Barati 2019-04-26 14:49:12 PDT
Comment on attachment 368299 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=368299&action=review

> Source/JavaScriptCore/jit/JITCode.h:240
> +    CodeRef<JSEntryPtrTag> ref() { return m_ref; }

this was my issue! Oops. Naming functions ref() when something is RefCounted is a bad idea :-)
Comment 10 Saam Barati 2019-04-26 15:00:21 PDT
Created attachment 368355 [details]
WIP
Comment 11 Saam Barati 2019-04-26 16:01:58 PDT
Created attachment 368357 [details]
WIP
Comment 12 Saam Barati 2019-04-26 17:19:07 PDT
Created attachment 368369 [details]
WIP

Things seem to be working (with DFG disabled)
Comment 13 Saam Barati 2019-04-26 18:36:14 PDT
Created attachment 368379 [details]
WIP
Comment 14 Saam Barati 2019-04-29 15:52:44 PDT
Created attachment 368505 [details]
WIP
Comment 15 Saam Barati 2019-04-29 18:30:51 PDT
Created attachment 368525 [details]
WIP

seems to be starting to pass (most/all?) tests.
Comment 16 Saam Barati 2019-04-29 18:48:43 PDT
Created attachment 368527 [details]
WIP

Tests are passing. Gonna do some cleanup and start working on perf.
Comment 17 Saam Barati 2019-04-30 18:21:52 PDT
Created attachment 368640 [details]
WIP
Comment 18 EWS Watchlist 2019-05-01 02:57:46 PDT
Attachment 368640 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/jit/ExecutableAllocator.cpp:163:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/ExecutableAllocator.cpp:165:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:39:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:40:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:41:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:42:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:47:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:48:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:49:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.cpp:50:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCode.h:276:  The parameter name "entry" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/jit/JITCode.h:287:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.cpp:1090:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.h:926:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:44:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:60:  Bad include order. Mixing system and custom headers.  [build/include_order] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:201:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:300:  Non-label code inside switch statements should be indented.  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:308:  Almost always, snprintf is better than strcat.  [security/printf] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:842:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:851:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:857:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:863:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:869:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:870:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:879:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:896:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:912:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:978:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:981:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1073:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1121:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1122:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1124:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1125:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1126:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1154:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1167:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1171:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JIT.cpp:1307:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:312:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:313:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:316:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:317:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:318:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/CodeBlock.h:321:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/runtime/ScriptExecutable.cpp:187:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/runtime/ScriptExecutable.cpp:188:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/runtime/ScriptExecutable.cpp:189:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/runtime/ScriptExecutable.cpp:190:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:522:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:2000:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:2014:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:2019:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITInlines.h:250:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITWorklist.cpp:240:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/jit/JITCodeMap.h:61:  Missing space inside { }.  [whitespace/braces] [5]
ERROR: Source/JavaScriptCore/jit/JITCodeMap.h:96:  Should have a space between // and comment  [whitespace/comments] [4]
Total errors found: 58 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 19 EWS Watchlist 2019-05-01 04:18:34 PDT
Comment on attachment 368640 [details]
WIP

Attachment 368640 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12050413

New failing tests:
js/dfg-double-vote-fuzz.html
workers/bomb.html
js/slow-stress/emscripten-memops.html
Comment 20 EWS Watchlist 2019-05-01 04:18:36 PDT
Created attachment 368658 [details]
Archive of layout-test-results from ews102 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 21 EWS Watchlist 2019-05-01 04:30:17 PDT
Comment on attachment 368640 [details]
WIP

Attachment 368640 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12050420

New failing tests:
js/dfg-double-vote-fuzz.html
js/slow-stress/emscripten-memops.html
Comment 22 EWS Watchlist 2019-05-01 04:30:19 PDT
Created attachment 368660 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 23 EWS Watchlist 2019-05-01 05:15:10 PDT
Comment on attachment 368640 [details]
WIP

Attachment 368640 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/12050486

New failing tests:
js/dfg-double-vote-fuzz.html
js/slow-stress/emscripten-memops.html
Comment 24 EWS Watchlist 2019-05-01 05:15:12 PDT
Created attachment 368662 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.14.4
Comment 25 EWS Watchlist 2019-05-01 05:25:43 PDT
Comment on attachment 368640 [details]
WIP

Attachment 368640 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12050499

New failing tests:
js/dfg-double-vote-fuzz.html
js/slow-stress/marsaglia.html
fast/canvas/webgl/uninitialized-test.html
webgl/2.0.0/conformance2/textures/image_data/tex-3d-rgb8-rgb-unsigned_byte.html
webgl/1.0.2/conformance/misc/uninitialized-test.html
webgl/2.0.0/conformance/misc/uninitialized-test.html
Comment 26 EWS Watchlist 2019-05-01 05:25:45 PDT
Created attachment 368664 [details]
Archive of layout-test-results from ews114 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 27 EWS Watchlist 2019-05-01 06:04:53 PDT
Comment on attachment 368640 [details]
WIP

Attachment 368640 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12050522

New failing tests:
wasm.yaml/wasm/lowExecutableMemory/exports-oom.js.default-wasm
wasm.yaml/wasm/lowExecutableMemory/executable-memory-oom.js.default-wasm
jsc-layout-tests.yaml/js/script-tests/dfg-double-vote-fuzz.js.layout-no-ftl
jsc-layout-tests.yaml/js/script-tests/dfg-ensure-contiguous-on-string.js.layout-ftl-eager-no-cjit
wasm.yaml/wasm/lowExecutableMemory/imports-oom.js.default-wasm
jsc-layout-tests.yaml/js/script-tests/dfg-ensure-contiguous-on-string.js.layout-dfg-eager-no-cjit
Comment 28 Saam Barati 2019-05-01 20:07:20 PDT
Created attachment 368754 [details]
WIP
Comment 29 Saam Barati 2019-05-01 23:36:17 PDT
Created attachment 368767 [details]
WIP
Comment 30 Saam Barati 2019-05-06 14:55:47 PDT
Created attachment 369170 [details]
WIP
Comment 31 Saam Barati 2019-05-08 18:14:46 PDT
Created attachment 369453 [details]
WIP
Comment 32 Saam Barati 2019-05-08 18:47:58 PDT
Created attachment 369455 [details]
patch
Comment 33 Saam Barati 2019-05-09 12:44:44 PDT
Created attachment 369515 [details]
WIP
Comment 34 Saam Barati 2019-05-09 18:11:48 PDT
Created attachment 369535 [details]
WIP
Comment 35 Saam Barati 2019-05-10 12:32:12 PDT
Created attachment 369581 [details]
WIP
Comment 36 Saam Barati 2019-05-10 15:14:49 PDT
Created attachment 369607 [details]
WIP
Comment 37 Saam Barati 2019-05-13 13:10:44 PDT
Created attachment 369770 [details]
WIP

rebased
Comment 38 Saam Barati 2019-05-13 15:41:45 PDT
Created attachment 369792 [details]
WIP
Comment 39 Saam Barati 2019-05-13 19:32:25 PDT
Perf not looking great so far. Continuing to investigate why it's slower.

- It seems neutral on JS2 when baseline JIT is the final tier.
- It's a slow down when enabling DFG/FTL. Seems like it shouldn't be too hard to find out why.
- Initial testing shows it's a PLT slow down too
Comment 40 Saam Barati 2019-05-13 19:56:26 PDT
(In reply to Saam Barati from comment #39)
> Perf not looking great so far. Continuing to investigate why it's slower.
> 
> - It seems neutral on JS2 when baseline JIT is the final tier.
> - It's a slow down when enabling DFG/FTL. Seems like it shouldn't be too
> hard to find out why.
> - Initial testing shows it's a PLT slow down too

It seems my PLT regression is same as JS2 being regressed with DFG turned on. I need to look into why I made the DFG slower.
Comment 41 Filip Pizlo 2019-05-13 20:11:14 PDT
(In reply to Saam Barati from comment #40)
> (In reply to Saam Barati from comment #39)
> > Perf not looking great so far. Continuing to investigate why it's slower.
> > 
> > - It seems neutral on JS2 when baseline JIT is the final tier.
> > - It's a slow down when enabling DFG/FTL. Seems like it shouldn't be too
> > hard to find out why.
> > - Initial testing shows it's a PLT slow down too
> 
> It seems my PLT regression is same as JS2 being regressed with DFG turned
> on. I need to look into why I made the DFG slower.

I think that if I was you, I’d stop running dog or FTL at all until you got the traveler-baseline to outperform baseline in some way and get to completely neutral versus baseline. The progression could even just be memory usage. 

I think it’s just useful to know from a strategy standpoint if we should be pursuing this at all, and if so, towards what end. It could become a different beast if the only benefit was memory.
Comment 42 Filip Pizlo 2019-05-13 20:11:37 PDT
(In reply to Filip Pizlo from comment #41)
> (In reply to Saam Barati from comment #40)
> > (In reply to Saam Barati from comment #39)
> > > Perf not looking great so far. Continuing to investigate why it's slower.
> > > 
> > > - It seems neutral on JS2 when baseline JIT is the final tier.
> > > - It's a slow down when enabling DFG/FTL. Seems like it shouldn't be too
> > > hard to find out why.
> > > - Initial testing shows it's a PLT slow down too
> > 
> > It seems my PLT regression is same as JS2 being regressed with DFG turned
> > on. I need to look into why I made the DFG slower.
> 
> I think that if I was you, I’d stop running dog or FTL at all until you got

Lol I meant DFG. 

> the traveler-baseline to outperform baseline in some way and get to
> completely neutral versus baseline. The progression could even just be
> memory usage. 
> 
> I think it’s just useful to know from a strategy standpoint if we should be
> pursuing this at all, and if so, towards what end. It could become a
> different beast if the only benefit was memory.
Comment 43 Filip Pizlo 2019-05-13 20:12:24 PDT
(In reply to Filip Pizlo from comment #42)
> (In reply to Filip Pizlo from comment #41)
> > (In reply to Saam Barati from comment #40)
> > > (In reply to Saam Barati from comment #39)
> > > > Perf not looking great so far. Continuing to investigate why it's slower.
> > > > 
> > > > - It seems neutral on JS2 when baseline JIT is the final tier.
> > > > - It's a slow down when enabling DFG/FTL. Seems like it shouldn't be too
> > > > hard to find out why.
> > > > - Initial testing shows it's a PLT slow down too
> > > 
> > > It seems my PLT regression is same as JS2 being regressed with DFG turned
> > > on. I need to look into why I made the DFG slower.
> > 
> > I think that if I was you, I’d stop running dog or FTL at all until you got
> 
> Lol I meant DFG. 
> 
> > the traveler-baseline to outperform baseline in some way and get to

Omg autocorrect. I meant tracelet-baseline. 

> > completely neutral versus baseline. The progression could even just be
> > memory usage. 
> > 
> > I think it’s just useful to know from a strategy standpoint if we should be
> > pursuing this at all, and if so, towards what end. It could become a
> > different beast if the only benefit was memory.
Comment 44 Geoffrey Garen 2019-05-14 09:30:39 PDT
I would expect tracelet-baseline to beat baseline on JS2-latency, PLT, or JSBench.

Would also be interesting to try:

(a) Significantly reducing the tier-up threshold for tracelet-baseline;

(b) Writing some cooked benchmarks with big functions that try to prove the value of tracelet-baseline.
Comment 45 Filip Pizlo 2019-05-14 10:02:46 PDT
(In reply to Geoffrey Garen from comment #44)
> I would expect tracelet-baseline to beat baseline on JS2-latency, PLT, or
> JSBench.
> 
> Would also be interesting to try:
> 
> (a) Significantly reducing the tier-up threshold for tracelet-baseline;
> 
> (b) Writing some cooked benchmarks with big functions that try to prove the
> value of tracelet-baseline.

That’s what we expected, too. But it’s been in this state - no progression - for a week or two now. Saam could tell more details. 

One part that stood out to me is that this gets less benefit from concurrent JITing because the concurrent JIT seems to work better at larger granularity.
Comment 46 Geoffrey Garen 2019-05-14 10:12:39 PDT
Maybe try compiling small / all tracelets synchronously?
Comment 47 Filip Pizlo 2019-05-14 10:22:12 PDT
(In reply to Geoffrey Garen from comment #46)
> Maybe try compiling small / all tracelets synchronously?

I think Saam did that. :-)

Problem is, then the cost of compiling that code is paid by the main thread. That could explain the lack of a progression.
Comment 48 Saam Barati 2019-05-14 14:50:12 PDT
(In reply to Filip Pizlo from comment #41)
> (In reply to Saam Barati from comment #40)
> > (In reply to Saam Barati from comment #39)
> > > Perf not looking great so far. Continuing to investigate why it's slower.
> > > 
> > > - It seems neutral on JS2 when baseline JIT is the final tier.
> > > - It's a slow down when enabling DFG/FTL. Seems like it shouldn't be too
> > > hard to find out why.
> > > - Initial testing shows it's a PLT slow down too
> > 
> > It seems my PLT regression is same as JS2 being regressed with DFG turned
> > on. I need to look into why I made the DFG slower.
> 
> I think that if I was you, I’d stop running dog or FTL at all until you got
> the traveler-baseline to outperform baseline in some way and get to
> completely neutral versus baseline. The progression could even just be
> memory usage. 
> 
> I think it’s just useful to know from a strategy standpoint if we should be
> pursuing this at all, and if so, towards what end. It could become a
> different beast if the only benefit was memory.

Yeah I've spent most of my time measuring with the DFG disabled both on baseline and tracelet. However, I enabled the DFG just to make sure I didn't regress stuff there. Which it's quite apparent that I have. It's almost certainly something that's fixable. And I'll focus on making baseline-only faster for now.

With DFG disabled, my testing already shows that it's neutral. I haven't measure memory usage. I'm still trying to get it to be faster, so I'm working on that now for PLT5. If we decide to tune it for memory instead of perf, I'd change our tier up thresholds to be more conservative than I have now.
Comment 49 Saam Barati 2019-05-14 14:50:42 PDT
(In reply to Filip Pizlo from comment #47)
> (In reply to Geoffrey Garen from comment #46)
> > Maybe try compiling small / all tracelets synchronously?
> 
> I think Saam did that. :-)
> 
> Problem is, then the cost of compiling that code is paid by the main thread.
> That could explain the lack of a progression.

I only tried compiling *everything* synchronously instead of just small tracelets. It might be worth experimenting with this more.
Comment 50 Saam Barati 2019-05-16 18:11:53 PDT
Created attachment 370097 [details]
WIP

stashing away patch here. Probably has some fun logging in it atm.
Comment 51 Geoffrey Garen 2019-05-20 11:03:17 PDT
> I only tried compiling *everything* synchronously instead of just small
> tracelets. It might be worth experimenting with this more.

That's an interesting detail. I'll leave it to y'all to decide how much experimentation we want to do in this area -- but I think this would be a really interesting thing to try.

My theory: If you know you're about to execute a snippet of code, JIT compiling the snippet and then executing it doesn't have much overhead. The interpreter would have iterated and decoded all those opcodes anyway, and the amount of JIT code emitted isn't enough to trigger memory pathologies. So, a simple strategy that said "this is my second trip through this basic block / extended basic block / loop / whatever, I'll compile just what I'm about to run" seems like it might be a win.
Comment 52 Saam Barati 2019-05-21 18:09:54 PDT
Created attachment 370364 [details]
WIP

Leaving this here as I'm reverting these changes away locally