Open haochenli opened 3 years ago
Maybe the wording is wrong. The snapshot skips parsing (time and memory saving), but the resulting byte code is the same. No extra optimizations are done on snapshots.
Maybe the wording is wrong. The snapshot skips parsing (time and memory saving), but the resulting byte code is the same. No extra optimizations are done on snapshots.
Thanks for your reply, what is wording
mean?
And I try the benchmark.js file which is the implementation of the Richards benchmark. The result of comparison between with snapshot and without snapshot as below: still the same..
Code here
Seem like the snapshot created failed, but with the CMD I actually got the output file.
I read the article about V8's snapshot. AFAIK the snapshot in v8 means initialized context with prepared heap snapshot which was created at the very beginning, that will speed up the bootstrap process.
And in Jerry's doc and test file(test-snapshot.c), what I got is the snapshot is more like a "faster code" which is actually bytecode.(question1: Am I right about the understanding of the snapshot?)
So I write a simple Fibonacci test to check it out: Here is js:
And then I generate the snapshot with the cmd tool:
/jerryscript/build/bin/jerry-snapshot' generate '/Users/lihaochen/Desktop/Project/os/js-engine-all/test.js' -o js1.snapshot
.And the next step I try to compare the execution time between with snapshot and without snapshot. Here is the result:
Finally, the execution time is almost the same...(question2: where am I wrong?)
I have already added
JERRY_SNAPSHOT_EXEC
andJERRY_SNAPSHOT_SAVE
config I appreciate your answer...