Skip to content

Meta-Issue to track/understand CoqJS performance. #334

@ejgallego

Description

@ejgallego

Hi everybody,

[I hope the issue tracker is the right place for this kind of discussion, otherwise feel free to remove/close the issue]

We did some progress in trying to compile Coq with js_of_ocaml, a prototype is available at the jscoq github repository and it can be seen live at https://x80.org/rhino-coq/

In Chrome Dev (45) the situation seems quite good. I was able to do ssrnat without much trouble using an increased stack size. An issue is to improve plugin loading time, as jscoq has to compile large chunks of js.

Some example Coq test scripts:

Regular Coq:

Require Import Coq.Init.Prelude.
Lemma addn0 n : n + 0 = 0 + n.
now induction n; auto; simpl; rewrite IHn.
Qed.

Ssreflect:

Require Import Ssreflect.ssreflect.
Lemma addn0 n : n + 0 = 0 + n.
by elim: n => [|n /= ->].
Qed.

Mozilla Firefox

With limited informal testing, the performance in Mozilla seems on par with the bytecode interpreter.

Stack Overflows are a problem when dynamically loading large plugins (cma files). One solution could be precompiling (see #307, #313), another one would be to increase SpiderMonkey stack size, but this seems hard. Would we solve that, the performance in Mozilla should be good.

Chrome

Chrome 45 seems to work very well. 43 44 run very slow.

Chrome does also suffer from a short stack, but passing the --js-flags="--stack-size=65536" command line option seems to enable Coq to run quite OK.

Thanks,
E.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions