-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
V2 is soon #5
Comments
That is really great news! Especially number 9 is very interesting for me as although the current version works with extended stack size it is quite slow. When you think the first usable version will be ready? The reason I'm asking this is that we will release the product where I'm currently using AqlaSerializer very extensively in about 2-3 weeks: Or is there a chance that we will have V2 backwards compatibility - just for reading the V1 format? |
@ab-tools, unfortunately V2 won't be wire compatible with V1. In V2 the serialization flow is significantly changed. Actually all the promised changes are already implemented but without compilation support yet. You may check the preview version: The emit (compilation) part is very large... I set the milestone to February 25. |
First thanks for your quick reply as always! :-)
Yes, I guessed that already, but thought maybe you could implement a fallback like if it detects V1 format, it processes it like in V1 version (just read-only). But if V2 comes so quick, it's not needed for me, then I will use V2 directly from my first product release.
I don't need any compilation support, just a "stable" version that I can use: Would you consider the current pre-release version already "format fixed" or do you expect some format incompatibility changes till the release on February 25? |
I would wait as long as possible before making the final decision about migrating to V2 format. |
OK, good, I'll wait as long as possible, but also need to get the product release finally done (is already a bit late as always ;-) ). It would be great if you could do a quick comment here when point 1 is done as it seems I at least need to wait for that. Thanks again a lot P. S.: |
I should warn you that the number 9 goal is not to speed things up but to avoid the necessity to create another thread with big stack size. It may be even slightly slower than the recursive version because it does more things like boxing, maintaining reference list, etc.. Although thread creation itself is a slow procedure and big stack size doesn't fit good in CPU cache so number 9 may still turn up faster for you. Good news! I've finished those changes to lists and now I'm not going to introduce any format changes for V2 release. Note that the API is planned to be changed soon. You may try to build the last version from the V2 branch. This https://github.com/AqlaSolutions/runsharp is included to the solution as a project reference so you'll have to clone it too. Now its defaults are suitable only for testing so you need to disable some things for your real use model like this:
"LateReference" is number 9 but for now it's model-wide setting and can't be toggled per type. You'd want it only for some specific properties so better disable for now. The same is true for "AdvancedVersioning". Null support is also enabled (where applicable) model-wide in this version. Attribute option "SupportsNull" doesn't change anything yet. If you setup this way you should be able to read the data in V2. But if you change later those settings per type in V2 (e.g. enable LateReference for some members) you won't be able to read the old data so you'll need to setup two models - 1st for reading the old data and 2nd for using the new features. This gives me an idea of a feature where each attribute may have a "set-id" option allowing to auto-add the same field in different way to multiple models. Also note that AqlaSerializer now supports plain Google Protocol Buffers format the same way like protobuf-net does (without referencing, null handling, etc) and it will be always possible to read it in any upcoming V2 versions. (protobuf-net specific features are not compatible, only plain Google Protocol Buffers) |
@ab-tools I made another format change today. I hope it's not too late. Please notify me when you release your app and it's really impossible to change the format anymore. |
First I'm very sorry to not get back to you earlier - I really appreciate your great work and also keeping me up-to-date on the status. In fact we're currently very busy to get everything ready for release, but we did not release yet. So the last format change was not a problem. I will do some tests (especially regarding read performance which is important for us) today evening and will let you know the results. Thanks again |
Just wanted to compile the latest V2 version, but I only have Visual Studio 2013 and it seems you are using a lot VS 2015 features now. Could you therefore please provide the latest V2 version any binary? Thanks! |
Saw that build already, but it seems to be already 20 days old. Doesn't it make more sense to test with your latest version? |
@ab-tools it's new, it's just somehow attached to the master branch dates but I'm working in V2 now. |
@ab-tools oops, now I know why ;) |
Now it looks much better, thanks! :-) |
Just wanted to do a first test with V2, but I cannot compile the project anymore after referencing the new DLL due to "missing System.Runtime.CompilerServices.ExtensionAttribute..ctor" compilation error. Sorry, but looks like I need a .NET 4 version of the DLL to reference it in my project. I compile against .NET 4.0 x86. |
@ab-tools Oh, I see. Let me check it. |
@ab-tools I created a new .NET 4.0 project, referenced the dll, used it in |
@ab-tools please download the updated binaries from the same link and try to compile using them. I have a guess what may cause the error. But I still can't reproduce it. |
I really just removed the old AqlaSerializer reference and added the new one. While trying to compile again afterwards, I got this compilation error. I will try it with your binary again directly tomorrow morning, thanks! |
@ab-tools I uploaded the full build, you can use net35/net40 version. |
Just wanted to let you know first that I still get the same compilation error also when I use the .NET 4 version. Maybe not both of the dependencies are .NET 4 as well? Anyway, it works find with the work-around you mentioned on the download page. |
@ab-tools I'm absolutely sure (and I've just checked via reflector) that net40 dlls version doesn't include its own declaration of ExtensionAttribute (which was the cause). Either you are not referencing the correct versions of mscorlib and System.Core inside your project or you are still referencing that net30 version. |
OK, I will double check it once more, maybe I just selected the wrong file after the first test (which is currently running) has finished. |
I'm sorry, this time it was really my fault - just used the DLL from the wrong folder. I also finished first test with the parameters
as you suggested above and here are my results:
Thanks again |
then it should work without new thread (can you check pls?) but it will write all the references using LateReference technique which is not optimal. I suggest you to keep it disabled until I add a possibility to specify
|
First thanks for your very quick reply as always. :-)
I did a test with "LateReference" enabled now and yes, now it works without a new thread!
As our product is a bit delayed now anyway and we still need to fix some remaining issues and get everything ready (manual and stuff like that) we postponed the official release now not till end of this month. Although that's annoying for me it should fit very well to be after your official release of V2 and everything should be ready then including the "LateReference" switch. :-) |
@ab-tools 2 - there is It's called "LateReference" because it's processed later, outside of its container object. |
@AqlaSolutions: OK, no problem, then I just keep my surrogate for now. Thanks! |
@AqlaSolutions: After all my tests were successful I just switched to V2 for the latest beta version of my product. :-) One thing I just wanted to mention/ask: I just did this change as I compiled it myself anymore and this saved about 50 KB of DLL size. Although size is not so important these days it seems just redundant to include an "own" LINQ implementation instead of using the .NET one. Maybe you could switch to "normal" LINQ for .NET 4.0 and newer via compiler directives? |
@ab-tools I decided to use the same LINQ implementation in all targets because different behaviors may cause unexpected and not reproducable bugs - even when it looks like simple thing in reality they behave differently in corner cases. It's a kind of overcautiousness but the size difference is not that big... When you want to have minimal binaries size you usually run your product in limited .NET environment like mobile platforms where you would need to use CoreOnly version with precompiled model dll and without RuntimeTypeModel. I will check whether I can remove LinqBridge from CoreOnly version completely and if it's not possible then I will go the way you asked because minimizing CoreOnly build is more important than having the same implementation. Anyway this is something that may be chosen later when more important changes like V2 release are done. |
@AqlaSolutions: OK, didn't expected that they may behave differently. But as I'm only using the .NET 4 version (don't have other projects with different targets it need to talk to), it should not cause any problems to use native LINQ hopefully. |
@AqlaSolutions, is there any wiki page covering inheritance support? For example, I have a class with complex hierarchy, and I need to be able to serialize it. I expect it to work out-of-box, but it (source from latest In case of protobuf-net, to serialize private fields from base classes, I need to add So I would like to see a wiki page covering inheritance support in AqlaSerializer. BTW, I found a typo: "Comparsion with protobuf net and migration" ( Regards! |
@aienabled, there is an automatic subtype registration in attribute mapping when both base and derived type are marked with When you register type from code you still have to specify subtypes manually. But If you use attributes you can simply specify It's important to have subtypes registered with field numbers because this way each hierarchy has independent type key numbers and you may add different hierarchies in any order. Instead of writing concrete type index of type in Model.Types[] serializer writes subtype index which is local for each base type. Moreover, when a concrete type is not registered in another version deserializer will still read the most concrete possible type from its hierarchy. Also see https://github.com/AqlaSolutions/AqlaSerializer/wiki/Changing-auto-add-behavior about The current code-only API provides very low level access so you don't have anything "automatic" there. Right now I'm not planning to make a more high-level mapping API but when I finish with attributes you will have more extension points inside |
@AqlaSolutions, thank you for detailed response! Please consider adding a special wiki page based on it - it could be very helpful for new developers. I just checked and can confirm the attributes approach is working fine. It seems the issue is by design... this is resolvable by cloning RuntimeTypeModel, but for developers using Going back to the my problem. I'm dynamically adding new types into the RuntimeTypeModel, and most of this types have exactly the same type names (yes, I need it to work this way to convert objects of "old" type to objects of "new" type - but type FullName exactly the same). I'm cloning/unfreezing the model before extending it with new types. Without inheritance it worked perfectly well (I've successfully used it for a few days), but with inheritance it cannot properly deserialize objects into the new types (
I'm stuck with it now and seeking for any ideas how I could avoid it this problem without creating separate RuntimeTypeModel. Please note I'm not using attributes and using code-only model configuration. Is it possible to use something like "flatten hierarchy" when the serializer for the specific type itself contains logic for (de)serializing private fields of base class(es) - exactly the same way it (de)serialize self fields and properties? It will add some duplication to scheme, but it will completely resolve the problem I have because this way it's not required to add any extra fields for subtypes to the base type TypeModel (it even will not require adding base types into the model and cloning the model to add new types). Is that achievable with current architecture? If so, could you point me please on the extension points which I could use to add support for it? Regards! UPD. I just found a workaround by adding a method |
Yes, I added a special API method
It's not hard to add such option. But it will be impossible to determine which subtype you serialized so you'll have to tell deserializer registered (not base) type. Such feature won't be top-priority for me in near future. You can add it by yourself, check the Possible solutions for your issue:
|
Unfortunately, .NET Reflection will not return private fields of base class(es) if
Yes, I'm also considered this sophisticated approach. However, it will require total refactoring of my architecture. Currently I'm using the same instance of RuntimeTypeModel for everything. So it seems the easiest option for me is using fork of your code which allows adding FieldInfo directly (not by name) to field metadata as I described in UPD section of my previous message. It suits very well for my current needs. Regards! |
@aienabled ok, cool then ) |
Beta is out! https://github.com/AqlaSolutions/AqlaSerializer/releases I added mapping examples to the header in this issue. @ab-tools |
@AqlaSolutions: OK, I will give it a try, thanks! But I'm not sure if I understood the new mapping attributes correctly yet:
|
Default comes from type settings, otherwise For collections default
You may leave it by default unless you want some specific behavior. Just
Again, only when you need some specific behavior for collection items. If you had specified non-default settings on |
@AqlaSolutions: I meant what I need to apply for
And it would be great if you could write a short explanation (as I guess the Wiki is not ready yet) what the different modes are all about, especially what the mode Thank you! |
@ab-tools such explanation is already present in xmldocs, use your IDE. 1/ Suppose you had
You don't need to change anything here. The defaults are the same. 2/ Suppose you had
It should become now
* edited from |
I added a wiki page which describes possible member formats. Also collection formats. |
@ab-tools you'll also need to set I want to ensure that everything is ok with format compatibility so I can publish the final V2 release without worrying. Please check the last build. |
@AqlaSolutions: I'm really sorry that it takes so long, but we've just a lot of work right now directly after the release of our product. :-) By the way, as it's released now, I can also share a link here if you would like to know where your great library is used: It's a instructor station for Prepar3D and FSX flight simulators. I'll try to give your latest version a try today evening and will post the results then! |
@ab-tools Interesting, I downloaded your app, it looks like it doesn't detect trial FSX but loads database when I specify directories manually. So it's like a realtime mission/map editor, right? Please check the format compatibility asap (if you still need it) because it might be impossible to change after the final release of V2 and I have everything ready for the release now. If you see any problems try to prepare small examples of incompatible cases. Also you can use |
@AqlaSolutions: Again sorry for the delay, I just started to test already and will send you feedback definitely today (probably in the next few hours already). By the way, where you downloaded FSX trial from? |
@AqlaSolutions: I just gave it a try now and only changed two occurances of When I run that now, I get following exception:
I did not use something like Do you have any idea what I should search for? Thanks |
@ab-tools I used FSX from https://www.microsoft.com/Products/Games/FSInsider/downloads/Pages/FlightSimulatorXTrialVersion.aspx installed to a non-system drive. Try to compare debug schemes with the latest AqlaSerializer and with alpha ( I ported debug schema over alpha: https://www.dropbox.com/s/hm9h7r9gxah0p3r/aqlaserializer%20alpha-r90.zip?dl=1 ).
Changing between I replaced attributes in the model you emailed me before and according to debug schemes everything should be compatible there if you have the same mapping as I am. Feel free to send me the schemes if you need a help. |
@AqlaSolutions: Just generated debug schemas for all objects that are used with AqlaSerializer for comparison and there are several differences. Mainly Would be great if you could have a look - I sent them to you via e-mail. Best regards and thanks a lot |
Are you using the latest release?
Seems like you've forgotten to set
before adding any types. Field #2 of tuple |
@AqlaSolutions: Oh, yes, you're right - I just forgot the After this was added, it reads the old data perfectly fine! By the way, is it possible to enable this Best regards |
@ab-tools you can use two models - with and without |
@AqlaSolutions: OK, I just left it as it is now with By the way, we checked and this quite old demo version of FSX is indeed not fully compatible, but with the latest program version from our website you can at least build the database (=> use AqlaSerializer ;-) ) from the FSX Demo, but connecting to the flight simulator afterwards won't be possible. |
These features are already available in the V2 beta version:
And those are planned to be added with minor 2.x releases:
12. No-versioning mode for best output size.
14. Google Protocol Buffers schema correct generation inside AqlaSerializer.
15. Protogen to generate classes from Google Protocol Buffers schema.
16. Improved performance by avoiding boxing when serializing Nullable[T] with null support or advanced versioning mode enabled.
17. CoreCLR platform support.
AppendCollection mode is not going to be supported in complex scenarios.
Migration:
Attributes mapping example:
[SerializableMemberNested]
is optional and may be omitted.Code mapping example:
The text was updated successfully, but these errors were encountered: