friflo / Friflo.Json.Fliox

C# ECS for high performance DoD. C# ORM for .NET with Messaging and Pub-Sub.
GNU Lesser General Public License v3.0
150 stars 11 forks source link

notes for version: v0.28.0 - changed schema for an `EntityDatabase` to constructor parameter #23

Closed friflo closed 5 months ago

friflo commented 1 year ago

Breaking changes

Changed assignment of a DatabasSchema to an EntityDatabase.

Previous: used init only setter Schema

    var database = new MemoryDatabase(dbName) { Schema = Schema };

Now: used constructor parameter DatabasSchema schema

    var database = new MemoryDatabase(dbName, Schema);

Reason: SQL databases require a Schema. So a missing schema ensures a fail fast in their constructor.

Performance

Changed EntitySet<,> from class to struct to speedup construction of a class extending FlioxClient using EntitySet<,> as fields / properties to define database containers.
E.g. new MyTestClient(hub) with seven EntitySet<,> fields take ~ 0.5 µs and allocates ~ 900 bytes