Comments (2)
You can specify multiple serializers in the XML:
<FlatSharpDeserializers>GreedyMutable;Progressive</FlatSharpDeserializers>
This will apply globally. You'll get (slightly) more code than you perhaps bargained for. You could put your progressive table in a separate .csproj, which might reduce the volume of code depending on how simple the one progressive table is. It's also possible it goes the other way and increases your net lines of code. Happy to explain why if you're curious.
FlatSharp could support the case you are describing, which would involve traversing the dependency graph to determine which types are dependents of the given root type, then overriding the generated serializers property for those types, etc. FlatSharp does this already for cycle detection to avoid emitting recursion depth checks for non-cyclical schemas. This is a medium sized chunk of work that I'm happy to add as a feature request, though I can't promise I'll get to it on any schedule.
Lines-of-code seems like a persistent issue for you, so let me set some context about why FlatSharp does what it does. Most people using FlatBuffers do so because they have performance needs that aren't met by other formats/libraries. It follows that FlatSharp generates code with the goal of generating C# that the JIT can translate into efficient assembly. Due to some decisions by the JIT, this sometimes requires generating more code than you would write if implementing things by hand with the goal of avoiding virtual method calls, generic method sharing, etc. The main changes to generated code size can be found in the release notes for 7.0.0 and 7.1.0.
HTH,
James
from flatsharp.
Yeah the goal was to not add the additional code generation for those files that didn't need it and ideally we wouldn't have to create a seperate project for this specific file.
We have like 100 fbs files in one project so the small bits of extra code quickly add up to a lot of extra code. As we've seen before, that slowed down compilation times and introduced IDE lag so we'd like to avoid adding more then needed.
That said, since it's already much better than is was before the new changes were introduced it's probably okay to enable it globally for the project that needs it. So that's what we'll do for now.
from flatsharp.
Related Issues (20)
- Implementation of IInputBuffer for ReadOnlySequence<byte> HOT 6
- Share table HOT 2
- [Bug] Using the latest "Standalone" `FlatSharp` nuget in a .net6 project; generates a file that requires `IPoolableObject` HOT 2
- Reducing compiler generated file HOT 15
- Duplicate fbs filenames in different folders break compilation HOT 2
- Getting TypeLoadException when trying to access FlatSharp types HOT 9
- Shared fbs between multiple projects HOT 11
- [Bug] Flatsharp can't compile schemas on seperate drives HOT 7
- Warnings with new shared project feature HOT 3
- AOT exception when running a game built with Unity 2021.3 IL2CPP HOT 3
- Don't use Nullable properties for GreedyMutable only serializers HOT 4
- Serialization in V7 HOT 1
- Error generating model code when using namespace ending with FlatBuffer in .fbs file HOT 2
- flatsharp.compiler 7.x requires net6.0 SDK HOT 5
- Version conflict detected for Microsoft.CodeAnalysis.Common HOT 2
- Union does not support using the same type HOT 2
- Issue with init-only property when generating FlatSharp schema in .NET 6 HOT 2
- Clean up Exceptions Thrown in Generated Code
- NativeArray<T>' exists in both UnityEngine.CoreModule
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flatsharp.