bchavez / RethinkDb.Driver

:headphones: A NoSQL C#/.NET RethinkDB database driver with 100% ReQL API coverage.
http://rethinkdb.com/api/java
Other
383 stars 134 forks source link

Use new System.IO.Pipelines API / Project Bedrock #132

Open bchavez opened 6 years ago

bchavez commented 6 years ago

Benefits

Disadvantages

References

cecilphillip commented 6 years ago

Pipelines ships out of the box with Core 2.1, but I "think" you can pull in the NuGet package in .NET Standard 2.0 supported projects.

There's this package, but I haven't tried it yet.

bchavez commented 6 years ago

Thanks @cecilphillip ! The package link is really helpful. I didn't realize the package was on NuGet already.

After checking the Dependencies section on the NuGet page, I found it really intresting that Pipelines supports .NET Framework 4.6. Do you know if Pipelines really works on .NET Full Framework 4.6? I thought some of these Span<T> and System.IO.Pipeline optimizations required underlying support from the runtime? It would be really cool if it worked on 4.6 Full Framework.

chrome_1615

Thanks for dropping the info Cecil!

:car: :blue_car: "Let the good times roll..."

cecilphillip commented 6 years ago

Looks like Span<T> can be made available in 4.6.1 via System.Memory which is a dependency of System.IO.Pipelines.

bchavez commented 6 years ago

Thanks @cecilphillip .

Also, found some additional info: http://adamsitnik.com/Span/#how-does-it-work

How does it work? There are two versions of Span:

  • For the runtimes existing prior to Span.
  • For the new runtimes, which implement native support for Spans.

https://github.com/dotnet/corefxlab/blob/master/docs/specs/span.md#designrepresentation

We will provide two different implementations of Span:

  • Fast Span<T> (available on runtimes with special support for spans)
  • Slow Span<T> (available on all current .NET runtimes, even existing ones, e.g. .NET 4.5)

Seems like, as far as the runtime is concerned, there are two versions of Span<T>, 1) one for runtimes that have native Span support (eg .NET Core) and 2) one for older runtimes that don't have native support (eg .NET Full Framework 4.6). I'm guessing having two different Span<T> implementations is how Span<T> is made compatiable with older runtimes.

francisminu commented 6 years ago

@bchavez Hi Brian, Our project is in .NET framework 4.6.1. So are you stating that System.IO.Pipelines cannot be used in 4.6.1 and works as intended only in .Net core 2.1?

Any inputs would be really helpful. I have been trying a few demos, but all of them stops me at some step where the given method is not available in 4.6.1.

Thanks!

bchavez commented 6 years ago

Hi Minu,

My current understanding is that System.IO.Pipelines should work in both .NET Core and Full Framework (4.6.1). I have not personally tried System.IO.Pipelines in either runtime yet.

The only difference is when your app (or its dependencies) use the namespace System.IO.Pipelines on .NET Core, the runtime is better optimized for System.IO.Pipelines Span operations. The links I've posted above should contain enough background information about the System.IO.Pipelines implementation.

The only thing I can suggest is making sure all your dependencies are up to date. Even go so far as testing Full Framework 4.7.2 and see if it works there. If it still doesn't work then, I wouldn't have the slightest clue... something else must be wrong.

The discussion here is mostly reserved for System.IO.Pipelines as it relates to the C# RethinkDB driver. If you need more help, maybe posting a question on Stack Overflow or .NET's Slack channel might help. But thanks for giving us the heads up to double check the 4.6.1 implementation.

Thanks, Brian