Elias Kosunen
Elias Kosunen
Memory mapped files generally make this faster: ```cpp scn::mapped_file file{"bench_stdio.txt"}; auto result = scn::make_result(file); double d{}; while ((result = scn::scan(result.range(), "{}", d))) { v.push_back(d); } ```
The file handling stuff is a little iffy and hard to test when using stdin, but this definitely should have been caught. I'll look into this.
Temporary fix in v1.1.1, the snippet in your message now works. Keeping the issue open for a more substantial fix, including design changes.
Now _sort of_ possible with ```cpp std::string url = "https://github.com/eliaskosunen/scnlib"; std::string protocol, domain, username, repo; // [^:] means accept everything but ':' -> read until ':' // same for [^/]...
I will look into this after the Cologne WG21 meeting. To go over it quickly, something like this can be achieved with `scn::getline`, in a similar fashion to `std::getline` with...
I created a repo comparing your above example with a somewhat equivalent example with scnlib: https://github.com/eliaskosunen/scnlib-spirit-benchmark Spirit is almost twice as fast in this example. This is because scnlib doesn't...
Actually, my benchmarks were a little off; the time difference is ~25%. This is still a bug, though
By making `string_view` work with `scn::getline` the difference is now ~15%
`scn::discard` provides this functionality: ```cpp int count; auto ret = scn::input("{}{}", count, scn::discard()); ``` There's no way to achieve this using the format string.
I tried setting it up, but couldn't get it to co-operate with CMake. If you're still up for it, I absolutely wouldn't be against it.