Closed t0yv0 closed 10 years ago
Thanks!
Perhaps the check could me made at runtime, to make the nuget package backwards compatible?
I haven't thought of that. Yeah, that should be possible, gets rid of the multiple assemblies, and will probe/use net45 API when available. Up to you - seems like the shim overhead is negligible but I have not measured.
I suppose that the wrapper would only get used in the case of net40. Sounds like a plan, would you care to submit a new pull request for this?
That would imply that build is only possible in net45. But it should still work with .net40 right?
Hi again,
I've pushed a new commit 77dbb8128f4c493620336ff6c243afbf454d303a. I don't have 4.0 installed anywhere, so could you please check if this works ok?
Oh, whoops, didn't see it. Reviewing.
Yeah, sorry about that. I just couldn't help myself :)
Looks good to me. Unfortunately I don't have a machine without .NET 4.5 - that's an in-place update right? Let me see if setting "supportedRuntime" in App.config can force to run on .NET 4.0.
Build-requiring net45 is no problem. I am just trying to use this from a project targeting net40. Some folks using our libs insist on net40, because apparently net45 requires upgrading Windows on the servers and for some it is too much trouble at this point.
Ok, "supportedRuntime" has no effect here.
Perhaps testing could be arranged like this:
Ok, so it works.
I did notice that the shim carries a rather significant performance penalty in the benchmarks I usually run.
That's a pity! Hope there is nothing pathological (like me forgetting to override a "vectorized" method like Write/3, and the stream going to char-by-char operations). Quite surprised just one layer of indirection would cause trouble. Guess it means the rest of your code is very lean.
Yeah, I think this has to do with the BinaryWriter/Reader implementations, which call the underlying stream too eagerly. I was thinking about reimplementing buffered versions, which would probably have to be in C# to make any sense.
Actually, this is one of the reasons why I've yet refrained from targeting pickle formats other than binary: having direct access to the binarywriter/stream has great performance advantages.
By the way, I just pushed a new NuGet package. Could you verify that it works as expected with net40 runtimes?
Sorry, don't see an easy way to do this, and am a bit short on time now..
No rush. Just Let me know if and when it fails :)
Would be very useful to have net40 build together with net45 build (or else just default to net40). I tried to downgrade, there are a just a few places where net45 functionality is used. I tried to fix it in this PR, and added a "build.cmd" that builds a package with both net40 and net45 folders populated with appropriate
FsPickler.dll
.