Menu

#6 getField slow when pulling large attachments from PR

open
None
5
2004-03-09
2003-11-14
No

As described in the Help forum by alacouture, calling
getField on a PR with a large attachment (1.5 MB) takes
a long time (2 minutes at 100% CPU utilization).

Discussion

  • Jim Searle

    Jim Searle - 2004-03-09
    • assigned_to: nobody --> jimsearle
     
  • Jim Searle

    Jim Searle - 2004-03-09

    Logged In: YES
    user_id=568459

    Actually, the problem seems to be in the PR setFromStringMethod.
    Specifically this:
    #get rid of trailing cr/lf
    if ($val =~ /(.*)\015\012$/ms) {
    $val = ;
    }
    this confuses me the '/ms' options are:
    m=treat string as multiple line
    s=treat string as single line
    I don't understand why both are specified?

     
  • Jim Searle

    Jim Searle - 2004-03-09

    Logged In: YES
    user_id=568459

    I think changing the above 3 lines to:
    $val =~ s/\015\012$//;
    has the same affect?

    But I'm not sure how to test it.

     
  • ironhorse

    ironhorse - 2004-04-07

    Logged In: YES
    user_id=1016120

    I had a case where while looping over multiple PRs of a
    list, a small list of two PRs would work fine, but a larger
    list would stop on the same PR (as in the smaller list)
    while trying to execute

    if ($val =~ /(.*)\015\012$/ms) {

    in SetFromString. I don't know why the same PR works in a
    small list and does not work in a big list. I only found
    this issue after applying my own fix, which was to make the
    code be like this:
    if ($field ne 'Unformatted') {
    if ($val =~ /(.*)\015\012$/ms) {
    $val = $1;
    }
    }

    I did this because my site doesn't use the unformatted field
    for anything other than attachments, and I don't want cr/lf
    stripped from attachments, especially since some are binary,
    as was the case that caused me a problem.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.