July 6, 2017

.search method performance

Performance improvement

The .search() method is quite useful to understand what you have on the model, but the response time can increase really fast! Imagine if you need to perform multiples searches? But there is a better way: use " (quotes) on your search string. On the image below, we can see how the performance increased by 4! Sure, with quotes it will search for the entire string only, but that might be the case, right? This sample is also restricting the search to "Name" attribute, as per last parameter (an array)

.search method performance

Depending on how big the model is and how many spaces you have on the search string, this difference can be from a couple seconds (with quotes) to a few minutes (without quotes)! 

As you can see on the image, you can run code on the browser console! This is quite useful for quit testing. 

Related Posts

May 10, 2019

Consume AEC Data which are from Model Derivative API

Model Derivative API has been able to extract AEC data of Revit model such as level, grid, views, phase, linked documents etc. And Forge Viewer also provides the corresponding methods ...

Read More

May 9, 2019

Basic point clouds in Forge Viewer

Developers often ask us whether point clouds are supported in Forge Viewer. Unfortunately, the official answer is "no".

Read More

May 9, 2019

Quick deployment of Forge applications to Azure

Microsoft Azure has recently introduced Azure Resource Manager (or ARM) - a service for

Read More