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
Support span parsing #1131
Comments
We'd probably want to be able to format into a |
I'd like to have a try at this. |
You're welcome to have a go, but I should warn you that I prototyped it a while ago, and it's going to be a pretty huge piece of work. If you're up for the challenge, go for it... |
Got it. Can you give me some general directions? Would it be possible to share the code you prototyped? |
I hadn't even got it compiling - and it was several branches ago, before C# 8 was publicly available. I don't think I've still got it, to be honest. I do remember having to change It's probably worth working through the text handling code to start with to make sure you understand it before looking at doing Span work. |
@carlosschults: Did you make any progress on this? I don't know when I'm going to find some concerted time to work on 3.0, but this is one of the things I'd like to make progress on. If you've made progress yourself, that's great and I don't want to reproduce it - but if you haven't been able to work on it, that's fine and I'll have another go myself. |
@jskeet I'm sorry, I haven't really been able to get started. Fell free to go ahead. Thanks! |
I now have a prototype where all the tests still pass, which is encouraging :) I need to do more work to optimize though. |
This is now effectively blocking 3.0 going GA, but I'm unlikely to have enough time to work out why the span-based call is slower than the string-based one, and it's not really production ready. Options are:
Nothing is particularly appealing to me right now. Will prototype what adding a second interface might look like. |
It looks like anything with culture-specific text parsing effectively can't be as efficient with Spans as I'd like it to be, at least when targeting netstandard2.0. I'm tempted to go with the "release 3.0 and add a new interface later" option - which definitely works, even though it's ugly. |
IPattern<T>
should support parsingReadOnlySpan<char>
if at all possible. (It will partly depend on framework support.)The text was updated successfully, but these errors were encountered: