Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:22:30+00:00 2026-06-06T05:22:30+00:00

I have a weird question. After profiling my code several times with NYTProf. I

  • 0

I have a weird question. After profiling my code several times with NYTProf. I have a slow piece of code that seems like it should be very fast?

if($my_var){
# spent 112s making 25764253 calls to DBI::st::fetch, avg 4µs/call

with the line taking 187sec to run? The code in the if statement does use bind variables, but $my_var is not one of them. And even if it is why?

Is the pro-filer just buggy and picking something else up? This statement is inside a

while($sth->fetch)

loop, but there is some code in between the 2 statements, and that code is fine. In fact all if statements inside the code seem unreasonably slow?

Just looking for any help I can get. I cant post the whole code. but some pseudo-code bellow:

use DBI;
my $dbh = <new mysql connection>;
my $sth = $dbh->prepare('SELECT A, B, C FROM D');
$sth->execute();
$sth->bind_columns(\my($a,$b,$c));
while($sth->fetch){
    #do some fun stuff here.
    my $d = $hash_lookup{$c} // 0;
    if($d){
       #do some more fun stuff here. This is where DBI::st::fetch is apparently being called?
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:22:32+00:00Added an answer on June 6, 2026 at 5:22 am

    Known bug:

    Time spent evaluating a while condition can be misattributed to the last statement of the while loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi this may seem like a weird question, but here's my situation: I have
This may be a weird or stupid question, but I have the following code
Hi guys I have a weird question, I have a cli php script runs
Well,i have a weird question to ask,sometimes when designing a form and using lots
Weird question this, going round in circles. I have 2 pages. Page 1. Has
This may sound a weird question, I have a page which has a link:
OK, this is a slightly weird question. We have a touch-screen application (i.e., no
I have another Richfaces question which may seem rather weird. I am developing a
Now if that isn't a weird question, I don't know what is. But here
This is a weird question inasmuch as I've definitely had projects that work fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.