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

external URI parser #12

Open
ikod opened this issue May 16, 2016 · 12 comments
Open

external URI parser #12

ikod opened this issue May 16, 2016 · 12 comments

Comments

@ikod
Copy link
Owner

ikod commented May 16, 2016

Giles Bathgate:

This uri abstraction might be a useful sub component of these http libs: https://github.com/rikkimax/alphaPhobos/blob/master/source/std/experimental/uri.d

@GilesBathgate
Copy link

@ikod I am putting together a testsuite to test various uri backends: https://github.com/GilesBathgate/uri
This should give an idea of performance and robustness.

@ikod
Copy link
Owner Author

ikod commented May 17, 2016

I commited ftp code and unittests, will look on uri lib.

@ikod
Copy link
Owner Author

ikod commented May 17, 2016

What is the best practice for using modules from alpha libraries? Is it ok if I just place it in my source tree?

@GilesBathgate
Copy link

ping @wilzbach

@wilzbach
Copy link

Why not?
(but I don't have detailed experience in best practices for this either)
Anyways as long as you haven't reached 1.0, you shouldn't worry about this too much.

@GilesBathgate
Copy link

@ikod I would like to say that I am not getting good results from the alphaPhobos library, I am trying vibe.d implementation instead.

@wilzbach
Copy link

Is it ok if I just place it in my source tree?

To clarify you mean using git submodules? You can also tell dub to use master of its already released there..

@ikod
Copy link
Owner Author

ikod commented May 17, 2016

To clarify you mean using git submodules?

Never tried git submodules, but they should work, thanks for idea.

@GilesBathgate
Copy link

GilesBathgate commented May 17, 2016

@ikod Here are some initial results of the various Uri parsing libraries.
(A reference implementation was made by wrapping the c library liburiparser)

  • liburiparser 54 ms, 970 μs
  • vibe.d (url.d) 194 ms, 850 μs
  • arsd (http2.d) 1249 ms, 602 μs
  • alphaPhobos (uri.d) core.exception.InvalidMemoryOperationError@/home/giles/ldc/runtime/druntime/src/core/exception.d(679): Invalid memory operation

The test was just a simple one run in a loop 10,000 times

        auto u = new Uri("http://user:pass@host:99/foo/bar?baz#qux");
        assert(u.scheme == "http");
        assert(u.username == "user");
        assert(u.password == "pass");
        assert(u.host == "host");
        assert(u.port == 99);
        assert(u.absolutePath == "/foo/bar");
        assert(u.query == "baz");
        assert(u.fragment == "qux");

@GilesBathgate
Copy link

@ikod Here is another test run:

  • liburiparser 89 ms, 341 μs
  • vibe.d (url.d) 273 ms, 522 μs
  • arsd (http2.d with ctRegex) 429 ms, 416 μs
  • uriparse.d 53 ms, 104 μs

uriparse.d is my attempt at creating a new uriparsing library. It will probably only currently parse the most basic of urls, but its still the fastest ;)

@ikod
Copy link
Owner Author

ikod commented May 24, 2016

@GilesBathgate Finally pushed http and ftp requests joined under single structure.
One of the goal was not to break API and give user unified interface for http and ftp, which at the same time can give different details on responses.
I'm not happy with proposed code, and will try to improve it.
Anyway if you have any final results on URI tests, I will try to incorporate another URI parser.
Thanks.

@anton-dutov
Copy link

@ikod, @GilesBathgate
What about urld ?

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

4 participants