Skip to content
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

WIP: use .pvm file #21

Merged
merged 13 commits into from
Jan 8, 2023
Merged

WIP: use .pvm file #21

merged 13 commits into from
Jan 8, 2023

Conversation

jeswr
Copy link
Collaborator

@jeswr jeswr commented Jan 5, 2023

Generation of the .pvm is now working; yet to wire it up to actually use it.

@jeswr
Copy link
Collaborator Author

jeswr commented Jan 6, 2023

#20 (comment) can now be reproduced by running the following on e070aae

npm i
npm run eye:pvm:test

@jeswr jeswr force-pushed the perf/pvm branch 2 times, most recently from 1ecc58f to a417400 Compare January 6, 2023 00:33
@jeswr
Copy link
Collaborator Author

jeswr commented Jan 6, 2023

@josd I've tried to have a bit of a look into what is going wrong in #21 (comment) but unfortunately I don't really have enough knowledge of pvm formats to get that far with it. If you know how to fix this please go ahead and do so; otherwise let's jump in a call when you're online to discuss.

@jeswr
Copy link
Collaborator Author

jeswr commented Jan 8, 2023

@josd This is now working 🥳 with the following performance results so we are now able to initialise SWIPL and EYE in 18% of the time it took before switching to the use of .pvm. In other words, this is a 5x speed up

Testing performance of socrates query using eye.pl
Initialise SWIPL        : 139.427ms
Load and consult EYE    : 479.871ms
Load data.n3            : 0.076ms
Load query.n3           : 0.021ms
Execute query           : 7.311ms

Testing performance of socrates query using eye.pvm
Initialise SWIPL with EYE image : 115.429ms
Load data.n3            : 0.089ms
Load query.n3           : 0.029ms
Execute query           : 9.2ms

All that is left to do on this PR is clean up the API and add some documentation - which I will do later today.


The other metric to note is the following file sizes

-rw-rw-r--  1 jesse jesse   344K Jan  8 17:45 eye.pl.js
-rw-rw-r--  1 jesse jesse   701K Jan  8 17:45 eye.pvm.js
-rw-rw-r--  1 jesse jesse 10429K Jan  8 17:45 swipl-bundled.temp.js

So it would be very useful if we could find ways of further compressing the pvm and bundle files.

@jeswr
Copy link
Collaborator Author

jeswr commented Jan 8, 2023

Ok - the pvm is down to a reasonable size

344K Jan  8 20:30 eye.pl.js
452K Jan  8 20:30 eye.pvm.js
10429K Jan  8 20:30 swipl-bundled.temp.js

@jeswr jeswr marked this pull request as ready for review January 8, 2023 10:17
@jeswr jeswr merged commit 0a5f406 into main Jan 8, 2023
@jeswr jeswr deleted the perf/pvm branch January 8, 2023 10:19
@jeswr
Copy link
Collaborator Author

jeswr commented Jan 8, 2023

🎉 This PR is included in version 1.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant