Announcement

Collapse
No announcement yet.

How much do these functions/processes weigh, as in, how processor intensive are they?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ILoveHostasaurus
    replied
    I don't think I'd rely on data from Ivo almost 15 years after the fact; it's easy to test with logging and mvprof.

    Leave a comment:


  • Kent Multer
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    #2

    Really? Maybe its bad memory but in my head is an old post from the icon Ivo Truxoff, who did a test. I think he used about 1,000 instances of 'x' CIN y compared to tolower('x') IN y and the later was at least %20/%30 faster.
    We haven't heard from Ivo in quite a while. The tests you're thinking of may have been done with the earlier, non-compiled version of the VM.

    Leave a comment:


  • ILoveHostasaurus
    replied
    You would do roughly this:

    https://www.miva.com/forums/forum/de...ript-debug-log

    which breaks down to:

    1) Set your Empresa or Mia to have cookie-based logging, or just log everything if it's not a production website or internet accessible
    2) Place diagtool.mvc on the site to assign your browser a unique cookie name matching what you set the log cookie to
    3) Remove any prior log
    4) Perform the request to the script you want to profile
    5) Copy out the log before making any further requests
    6) Run mvprof against the log file to generate the report on the functions that were called, iterations, time consumed by processing, etc.
    7) Turn off logging when done

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    ah, that makes sense. sure is easier to type. :)

    Leave a comment:


  • dcarver
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    #2

    Really? Maybe its bad memory but in my head is an old post from the icon Ivo Truxoff, who did a test. I think he used about 1,000 instances of 'x' CIN y compared to tolower('x') IN y and the later was at least %20/%30 faster.
    I could be wrong, but I would imagine CIN would be faster because that automatically lowers the values for you and saves you 2 function calls to tolower() at the MivaScript level. So it saves you those function calls and their overhead to call them.

    Leave a comment:


  • ids
    replied
    David,

    You could use mvprof to profile your code and see what is taking the most amount of time.
    OK, found the programs, Thanks Scot.

    Nothing seems to be obvious. What is the typical usage? For example, If I wanted to run these utils(mvcov, mvprof) on "mycompiledmodule.mvc."

    Scott


    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    #2

    Really? Maybe its bad memory but in my head is an old post from the icon Ivo Truxoff, who did a test. I think he used about 1,000 instances of 'x' CIN y compared to tolower('x') IN y and the later was at least %20/%30 faster.
    Last edited by Bruce - PhosphorMedia; 12-01-20, 10:38 AM.

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    Looks like MvPROF is a windows tool:

    https://docs.miva.com/videos/install-the-compiler

    Is there one for linux?

    Leave a comment:


  • ids
    replied
    David,

    You could use mvprof to profile your code and see what is taking the most amount of time.
    MvProf? I don't recall if I've heard of it. What? When? Where? How? etc...

    I've had recent needs for a tool like this.

    Scott

    Leave a comment:


  • dcarver
    replied
    1. I would avoid using miva_variable_value as much as possible. The engine has to parse the string you pass to it every time and lookup the variable. If you are able to use MvREFERENCEARRAY or similar all the parsing is done at compile time instead of runtime. With that being said, unless you are running miva_variable_value tens of thousands of times per page load I don't think you'll see too much of an impact.
    2. <x> CIN <y> is probably going to be technically faster but you'd never be able to measure it.
    3. They are essentially the same concept and you'd again probably never be able to measure a difference. Using the COUNT attribute on MvFOREACH would help out if you're using that tag a lot.
    4. There shouldn't be an difference really.
    5. Probably not going to be a big difference again unless you're doing a ton per page load.
    You could use mvprof to profile your code and see what is taking the most amount of time.

    Leave a comment:


  • How much do these functions/processes weigh, as in, how processor intensive are they?

    I'm curious about how much the empressa engine has to work on the following:

    1. To use miva_variable_Value(...) a lot

    2. To use "l.something CIN l.something_else" or "tolower(l.something) IN tolower(l.something_else)"

    3. MvWHILE vs MvFOREACH

    4. Using a lot of big global variable structures vs passing local reference variables to functions

    5. Using readytheme content sections vs executing compiled page templates

    Is there a document or something that shows all the miva functions/tags listed in order of how "heavy" they are for empressa to deal with? I am curious about what the most heavy processes are so I can avoid them if possible in my coding.
Working...
X