You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The built_value and built_collection packages are used in scadnano for immutable objects. However, because it uses code generation at compile time, due to the huge number of built_value objects (both in the state and actions subfolders) it is now very slow to compile the project, usually taking at least 45 seconds, and sometimes up to 2 or 3 minutes.
An alternative would be to avoid these packages and do immutability "manually". We could replace the built_collection package with fast_immutable_collections. I don't know if it's any faster, hopefully it is, and also could be easier to use. Definitely using "plain Dart" immutable objects would be easier to use, although it may be more cumbersome to create them since we would no longer have automatically provided methods such as JSON serialization and equality testing. However, this may be simpler to provide with a mixin that we write ourselves.
There is an alternative to built_value, called freezed. However, it also uses code generation so may be just as slow as built_value.
The text was updated successfully, but these errors were encountered:
The built_value and built_collection packages are used in scadnano for immutable objects. However, because it uses code generation at compile time, due to the huge number of built_value objects (both in the state and actions subfolders) it is now very slow to compile the project, usually taking at least 45 seconds, and sometimes up to 2 or 3 minutes.
An alternative would be to avoid these packages and do immutability "manually". We could replace the built_collection package with fast_immutable_collections. I don't know if it's any faster, hopefully it is, and also could be easier to use. Definitely using "plain Dart" immutable objects would be easier to use, although it may be more cumbersome to create them since we would no longer have automatically provided methods such as JSON serialization and equality testing. However, this may be simpler to provide with a mixin that we write ourselves.
There is an alternative to built_value, called freezed. However, it also uses code generation so may be just as slow as built_value.
The text was updated successfully, but these errors were encountered: