11///usr/bin/env jbang "$0" "$@" ; exit $?
22
3- //DEPS org.jruby:chicory- prism:0.0.1 -SNAPSHOT
3+ //DEPS org.ruby-lang: prism-parser-wasm :0.0.2 -SNAPSHOT
44//DEPS org.jruby:jruby-complete:10.0.2.0
55
66import static java.lang.System.*;
@@ -12,7 +12,7 @@ import java.util.EnumSet;
1212
1313import org.jruby.Ruby;
1414
15- import org.jruby.parser .prism.wasm.Prism;
15+ import org.ruby_lang .prism.wasm.Prism;
1616import org.ruby_lang.prism.ParsingOptions;
1717
1818public class test {
@@ -69,6 +69,8 @@ public class test {
6969 var prism = new Prism();
7070 byte[] src = new byte[1024 * 1024];
7171
72+ var before = System.currentTimeMillis();
73+
7274 for (int i = 0; i < count; i++) {
7375 for (var file : JRUBY_BOOT_FILES) {
7476 byte[] options = ParsingOptions.serialize(
@@ -87,11 +89,14 @@ public class test {
8789 try (InputStream fileIn = Ruby.getClassLoader().getResourceAsStream(file)) {
8890 DataInputStream dis = new DataInputStream(fileIn);
8991 int read = dis.read(src);
90- prism.serialize (options, src, read);
92+ prism.serializeParse (options, new String( src, 0, read) );
9193 }
9294 }
9395 }
9496
97+ var after = System.currentTimeMillis();
98+ System.out.println("Elapsed: " + (after - before));
99+
95100 out.println("End");
96101 }
97102}
0 commit comments