I ran a few tests where I fetch the google homepage via curl,
get-impure-port, and get-impure-port*. Curl does, in fact, seem to be
faster, but not nearly so much so to account for the delays in that
video. So, one thing to check is if the racket code gets slower
results when requesting arbitrary urls vs. when requesting that
specific server.

It could be an issue with the requests headers that you're sending
(which is to say, the library defaults) vs. what curl is sending. Or
it could be a bad interaction with Nagle's algorithm, though that
seems unlikely with an http GET, since the most likely culprit would
be separate flushes of header and body data -- and there is no body in
a GET request. I think maybe all of the things you tried use http 1.0
requests by default (simple-http reuses the code from
net/http-client), so you might want to try explicitly using 1.1.




On Mon, Sep 14, 2020 at 3:57 PM Stephen Foster <step...@thoughtstem.com> wrote:
>
> Finally circling back to this issue.  I've disabled debugging in DrRacket and 
> also done a test outside of DrRacket.  It's still slow. :(
>
> I also tried the newer HTTP client: 
> https://docs.racket-lang.org/http-easy/index.html.  Like the others, it is 
> also slow.
>
> I'll do some more digging.  I'm currently trying to figure out if this is a 
> "just me" / "just my system" problem.  So... I'd be grateful if anyone who 
> has written code that sends HTTP requests from Racket could chime in with: 1) 
> I can confirm that sending HTTP requests from Racket has always been fast for 
> me, or 2) I too have noticed Racket HTTP requests are slow.
>
> (Note that by "slow", I mean: takes noticeably longer than curl.)
>
>
>
> On Tue, Jul 7, 2020 at 12:21 PM Jon Zeppieri <zeppi...@gmail.com> wrote:
>>
>> Hi Stephen,
>>
>> Your video shows you running this code in DrRacket with debugging
>> enabled. That usually affects performance. Have you made measurements
>> when running this code outside of DrRacket?
>>
>> - Jon
>>
>>
>> On Tue, Jul 7, 2020 at 2:13 PM Stephen Foster <step...@thoughtstem.com> 
>> wrote:
>> >
>> > I'm considering using Racket to remake my 3D game CodeSpells.  I'm using 
>> > http requests to have Unreal Engine and Racket talk to each other.
>> >
>> > When I use the http/request library, Racket fires off its GET request much 
>> > slower than if it were to do a system call to curl.  (Same is true if I 
>> > use simple-http, which makes me think the problem might be a deep one.)
>> >
>> > Here's a video to demo the issue.  Notice how, with curl, the experience 
>> > is playable, whereas with the Racket function, there's way too much time 
>> > between the spell landing and the effect occurring:
>> >
>> > https://youtu.be/jTqUFVlfBFA
>> >
>> > Obviously, I'd like to do things in a Rackety way.  But I'm not above 
>> > doing things the silly way.  I'd just be grumpy about it.
>> >
>> > Any ideas?
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Racket Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to racket-users+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/racket-users/997693d6-b94a-4f69-85cf-aa475c807b20n%40googlegroups.com.
>
>
>
> --
>
>
> Stephen Foster
> ThoughtSTEM Co-Founder
> 318-792-2035

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAKfDxxyzT9z9inrjoLumvK%3DZi4CNpBo0RpMuOkkwUs4WG2g4Gg%40mail.gmail.com.

Reply via email to