RESOLVED FIXED 114906
fourthTier: value profiles and array profiles should be thread-safe enough to be accessible in a concurrent compilation thread
https://bugs.webkit.org/show_bug.cgi?id=114906
Summary fourthTier: value profiles and array profiles should be thread-safe enough to...
Filip Pizlo
Reported 2013-04-20 15:22:20 PDT
And all profile updating should happen on the main thread, to make the concurrency model simpler to think about. For example, I don't want to have *storing* into a value profile from JIT code to have to be thread safe enough to handle updates on another thread. So, all updating happens on the main thread, and the concurrent thread just reads out the results and never the stored values.
Attachments
work in progress (72.04 KB, patch)
2013-04-20 15:25 PDT, Filip Pizlo
no flags
work in progress (77.55 KB, patch)
2013-04-20 20:30 PDT, Filip Pizlo
no flags
the patch (78.81 KB, patch)
2013-04-20 20:51 PDT, Filip Pizlo
no flags
the patch (78.67 KB, patch)
2013-04-20 21:38 PDT, Filip Pizlo
oliver: review+
Filip Pizlo
Comment 1 2013-04-20 15:25:52 PDT
Created attachment 198949 [details] work in progress Not yet done because I need to run some benchmarks before declaring victory.
Filip Pizlo
Comment 2 2013-04-20 20:30:39 PDT
Created attachment 198953 [details] work in progress Took a slightly different approach - where profiles can even be updated from the compilation thread.
Filip Pizlo
Comment 3 2013-04-20 20:51:15 PDT
Created attachment 198954 [details] the patch It's neutral on the benchmarks.
Filip Pizlo
Comment 4 2013-04-20 21:12:30 PDT
Benchmark report for SunSpider, V8Spider, Octane, Kraken, and JSRegress on oldmac (MacPro4,1). VMs tested: "TipOfTree" at /Volumes/Data/pizlo/fourthTier/OpenSource/WebKitBuild/Release/jsc (r148801) "LockedProfiles" at /Volumes/Data/fromMiniMe/fourthTier/primary/OpenSource/WebKitBuild/Release/jsc (r148801) Collected 12 samples per benchmark/VM, with 4 VM invocations per benchmark. Emitted a call to gc() between sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence intervals in milliseconds. TipOfTree LockedProfiles SunSpider: 3d-cube 9.3577+-0.1587 ? 9.3742+-0.1582 ? 3d-morph 8.7822+-0.1367 ? 8.8460+-0.1146 ? 3d-raytrace 10.6101+-0.1796 10.4874+-0.1447 might be 1.0117x faster access-binary-trees 1.8903+-0.0075 ? 1.8937+-0.0072 ? access-fannkuch 7.7053+-0.0789 ? 7.8351+-0.1151 ? might be 1.0168x slower access-nbody 4.6971+-0.0189 4.6670+-0.0602 access-nsieve 4.9093+-0.0711 ? 4.9193+-0.0716 ? bitops-3bit-bits-in-byte 1.8557+-0.0140 1.8499+-0.0099 bitops-bits-in-byte 6.9927+-0.1047 ? 7.0584+-0.1035 ? bitops-bitwise-and 2.7573+-0.0829 2.7174+-0.0826 might be 1.0147x faster bitops-nsieve-bits 4.7219+-0.0696 ! 4.7994+-0.0079 ! definitely 1.0164x slower controlflow-recursive 3.1428+-0.0479 3.1409+-0.0463 crypto-aes 7.7837+-0.1504 ? 7.9150+-0.1148 ? might be 1.0169x slower crypto-md5 4.3214+-0.0430 ^ 4.1981+-0.0297 ^ definitely 1.0294x faster crypto-sha1 3.3035+-0.0191 ? 3.3212+-0.0250 ? date-format-tofte 15.2757+-0.1966 15.0819+-0.1917 might be 1.0129x faster date-format-xparb 9.4112+-0.1844 ? 9.5035+-0.2090 ? math-cordic 4.0509+-0.0078 4.0469+-0.0053 math-partial-sums 12.5247+-0.1358 ? 12.5491+-0.1033 ? math-spectral-norm 3.1664+-0.0125 ? 3.1702+-0.0120 ? regexp-dna 12.7820+-0.1697 ? 13.0064+-0.2351 ? might be 1.0176x slower string-base64 5.1199+-0.1657 ? 5.1662+-0.1281 ? string-fasta 10.7759+-0.1193 ? 10.7952+-0.1117 ? string-tagcloud 14.3294+-0.2037 ? 14.3874+-0.1837 ? string-unpack-code 28.2994+-0.3665 27.9547+-0.0960 might be 1.0123x faster string-validate-input 7.3357+-0.1831 ? 7.5019+-0.1488 ? might be 1.0227x slower <arithmetic> * 7.9193+-0.0662 ? 7.9303+-0.0662 ? might be 1.0014x slower <geometric> 6.3772+-0.0480 ? 6.3906+-0.0490 ? might be 1.0021x slower <harmonic> 5.1467+-0.0286 ? 5.1504+-0.0328 ? might be 1.0007x slower TipOfTree LockedProfiles V8Spider: crypto 87.0727+-0.1760 ? 87.2338+-0.1868 ? deltablue 133.9180+-2.4561 132.3694+-0.6398 might be 1.0117x faster earley-boyer 82.9392+-0.3103 ? 83.2783+-0.3546 ? raytrace 61.8696+-0.1141 ? 61.8927+-0.1181 ? regexp 101.8283+-0.5304 101.1703+-0.2126 richards 119.3224+-0.5014 119.0459+-0.6377 splay 48.7945+-0.2703 ? 48.9303+-0.3764 ? <arithmetic> 90.8207+-0.3756 90.5601+-0.1210 might be 1.0029x faster <geometric> * 86.2339+-0.2771 86.0972+-0.1082 might be 1.0016x faster <harmonic> 81.5146+-0.2269 81.4820+-0.1446 might be 1.0004x faster TipOfTree LockedProfiles Octane and V8v7: encrypt 0.46966+-0.00049 ? 0.46999+-0.00085 ? decrypt 8.69318+-0.02709 8.67684+-0.02330 deltablue x2 0.60747+-0.00162 ^ 0.60326+-0.00214 ^ definitely 1.0070x faster earley 0.92214+-0.00462 0.91742+-0.00592 boyer 12.82812+-0.05679 12.77076+-0.03563 raytrace x2 4.43990+-0.01908 ^ 4.40635+-0.01145 ^ definitely 1.0076x faster regexp x2 32.42046+-0.15848 32.18105+-0.12641 richards x2 0.30838+-0.00303 0.30709+-0.00094 splay x2 0.64601+-0.02058 ? 0.64933+-0.02367 ? navier-stokes x2 10.81009+-0.01830 10.80643+-0.02618 closure 0.30599+-0.03470 ? 0.30885+-0.03519 ? jquery 4.39313+-0.54706 4.38684+-0.54681 gbemu x2 251.63448+-17.63160 ? 253.53389+-17.96221 ? box2d x2 31.74139+-0.11422 31.56868+-0.09255 V8v7: <arithmetic> 7.58611+-0.02251 7.54638+-0.01924 might be 1.0053x faster <geometric> * 2.45211+-0.01042 2.44386+-0.01086 might be 1.0034x faster <harmonic> 0.94206+-0.00663 0.93961+-0.00584 might be 1.0026x faster Octane including V8v7: <arithmetic> 31.49221+-1.61600 ? 31.62013+-1.64492 ? might be 1.0041x slower <geometric> * 4.39714+-0.06758 4.38864+-0.06683 might be 1.0019x faster <harmonic> 1.06625+-0.02007 1.06536+-0.01805 might be 1.0008x faster TipOfTree LockedProfiles Kraken: ai-astar 493.797+-0.907 ? 493.813+-0.665 ? audio-beat-detection 245.307+-1.531 ? 246.430+-2.557 ? audio-dft 321.017+-1.564 ? 325.186+-9.934 ? might be 1.0130x slower audio-fft 143.223+-0.221 ? 143.286+-0.387 ? audio-oscillator 234.035+-1.000 233.822+-1.129 imaging-darkroom 292.199+-1.119 ? 293.117+-1.502 ? imaging-desaturate 160.042+-0.174 ? 160.868+-1.159 ? imaging-gaussian-blur 397.468+-0.189 ? 397.713+-0.306 ? json-parse-financial 82.745+-0.655 81.733+-1.090 might be 1.0124x faster json-stringify-tinderbox 101.058+-0.248 100.832+-0.355 stanford-crypto-aes 237.758+-2.359 237.639+-0.929 stanford-crypto-ccm 110.601+-0.319 ! 111.442+-0.180 ! definitely 1.0076x slower stanford-crypto-pbkdf2 272.755+-1.688 ? 275.117+-1.367 ? stanford-crypto-sha256-iterative 115.032+-0.084 ! 116.446+-0.628 ! definitely 1.0123x slower <arithmetic> * 229.074+-0.413 ? 229.817+-0.823 ? might be 1.0032x slower <geometric> 200.281+-0.346 ? 200.829+-0.553 ? might be 1.0027x slower <harmonic> 174.456+-0.309 ? 174.726+-0.425 ? might be 1.0015x slower TipOfTree LockedProfiles JSRegress: adapt-to-double-divide 22.5115+-0.1183 ? 22.8367+-0.3673 ? might be 1.0144x slower aliased-arguments-getbyval 0.9167+-0.0096 ? 0.9213+-0.0119 ? allocate-big-object 2.5469+-0.0329 ? 2.5613+-0.0436 ? arity-mismatch-inlining 0.7642+-0.0276 ? 0.7785+-0.0108 ? might be 1.0187x slower array-access-polymorphic-structure 7.1490+-0.1077 7.0796+-0.1103 array-with-double-add 5.8287+-0.0823 5.8219+-0.0882 array-with-double-increment 4.2004+-0.0982 4.0961+-0.0121 might be 1.0255x faster array-with-double-mul-add 7.1422+-0.0735 7.1165+-0.1043 array-with-double-sum 7.9914+-0.0916 7.8049+-0.1066 might be 1.0239x faster array-with-int32-add-sub 10.4742+-0.1030 10.4641+-0.0868 array-with-int32-or-double-sum 7.9046+-0.0962 ? 8.0475+-0.0973 ? might be 1.0181x slower big-int-mul 4.9826+-0.0485 4.9509+-0.0687 boolean-test 4.4419+-0.0639 4.4191+-0.0609 cast-int-to-double 13.9858+-0.1402 ? 14.2121+-0.2699 ? might be 1.0162x slower cell-argument 14.5162+-0.1737 14.4454+-0.0828 cfg-simplify 3.9474+-0.0744 ? 4.0669+-0.0616 ? might be 1.0303x slower cmpeq-obj-to-obj-other 11.8995+-0.2384 11.5825+-0.1349 might be 1.0274x faster constant-test 8.5458+-0.0976 8.4134+-0.1513 might be 1.0157x faster direct-arguments-getbyval 0.8419+-0.0102 ? 0.8453+-0.0097 ? double-pollution-getbyval 10.7697+-0.0884 10.7130+-0.0797 double-pollution-putbyoffset 4.9124+-0.1097 ? 4.9438+-0.1086 ? empty-string-plus-int 11.0699+-0.1978 10.9891+-0.1770 external-arguments-getbyval 2.2252+-0.0392 2.2166+-0.0309 external-arguments-putbyval 3.3272+-0.0155 ! 3.6172+-0.1346 ! definitely 1.0872x slower Float32Array-matrix-mult 14.2409+-0.1130 14.1045+-0.0893 fold-double-to-int 22.1086+-0.2176 22.0057+-0.1383 function-dot-apply 3.1863+-0.0086 ? 3.1880+-0.0086 ? function-test 5.0413+-0.1051 5.0305+-0.0481 get-by-id-chain-from-try-block 7.4156+-0.1005 7.3976+-0.1091 HashMap-put-get-iterate-keys 96.1600+-0.3957 ? 96.7137+-0.5964 ? HashMap-put-get-iterate 98.0257+-0.4533 ? 98.5038+-0.9235 ? HashMap-string-put-get-iterate 74.4078+-0.6526 74.0775+-0.5569 indexed-properties-in-objects 4.5325+-0.0484 ? 4.5702+-0.0112 ? inline-arguments-access 1.2572+-0.0086 ? 1.2603+-0.0071 ? inline-arguments-local-escape 23.3249+-0.0890 ? 23.3771+-0.1695 ? inline-get-scoped-var 6.5737+-0.0945 ? 6.5918+-0.0952 ? inlined-put-by-id-transition 16.4314+-0.2789 ? 16.6052+-0.2854 ? might be 1.0106x slower int-or-other-abs-then-get-by-val 8.8750+-0.1165 ? 8.9835+-0.0935 ? might be 1.0122x slower int-or-other-abs-zero-then-get-by-val 37.1456+-0.1456 37.1352+-0.1249 int-or-other-add-then-get-by-val 10.2326+-0.0810 ? 10.3169+-0.1187 ? int-or-other-add 10.5211+-0.1136 10.5004+-0.1146 int-or-other-div-then-get-by-val 7.8959+-0.0994 ? 7.9301+-0.1153 ? int-or-other-max-then-get-by-val 10.2085+-0.1291 9.9445+-0.1652 might be 1.0265x faster int-or-other-min-then-get-by-val 8.2387+-0.1020 8.1549+-0.1104 might be 1.0103x faster int-or-other-mod-then-get-by-val 8.0218+-0.1048 8.0214+-0.1037 int-or-other-mul-then-get-by-val 7.2196+-0.0991 7.1165+-0.0972 might be 1.0145x faster int-or-other-neg-then-get-by-val 8.0586+-0.1018 ? 8.1966+-0.1095 ? might be 1.0171x slower int-or-other-neg-zero-then-get-by-val 36.5992+-0.2317 ? 36.9415+-0.3862 ? int-or-other-sub-then-get-by-val 10.2109+-0.1028 ? 10.3554+-0.1703 ? might be 1.0142x slower int-or-other-sub 8.3772+-0.0709 8.2583+-0.1048 might be 1.0144x faster int-overflow-local 12.9395+-0.1211 12.9188+-0.0919 Int16Array-bubble-sort 49.4740+-0.1802 49.4137+-0.1813 Int16Array-load-int-mul 1.8950+-0.0060 ? 1.8966+-0.0063 ? Int8Array-load 4.7644+-0.0826 ! 4.8862+-0.0067 ! definitely 1.0256x slower integer-divide 15.2369+-0.1459 15.1727+-0.1013 integer-modulo 2.1033+-0.0167 ? 2.1119+-0.0163 ? make-indexed-storage 3.9162+-0.0407 ? 3.9443+-0.0416 ? method-on-number 23.6398+-0.3938 23.5764+-0.3127 nested-function-parsing-random 384.1489+-14.0031 381.4000+-12.6213 nested-function-parsing 47.6256+-1.1361 47.5545+-1.0828 new-array-buffer-dead 3.6394+-0.0126 3.6325+-0.0103 new-array-buffer-push 10.6630+-0.1637 10.4388+-0.1406 might be 1.0215x faster new-array-dead 28.3626+-0.0896 28.2999+-0.0815 new-array-push 6.8813+-0.1150 ? 7.0085+-0.0714 ? might be 1.0185x slower number-test 4.3281+-0.0527 4.3227+-0.0551 object-closure-call 8.3257+-0.1124 ? 8.3591+-0.1050 ? object-test 4.8104+-0.0763 ? 4.9217+-0.0508 ? might be 1.0231x slower poly-stricteq 92.6247+-1.4788 91.2503+-0.4066 might be 1.0151x faster polymorphic-structure 20.1684+-0.3911 20.0360+-0.0805 polyvariant-monomorphic-get-by-id 12.5449+-0.0906 12.4562+-0.0919 rare-osr-exit-on-local 20.5387+-0.0891 ? 20.6179+-0.1056 ? register-pressure-from-osr 31.7010+-0.1677 31.5039+-0.1150 simple-activation-demo 34.4688+-0.1186 ? 34.4741+-0.1295 ? slow-array-profile-convergence 4.3041+-0.0125 ! 4.3564+-0.0215 ! definitely 1.0121x slower slow-convergence 3.8257+-0.0237 3.8245+-0.0044 sparse-conditional 1.3387+-0.0086 1.3318+-0.0112 splice-to-remove 50.8234+-0.2336 ! 52.1715+-0.3243 ! definitely 1.0265x slower string-concat-object 2.7553+-0.0461 2.7442+-0.0173 string-concat-pair-object 2.6758+-0.0558 2.6701+-0.0116 string-concat-pair-simple 17.1965+-0.2963 17.1176+-0.3033 string-concat-simple 17.2186+-0.3233 ? 17.5491+-0.2397 ? might be 1.0192x slower string-cons-repeat 10.1143+-0.0266 ? 10.1491+-0.0342 ? string-cons-tower 11.2223+-0.3118 10.9818+-0.0342 might be 1.0219x faster string-equality 104.7659+-0.1691 ? 105.4687+-1.2385 ? string-hash 2.6622+-0.0097 ? 2.6650+-0.0102 ? string-repeat-arith 47.1502+-0.1759 47.1080+-0.4356 string-sub 91.8966+-1.1900 91.0326+-0.5131 string-test 4.2904+-0.0264 4.2878+-0.0383 structure-hoist-over-transitions 3.2757+-0.0258 ? 3.2958+-0.0287 ? tear-off-arguments-simple 1.7888+-0.0102 ? 1.8200+-0.0309 ? might be 1.0174x slower tear-off-arguments 3.4013+-0.0100 3.3993+-0.0085 temporal-structure 20.8644+-0.1324 ? 20.9519+-0.1212 ? to-int32-boolean 30.6383+-0.1004 30.6357+-0.1210 undefined-test 4.5353+-0.0534 ? 4.5646+-0.0349 ? <arithmetic> 21.0505+-0.1640 21.0271+-0.1503 might be 1.0011x faster <geometric> * 9.4526+-0.0282 ? 9.4663+-0.0213 ? might be 1.0014x slower <harmonic> 5.2016+-0.0251 ? 5.2246+-0.0170 ? might be 1.0044x slower TipOfTree LockedProfiles All benchmarks: <arithmetic> 41.2286+-0.3342 ? 41.2867+-0.3438 ? might be 1.0014x slower <geometric> 11.4432+-0.0570 ? 11.4554+-0.0521 ? might be 1.0011x slower <harmonic> 3.7104+-0.0353 ? 3.7161+-0.0315 ? might be 1.0015x slower TipOfTree LockedProfiles Geomean of preferred means: <scaled-result> 23.0461+-0.1342 ? 23.0578+-0.1279 ? might be 1.0005x slower
Filip Pizlo
Comment 5 2013-04-20 21:38:23 PDT
Created attachment 198955 [details] the patch Fixed the changelog.
Filip Pizlo
Comment 6 2013-04-20 22:12:58 PDT
Note You need to log in before you can comment on or make changes to this bug.