From 55d840ea96f60b0e0ea6b57900a7bcc078d77143 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 11 May 2009 17:16:14 +0200 Subject: [PATCH] Add profile window around socket on_read. --- src/net.h | 2 ++ src/node.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/net.h b/src/net.h index 794b0a98db..680ff2fc0c 100644 --- a/src/net.h +++ b/src/net.h @@ -55,10 +55,12 @@ private: static void on_read (oi_socket *s, const void *buf, size_t len) { Connection *connection = static_cast (s->data); + v8::V8::ResumeProfiler(); if (len == 0) connection->OnEOF(); else connection->OnReceive(buf, len); + v8::V8::PauseProfiler(); } static void on_drain (oi_socket *s) { diff --git a/src/node.cc b/src/node.cc index 12b39d9f89..a7d9a8dc8c 100644 --- a/src/node.cc +++ b/src/node.cc @@ -248,6 +248,8 @@ main (int argc, char *argv[]) Local g = Context::GetCurrent()->Global(); + V8::PauseProfiler(); // to be resumed in Connection::on_read + Local node = Object::New(); g->Set(String::New("node"), node);