Comments (5)
That while loop takes up a lot. I already changed it to poll the server at a predefined number of seconds, but that isn't in a release yet. I'll be changing it again soon to something more performant, so expect that to change.
Either way, when idle, the server takes up 0% cpu.
from grapevine.
When the server is idle (no requests) it should be taking up 0% CPU. Can you post some sample code for me to take a look at?
from grapevine.
Hi @scottoffen I tried with the sample provided in the repository, but the same result, so I decided to left a comment, maybe it's something else... I've tried also with other embedded webserver (https://github.com/unosquare/embedio) and the CPU is 0% when the server is idle.
If you need more information, let me know.
from grapevine.
How are you blocking the thread while the server is running? If you are just benchmarking, use this method:
server.Start();
Console.ReadLine();
from grapevine.
I used the server.Run()
as in the sample, when I use server.Start()
the CPU gets down to 0% when idle. So the server.Run()
does something else in the background?
public static void Run(this IRestServer server)
{
server.Start();
while (server.IsListening) { }
}
Probably the while loop inside...
Thanks!
from grapevine.
Related Issues (20)
- Regression from 4.0: You can no longer send a streamed response HOT 4
- Directory pathing fails on non-Windows systems
- Request and Routing Middleware break
- How to set the character set value of the Content-Type response header HOT 2
- Feedback - dependencies - no thanks HOT 1
- Custom middleware, adding JSON parser
- Additional extension methods for sending responses
- [bug] RestServer not working on localhost HOT 1
- Prefixes.Add throw exception HOT 1
- Can you update to Nuget? HOT 1
- javascript modules
- Is it possible to use Grapevine in Windows Form apps? HOT 1
- Handling multiple GET request parameters HOT 1
- How can I get the request payload? HOT 1
- Can not run on window server when login with user domain
- Unable to embed ssl certificates.
- Parsing Form Data HOT 1
- Please provide assemblies with strong name HOT 1
- Access to RestServer in RestResources class HOT 1
- "Spelling issue: "too much slashes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grapevine.