KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Academy Advanced Capstone 2.5

  • Advanced Capstone 2.5

    Posted by anduhau on October 30, 2023 at 12:00 am

    Hello! Could anyone provide, please, some advice on how to proceed with exercise 2.5? Should I go on Scratchpad and press Profile as in the picture shown here? Moreover, am I doing this in order to see the code behind the function?

    anduhau replied 3 months, 2 weeks ago 2 Members · 4 Replies
  • 4 Replies
  • Laura

    Administrator
    October 30, 2023 at 12:00 am

    Hi  ,

    Yes, exactly. Right click and click on profile as described in the question.

    This will take you to the visual profiler where you can execute the function to see where the “bottleneck” is. It will show how long each part of the function takes, and your task is to update the code and and improve the time the function takes to run.

    Thanks,

    Laura

  • anduhau

    Member
    October 30, 2023 at 12:00 am

    Alright!

    I see this database about the function. However, I do not what that function does, or how I could access the code inside the function from here (screenshot attached).

  • Laura

    Administrator
    October 30, 2023 at 12:00 am

    ,

    The profiler just tells you where the most time and memory in the function is being spent.

    Your task is to work out what each part of the function is doing and update the code within to improve upon the time while ensuring the function still works as designed.

    You can view the code back in Developer, by either executing the function name with no square brackets e.g.

    .viz.createDashboard

    or on the left hand side of Developer in your workspace tree, under AdvancedCapstone.Visualization

    Hope this helps,

    Laura

  • anduhau

    Member
    October 30, 2023 at 12:00 am

    Dear Laura,

    Thank you for letting me know! I made some changes and the function worked initially. However, after I saved the changes, closed and opened the workspace again, it showed me again that the execution speed was not high enough.

    I have performed the following changes in the main file:

    // your code here or work in scratchpad 
    system"l ",getenv[`AX_WORKSPACE],"/AdvancedCapstone.Setup/dbmaint.q" 
    setattrcol[`:.;`sensor;`lapId;`g] 
    setattrcol[`:.;`sensor;`sensorId;`p]

    I have changed the code in the .viz.getModSensor as well:

    select from sensor where date in 2020.01.01 2020.01.02, sensorId in symbols, 0=lapId mod 2

Log in to reply.