Profiling Sand dancer

I’ve profiled a complete play through of Sand dancer now. Here are the top functions (many are broken in to several parts). I was surprised at some of them. It looks like probably 20% of the overall processing time is being spent checking if properties exist. And a third is being spent calling and returning from I6 functions.

So function acceleration would certainly help. Would it be feasible to try to detect them through pattern matching? Edit: I think it will be, but it will also be easier to specifically ask for acceleration… that would require less changes to Gnusto.

[code]Profile (685222.798ms, 91122603 calls)

Function Calls Percent Own Time Time Avg Min Max File
ge_func_return 9514438 20.8% 142522.124ms 143149.129ms 0.015ms 0.003ms 745.02ms gnusto-engine.js (line 3251)
ge_gosub 9514452 12.31% 84355.079ms 84355.079ms 0.009ms 0.002ms 12.708ms gnusto-engine.js (line 2880)
ge_run 7948 10.63% 72846.097ms 724062.401ms 91.1ms 0.006ms 2736.508ms gnusto-engine.js (line 1787)
ge_property_search 3248091 7.54% 51643.258ms 55530.739ms 0.017ms 0.003ms 514.547ms gnusto-engine.js (line 3449)
JIT_2eab9_191161_ScanPropertyMetadata 1381635 1.86% 12748.754ms 17093.933ms 0.012ms 0.007ms 476.069ms 348 (line 2)
JIT_2ea42_191042_WhetherProvides 531525 1.79% 12278.206ms 18155.361ms 0.034ms 0.01ms 505.812ms 347 (line 2)
JIT_10389_66441_OC__Cl 875307 1.55% 10589.55ms 11953.571ms 0.014ms 0.004ms 3.193ms 119 (line 2)
JIT_2ea57_191063_WhetherProvides 528471 1.35% 9227.427ms 14317.473ms 0.027ms 0.007ms 498.516ms 390 (line 2)
JIT_45686_284294_Z__Region 556301 1.3% 8882.198ms 20800.328ms 0.037ms 0.007ms 514.732ms 339 (line 2)
JIT_45061_282721_OP__Pr 730439 1.17% 8012.402ms 8012.402ms 0.011ms 0.005ms 2.4ms 102 (line 2)
JIT_2ea5e_191070_WhetherProvides 528471 1.14% 7833.934ms 26457.771ms 0.05ms 0.023ms 514.662ms 391 (line 2)
JIT_2ea68_191080_WhetherProvides 325655 1.11% 7609.177ms 10996.092ms 0.034ms 0.004ms 504.904ms 546 (line 2)
JIT_44fcf_282575_RA__Pr 1092577 1.01% 6954.031ms 9757.686ms 0.009ms 0.001ms 452.069ms 117 (line 2)
JIT_45095_282773_OP__Pr 730355 0.91% 6238.814ms 21669.073ms 0.03ms 0.004ms 505.48ms 103 (line 2)
JIT_2eabc_191164_ScanPropertyMetadata 998821 0.88% 6017.092ms 6153.162ms 0.006ms 0.004ms 2.054ms 388 (line 2)
ge_getUnsignedWord 4943974 0.87% 5948.677ms 5948.677ms 0.001ms 0ms 2.853ms gnusto-engine.js (line 2398)
JIT_103a9_66473_OC__Cl 450228 0.86% 5869.736ms 15405.177ms 0.034ms 0.001ms 498.284ms 121 (line 2)
JIT_10411_66577_Unsigned__Compare 589025 0.82% 5600.99ms 5677.403ms 0.01ms 0.004ms 1.846ms 337 (line 2)
ge_setWord 6152397 0.74% 5093.516ms 5093.516ms 0.001ms 0ms 2.38ms gnusto-engine.js (line 2412)
JIT_45671_284273_Z__Region 556633 0.68% 4628.968ms 8106.663ms 0.015ms 0.008ms 408.568ms 336 (line 2)
JIT_16643_91715_DoScopeActionAndRecurse 137354 0.65% 4468.166ms 6188.66ms 0.045ms 0.01ms 511.071ms 266 (line 2)
JIT_2eaee_191214_GetEitherOrProperty 487087 0.58% 3985.274ms 14973.903ms 0.031ms 0.012ms 507.407ms 393 (line 2)
JIT_103cc_66508_OC__Cl 410637 0.55% 3742.557ms 5594.066ms 0.014ms 0.007ms 4.134ms 122 (line 2)
JIT_456ce_284366_Meta__class 536615 0.54% 3673.674ms 6696.634ms 0.012ms 0.009ms 1.464ms 342 (line 2)
JIT_3c36b_246635_BlkSize 506846 0.53% 3631.159ms 3631.159ms 0.007ms 0.006ms 2.322ms 55 (line 2)
JIT_2ea13_190995_WhetherProvides 531525 0.51% 3471.883ms 3471.883ms 0.007ms 0ms 4.437ms 345 (line 2)
JIT_2eae4_191204_GetEitherOrProperty 487087 0.49% 3331.671ms 8126.895ms 0.017ms 0.01ms 483.144ms 385 (line 2)
JIT_2eebf_192191_ProcessRulebook 223030 0.47% 3224.614ms 3403ms 0.015ms 0.01ms 2.35ms 10 (line 2)
JIT_1664e_91726_DoScopeActionAndRecurse 137354 0.46% 3177.071ms 4434.655ms 0.032ms 0.001ms 500.553ms 267 (line 2)
JIT_44fe5_282597_RA__Pr 1092577 0.46% 3122.859ms 3122.859ms 0.003ms 0.002ms 4.326ms 116 (line 2)
JIT_2ea07_190983_WhetherProvides 531525 0.45% 3081.479ms 3081.479ms 0.006ms 0.004ms 1.974ms 344 (line 2)
ge_get_prop 1653649 0.44% 3011.21ms 34992.497ms 0.021ms 0.004ms 514.564ms gnusto-engine.js (line 3382)
JIT_2fd44_195908_TableRowIsBlank 134220 0.44% 2981.526ms 4351.928ms 0.032ms 0.006ms 763.238ms 617 (line 2)
JIT_16681_91777_DoScopeActionAndRecurse 143135 0.42% 2898.631ms 4274.398ms 0.03ms 0.007ms 502.956ms 287 (line 2)
JIT_2ead9_191193_GetEitherOrProperty 487087 0.41% 2822.173ms 2822.173ms 0.006ms 0.004ms 1.42ms 384 (line 2)
JIT_456b9_284345_Meta__class 539728 0.39% 2666.193ms 5174.765ms 0.01ms 0.006ms 506.608ms 335 (line 2)
JIT_2ea34_191028_WhetherProvides 530190 0.39% 2639.113ms 2639.113ms 0.005ms 0.004ms 1.556ms 387 (line 2)
JIT_44fc8_282568_RA__Pr 291008 0.37% 2514.855ms 8805.131ms 0.03ms 0.013ms 498.946ms 115 (line 2)
JIT_16636_91702_DoScopeActionAndRecurse 143135 0.35% 2417.408ms 4187.194ms 0.029ms 0.001ms 495.494ms 265 (line 2)
JIT_44ec9_282313_RA__Pr 338258 0.34% 2307.015ms 3375.013ms 0.01ms 0.004ms 3.159ms 105 (line 2)
JIT_2ea01_190977_WhetherProvides 531525 0.34% 2298.548ms 4444.168ms 0.008ms 0.005ms 392.782ms 334 (line 2)
ge_get_family 1602902 0.33% 2249.01ms 4410.341ms 0.003ms 0ms 2.857ms gnusto-engine.js (line 3609)
ge_get_prop_addr 1579488 0.31% 2142.021ms 25045.233ms 0.016ms 0.004ms 505.398ms gnusto-engine.js (line 3304)
JIT_2ef81_192385_ProcessRulebook 54845 0.29% 2020.97ms 3180.072ms 0.058ms 0.014ms 509.347ms 17 (line 2)
ge_test_attr 1562640 0.29% 1988.179ms 1988.179ms 0.001ms 0ms 1.525ms gnusto-engine.js (line 3523)
JIT_30653_198227_IndirectlyContains 28401 0.28% 1913.405ms 2232.976ms 0.079ms 0.007ms 487.338ms 707 (line 2)
JIT_456bf_284351_Meta__class 539728 0.27% 1827.403ms 2342.559ms 0.004ms 0.003ms 1.231ms 340 (line 2)
JIT_44bdd_281565_RV__Pr 149191 0.27% 1816.415ms 3244.949ms 0.022ms 0.008ms 491.008ms 126 (line 2)
JIT_2edaa_191914_ProcessRulebook 223030 0.25% 1711.804ms 1858.408ms 0.008ms 0.004ms 3.147ms 5 (line 2)[/code]

What this chart says to me is that I7 should be relying more on compile-time checking of whether properties exist, rather than run-time.

At this point the language should be type-safe enough to allow that.