sql.js with inlining much slower than without




7 years ago
5 years ago


(Reporter: azakai, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



7 years ago
sql.js is SQLite compiled to JavaScript. When compiled with inlining enabled in LLVM, it becomes much slower (3x or so), which is surprising as normally inlining makes code faster (aside from removing function call overhead, it enables LLVM to do a better job at optimizing). Inlining does create much larger functions, so possibility this is a function recompilation issue?

Attached is a sql.js benchmark with and without inlining.

Comment 1

7 years ago
Forgot to say, without inlining sql.js is 20x slower than native code, which is worrying.
Do you have comparable benchmarks that work in the shell?

Comment 3

7 years ago
To make these run in the shell, just remove the first 30 lines, up to

  // The compiled code

and remove the last 3 lines of HTML that close the script tag etc. That leaves just the compiled code.
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.