From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6066 invoked by alias); 10 Nov 2004 16:20:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6019 invoked by uid 48); 10 Nov 2004 16:20:21 -0000 Date: Wed, 10 Nov 2004 16:20:00 -0000 Message-ID: <20041110162021.6018.qmail@sourceware.org> From: "ron_hylton at hotmail dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040312233606.14563.paulthomas2@wanadoo.fr> References: <20040312233606.14563.paulthomas2@wanadoo.fr> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/14563] new/delete much slower than malloc/free because of sjlj exceptions X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg01259.txt.bz2 List-Id: ------- Additional Comments From ron_hylton at hotmail dot com 2004-11-10 16:20 ------- (In reply to comment #40) > Ron, can you please attach your testcase that shows the problem to this PR? > > This PR is a regression on cygwin because the speed is back with 3.2. This is the test case I was using: #include #include #include #include using namespace std; int main() { int array_size = 100; int loop_count = 3000000; try { long t1 = clock(); for (int iloop = 0; iloop < loop_count; iloop++) { int *myarray = new int [array_size]; delete [] myarray; } long t2 = clock(); double delt1 = (double)( t2 - t1 )/ (double)(CLOCKS_PER_SEC); cout << "done looping time 1=" << delt1 << endl; long t3 = clock(); for (int jloop = 0; jloop < loop_count; jloop++) { int *myarray = (int *)malloc(array_size * sizeof(int)); if (myarray== NULL) { printf("alloc failed\n"); exit(1); } else free (myarray); } long t4 = clock(); double delt2 = (double)( t4 - t3 )/ (double)(CLOCKS_PER_SEC); cout << "done looping time 2=" << delt2 << endl; } catch (...) { cout << "exception" << std::endl; return 1; } return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14563