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

Store RunAutomaton without tabelize and tabelize after load #36

Open
dan2097 opened this issue Aug 20, 2022 · 0 comments
Open

Store RunAutomaton without tabelize and tabelize after load #36

dan2097 opened this issue Aug 20, 2022 · 0 comments

Comments

@dan2097
Copy link
Contributor

dan2097 commented Aug 20, 2022

I have a probably rather niche use case, I'd like to create RunAutomatons, serialize them with store, then only once they're deserialized with load tabelize them. The reasoning being that for the automata in question (https://github.com/dan2097/opsin/tree/master/opsin-core/src/main/resources/uk/ac/cam/ch/wwmm/opsin/resources/serialisedAutomata) tabelizing significantly increases their size, and given how fast setAlphabet() is there could be even a speed penalty for deserializing this array as opposed to creating it programmatically (Java's inbuilt serialization code isn't the fastest).

As setAlphabet() isn't public I can currently achieve this either via reflection or having a class in the dk.brics.automaton package.

I can't really think of an idiomatic solution to this. I mean a simple solution would be to make setAlphabet() public, but there isn't normally a reason to call this after the RunAutomaton is constructed. A load(InputStream stream, boolean tableize) could get confusing as to how it interacts with serialized tabelized and non-tabelized automata e.g. if you set it to false would it set classmap to null on the deserialized RunAutomaton.

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

No branches or pull requests

1 participant