Giter VIP home page Giter VIP logo

Comments (4)

trestletech avatar trestletech commented on July 26, 2024

I noticed that if I comment out lines 28-30 of core.R and access it from the browser, I don't get that same slowness, so I'm suspecting there's a buffering issue with readlines. But I have yet to confirm.

from plumber.

trestletech avatar trestletech commented on July 26, 2024

Likewise, on the unaltered file:

> system.time(httr::GET("http://localhost:8000/mirror?https=0"))
   user  system elapsed 
  0.006   0.001   2.412 
>  # (The first run)
> 
> system.time(httr::GET("http://localhost:8000/mirror?https=0"))
   user  system elapsed 
  0.005   0.001   0.014 
>  # (Subsequent runs)

from plumber.

trestletech avatar trestletech commented on July 26, 2024

Confirmed on wireshark that the readLines request is getting an HTTP 200 in < 0.1s. It's just some quirk of readLines that makes it continue waiting for additional input after the HTTP response has already terminated. You may need to drop to a lower-level connection to read from.

Another hack that works:

> system.time(readLines("http://localhost:8000/mirror?https=0", 1))
   user  system elapsed 
  0.000   0.000   0.052 
> 

Closing this for now. Feel free to reopen if you see something pointing at plumber as the source of unexpected slowness.

from plumber.

Ironholds avatar Ironholds commented on July 26, 2024

Huh, cool! Thanks for the fix :)

from plumber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.