ID 587883 - Nuke Studio/Hiero projects load and close slowly if they contain media with very long frame ranges

Follow

Problem summary:
Nuke Studio/Hiero projects load and close slowly if they contain media with very long frame ranges 
 
Customer reported version:
Hiero N/A
 
Customer reported platform:
Multiple
 
Steps to reproduce:
1) Launch Nuke Studio and open the Script Editor window.
2) Paste the following code into the Script Editor and adjust the file paths on lines 8 and 9.
3) Execute the code to create two sample projects, one with offline media that has very long frame ranges, and one with shorter frame ranges:

from hiero.core import MediaSource, Clip, BinItem from hiero.core import events import time hiero.core.closeAllProjects() #### Modify these paths to valid locations before running the code #### path_A = "/path/to/short_range_test.hrox" path_B = "/path/to/long_range_test.hrox" proj_A = hiero.core.newProject() proj_B = hiero.core.newProject() def makeOfflineClips(project, endFrame, quantity):     for i in range(quantity):         offline = MediaSource.createOfflineVideoMediaSource("/tmp/my_frame.######.exr", 1, endFrame, 24)         project.clipsBin().addItem(BinItem(Clip(offline))) def openCloseProject(path):     global startTime     startTime = time.time()     proj = hiero.core.openProject(path)     startTime = time.time()     proj.close() def projectTimer(event, mode=None):     global startTime, endTime     endTime = time.time()     duration = endTime-startTime     print(f"{event.project} {mode} in {duration} seconds") #Project setup and savingmakeOfflineClips(proj_A, 500, 10) proj_A.saveAs(path_A) makeOfflineClips(proj_B, 500000, 10) proj_B.saveAs(path_B) #Close projects and register timer event hiero.core.closeAllProjects() events.registerInterest('kAfterProjectLoad',projectTimer, mode="loaded") events.registerInterest('kAfterProjectClose',projectTimer, mode="closed") print("Projects created, proceeding to timing test") openCloseProject(path_A) openCloseProject(path_B)
4) Observe the output and note how the project that has offline Clips with very long frame ranges opens much slower (~120x) and closes much slower (~67x) than the project with shorter frame ranges:

 
Expected behavior:
The frame range of offline media should not impact the time it takes a project to load or close in Nuke Studio/Hiero. 
 
Actual behavior:
When .hrox projects contain Clips with long frame ranges, the project will open and close more slowly, even if the media is missing or does not exist.   
 
Workaround:
No known workaround at this time.
 
Reproduced by Support in:
Nuke Studio15.1v3 - Windows 10, macOS 14 Sonoma
Nuke Studio14.0v1 - Windows 10
Nuke Studio13.0v1 - Windows 10
Nuke Studio 12.0v1 - Windows 10
 
Earliest version tested:
Nuke Studio 12.0v1 - This issue appears to be in all tested versions of the product

    We're sorry to hear that

    Please tell us why