Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Design for lazy loading #9

Open
robertvazan opened this issue Apr 25, 2019 · 0 comments
Open

Design for lazy loading #9

robertvazan opened this issue Apr 25, 2019 · 0 comments

Comments

@robertvazan
Copy link

API of this library is designed in such a way that it forces loading of a large number of classes even though only a few are actually used. This has perceptible and sometimes very serious performance impact.

Just executing CoreFactory.newWebPageBuilder() costs 1 second on a fast computer. I had to disable schema.org generation during development to get fast program restarts.

Initialization of the library takes 3-4 seconds on moderately fast VPS, but it can stretch out to 30-60 seconds when the server is under heavy load as is common when the server has to be restarted. I had to disable schema.org during the first minute or so after server restart. This is of course not ideal, because pages served during this time are incomplete.

It would be much better to have an API like WebPage.builder() that would only force loading of WebPage and its ancestor classes. This would be performant and actually more intuitive than the current API.

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

No branches or pull requests

1 participant