-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pvm
file for faster startup
#20
Comments
The image is currently made with https://github.com/eyereasoner/eye/blob/master/install.sh line https://github.com/eyereasoner/eye/blob/master/install.sh#L34 |
For the native eye the difference is
versus
|
What I am struggling with is trying to work out how to generate the import { SWIPLModule } from 'swipl-wasm/dist/common';
import { queryOnce, runQuery, SWIPL, writeEye } from '..';
(async () => {
const Module : SWIPLModule= await SWIPL({ print: (s: string) => {
console.log(s);
}, arguments: ['-f', 'eye.pl', '-g', 'main', '--', '--version'] } as EmscriptenModule);
})(); |
ignore this: it should just be
|
I've now tried (async () => {
const Module: SWIPLModule = await SWIPL({
arguments: ['-x', './eye.pvm', '--', '"$@"'],
preRun: (module: SWIPLModule) => {
module.FS.writeFile('eye.pvm', fs.readFileSync(path.join(__dirname, '..', 'eye', 'eye.pvm')).toString());
},
print: console.log,
printError: console.log
});
})(); but it errors out with [FATAL ERROR: at Fri Jan 6 10:51:30 2023
Could not open resource database "./eye.pvm": Not a tty]
Aborted() See #21 (comment) to reproduce locally // cc @rla @JanWielemaker as it seems like it could be a problem with the swipl-wasm build rather than my usage of it |
I don't know. Seems it cannot open eye.pvm and the reported errno is bogus. |
As in failing to parse it? It is definitely finding the file because if I remove the step adding [FATAL ERROR: at Sat Jan 7 17:23:34 2023
Could not open resource database "eye.pvm": No such file or directory]
Aborted() |
Ok. Note that the eye.pvm is a zip file. If it is opened but unusable as resource file it is probably an invalid zip file according to the embedded minizip library. |
Ah - thanks for clarifying (in particular the fact that it is a zip)! I've fixed it; the problem was doing a |
|
Thank you so much @jeswr and @JanWielemaker, the eye initialization is now 5 times faster! |
No description provided.
The text was updated successfully, but these errors were encountered: