kevinlawler / kona

Open-source implementation of the K programming language
ISC License
1.36k stars 138 forks source link

expand dispatch table #137

Open kevinlawler opened 13 years ago

kevinlawler commented 13 years ago

Verbs/adverbs are now stored as integers. These represent lookups in a dispatch table. Expand attributes in dispatch table as necessary. Revise dv_ex adverb execution to use optimized versions of verbs.

For adverbs: over, scan, eachpair

kevinlawler commented 13 years ago
  +/!1e6   /over, optimized to run using clean C loop via dispatch table

1.321s //-O0, before
0.280s //-O3, before

0.015s //-O0, after
0.015s //-O3, after

A better than 10x speedup. This is at least as fast as Kx's Q:

  +/!1000000j
0.020s
kevinlawler commented 13 years ago
  +\!1e6   /scan, optimized to run using clean C loop via dispatch table

1.454s //-O0, before
0.354s //-O3, before

0.016s //-O0, after
0.014s //-O3, after

Scan with Kx's Q:

  +\!1000000j
0.025s