Skip to main content
Question

Sudden performance issue with findAllWithCriteria

  • January 21, 2025
  • 3 replies
  • 70 views

LarsJ

Hi,

Running into an issue where findAllWithCriteria suddenly gets a magnitude slower than it normally is/Closing the file and re-opening it or restarting Figma resolves the issue for a while until it happens again

Here’s the sample code:

const start = Date.now();
const n = frame.findAllWithCriteria({
    sharedPluginData: {
        namespace: annotationNamespace,
        keys: [annotationKey],
    },
});
console.log('result', n.length, Date.now() - start, figma.skipInvisibleInstanceChildren);

Here’s the output when it works normally:

result 28 0 true
result 364 3 true
result 57 1 true

And this is the output after it starts to happen from my console.log:

result 28 18 true
result 364 1678 true
result 57 179 true

As you can see it goes from 0-3ms to 18ms - 1700ms, almost ~1000x the expected time.

The issue is relatively rare and I haven’t found any specific patterns that triggers it. It’s not related to the skipInvisibleInstanceChildren flag but seems to be more common in larger files and when doing a lot of changes.

Closing other applications or tabs in Figma to free up memory doesn’t seem to help, restarting the plugin doesn’t help either, only closing and re-opening the file with the issue fixes it.

Is this a bug in Figma and has anyone else run into anything similar?

3 replies

Gayani_S
Figmate
  • Community Support
  • 2145 replies
  • January 21, 2025

Hi ​@LarsJ, thank you for reaching out! I can see how frustrating this must be when it’s slowing down your workflow.

I’ve flagged this internally with the team to investigate further, and I’ll keep you updated as soon as I have more information. In the meantime, could you let me know if this behaviour occurs in both the browser and the desktop app? Additionally, have you tried clearing the cache to see if that makes any difference?

For the desktop app: Clear Desktop Cache

For browsers, here are guides for each:

I truly appreciate your patience while we work on this together, thank you! 


LarsJ
  • Author
  • New Member
  • 1 reply
  • January 22, 2025

Hi, thanks for looking into it. We mainly use the desktop app so I haven’t tried reproducing it in the browser, however I have been able to reproduce it across multiple devices, all of them are running Mac OS on Apple Silicon if that matters.

I will try clearing the cache to see if it resolves the issue and report back, thanks!

 


Gayani_S
Figmate
  • Community Support
  • 2145 replies
  • January 29, 2025

Hey ​@LarsJ, thank you for sharing these details with me and apologies for the delayed response! 
I’ve gone ahead and created a support ticket for you (#1241215) to get this looked into. 

Our support team typically responds within 24 hours, but due to higher contact volumes, there might be a slight delay. We truly appreciate your patience, and we’ll do our best to get this resolved for you as quickly as possible.

Please let me know if there’s anything else you’d like to add, thank you! 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings