1. time profiling
- Posted by useless Aug 20, 2009
- 896 views
I wrote a quicky http proxy which handles GET and POST in Eu4.b.
It's taking more time to retrieve and pass the page to the browser than i expected. I tried "with profile" and got only a line execution count, with no surprises there. I tried "with profile_time" and got no times on any line except for lines containing "puts(1...)".
Do i need to bracket stuff with code using time() and profile manually? Or ami missing something because the /docs/ and /search are down?
useless
2. Re: time profiling
- Posted by mattlewis (admin) Aug 20, 2009
- 822 views
I wrote a quicky http proxy which handles GET and POST in Eu4.b.
It's taking more time to retrieve and pass the page to the browser than i expected. I tried "with profile" and got only a line execution count, with no surprises there. I tried "with profile_time" and got no times on any line except for lines containing "puts(1...)".
Do i need to bracket stuff with code using time() and profile manually? Or ami missing something because the /docs/ and /search are down?
It's hard to say without seeing the code. In general, it doesn't surprise me that I/O is your bottleneck. The time profiling uses samples to figure out where time is being spent. Your results suggest to me that your program is running pretty quickly, so there's just not that much to sample.
If that's the case, then using time() probably won't tell you a lot more than you already know.
Matt
3. Re: time profiling
- Posted by useless Aug 20, 2009
- 812 views
Matt, i discovered the Content-Length being sent by the server was wrong, so another call to eunet_recv() was being made, wasting 16 sec while it timed out. I haven't fixed that problem, prolly can't, but i switched to a server with good numbers, and now fetch and send small webpages in under one second.
useless