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

Guid values #26

Closed
brenwebber opened this issue Nov 21, 2020 · 7 comments
Closed

Guid values #26

brenwebber opened this issue Nov 21, 2020 · 7 comments

Comments

@brenwebber
Copy link

I was wondering if there was any way to convert Guid values?

I've tried using an object with guid properties as well as the object with its properties stored as a Dictionary<string, object> but in both instances the Guids don't work properly.

The object is deserialized with empty Guids, and the dictionary has ExpandoObject values in place of the Guids.

I've had to resort to obj->Json->UTF8 byte[] which has poor performance in comparison.

@brenwebber brenwebber changed the title Dictionary<string, object> Guid value -> ExpandoObject Guid values Nov 21, 2020
@zachsawcs
Copy link
Collaborator

Ah my bad. Completely forgot about the Guid type. I'll implement support for that in the next release!

Cheers.

@brenwebber
Copy link
Author

Thanks Zach.

With the arrival of .net 5.0, and with it the removal of the BinaryFormatter, I have a feeling a lot of people will be coming this way ;)

@zachsawcs
Copy link
Collaborator

Oh I didn't realise the BinaryFormatter's been removed in .net 5.0. That's a good heads up.

Interestingly I found a couple more places I could optimise the performance further when looking into implementing Guid support.

@brenwebber
Copy link
Author

That's great news.

The BinaryFormatter is still available through a package import, but not included in the framework. Read more here for reasons, it's quite interesting.

@zachsawcs
Copy link
Collaborator

To be honest I haven't used the BinaryFormatter since the early days of .Net Frameworks 1.0/2.0. It's been frowned upon by everyone if you try to use it and for good reasons too. It's too brittle and as I've just discovered from the link above, security is an even more major concern.

Anyway, I've just released a new version with Guid support. Give it a try and let me know if it works for you.

@zachsawcs
Copy link
Collaborator

btw if you're wondering, the optimisation I mentioned earlier was worth about 5% on benchmark 2. I should probably update Readme at some point because Binaron.Serializer is now comfortably more than 400% in both serialisation and deserialisation vs both Newtonsoft and System.Text.Json instead of 300%/350%.

@zachsaw
Copy link
Owner

zachsaw commented Nov 25, 2020

Since I haven't heard back from you, I guess it's working now? I'll close the ticket for now but reach out if you find any problems.

@zachsaw zachsaw closed this as completed Nov 25, 2020
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

3 participants