Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop Insight freezes when trying to visualize a decision tree with 22 branches #1142

Closed
nwokafor-choongsaeng opened this issue Feb 13, 2024 · 2 comments
Assignees
Labels
morphir-web task Task level project item

Comments

@nwokafor-choongsaeng
Copy link
Contributor

nwokafor-choongsaeng commented Feb 13, 2024

Describe the bug
When trying to visualize a decision with over 20 branches on the develop UI, the browser stops responding.

To Reproduce
To reproduce this behavior, setup a Morphir project and try visualizing this function.

longDecisionTree: String -> Int
longDecisionTree string = 
    if string == "1" then 
        1
    else if string == "2" then
        2
    else if string == "3" then
        3
    else if string == "4" then
        4
    else if string == "5" then
        5
    else if string == "6" then
        6
    else if string == "7" then
        7
    else if string == "8" then
        8
    else if string == "9" then
        9
    else if string == "10" then
        10
    else if string == "11" then
        11
    else if string == "12" then
        12
    else if string == "13" then
        13
    else if string == "14" then
        14
    else if string == "15" then
        15
    else if string == "16" then
        16
    else if string == "17" then
        17
    else if string == "18" then
        18
    else if string == "19" then
        19
    else if string == "20" then
        20
    else if string == "21" then
        21
    else if string == "22" then
        22
    else if string == "23" then
        23
    else if string == "24" then
        24
    else 
        0

Expected behavior
Expect longDecisionTree to visualize without any issues.

Environment

  • OS: Windows 10
  • Browser: chrome (Version 120.0.6099.225)
  • Morphir Version 2.87.6

Additional context
This problem doesn't occur in Morphir version 2.83.0, and even the current version (2.87.6) works fine for 15 branches or less but starts to show observable lags as branches increase above 17

@nwokafor-choongsaeng nwokafor-choongsaeng added the task Task level project item label Feb 13, 2024
@bekand bekand self-assigned this Feb 14, 2024
@bekand
Copy link
Contributor

bekand commented Feb 14, 2024

This was caused by expensive functions producing UI content being evaluated even if that content is not being shown. I've opened a PR addressing the issue.

@bekand
Copy link
Contributor

bekand commented Feb 15, 2024

#1143 fixes this.

@bekand bekand closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
morphir-web task Task level project item
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants