I know batchPlay is faster than the javascript API, but I was curious about the different flavors of the “get” command so here’s a quick perf test and not scientifically rigorous results…
I set up 4 tests, 1000 iterations each. I ran them on:
-
A group with a mask and child layers
-
A pixel layer
-
An embedded smart object with style fx on it
NOTES:
- getDescriptorSync retrieves ALL properties of the layer using “get” (BatchPlay)
- getPropertySync retrieves ONE specific property using “get” with target property (BatchPlay)
- getPropertiesSync retrieves MULTIPLE specific properties using “multiget” with 3 target properties (BatchPlay )
- The standard Photoshop DOM API retrieves ONE specific property
RESULTS (Group Folder)
-
getDescriptorSync(layerRef)
Total Time: 263.00ms -
getPropertySync(‘name’, layerRef)
Total Time: 101.00ms -
getPropertiesSync([‘name’, ‘index’, ‘layerKind’], layerRef)
Total Time: 104.00ms -
Native Photoshop API (photoshop.app.activeDocument.activeLayers[0].name)
Total Time: 742.00ms
======================================================================
RESULTS (Pixel Layer)
-
getDescriptorSync(layerRef)
-
getPropertySync(‘name’, layerRef)
-
getPropertiesSync([‘name’, ‘index’, ‘layerKind’], layerRef)
-
Native Photoshop API (photoshop.app.activeDocument.activeLayers[0].name)
======================================================================
RESULTS (Smart Object w FX)
-
getDescriptorSync(layerRef)
Total Time: 657.00ms -
getPropertySync(‘name’, layerRef)
Total Time: 76.00ms -
getPropertiesSync([‘name’, ‘index’, ‘layerKind’], layerRef)
Total Time: 109.00ms -
Native Photoshop API (photoshop.app.activeDocument.activeLayers[0].name)
Total Time: 576.00ms
======================================================================
Then ran it all through an AI analysis and here ya go!
Average Performance (across 3 different layer types):
1. getPropertySync: 0.0870ms per call
FASTEST
- Group Folder: 0.1010ms
- Pixel Layer: 0.0840ms
- Smart Object: 0.0760ms
2. getPropertiesSync: 0.1087ms per call (1.25x slower)
- Group Folder: 0.1040ms
- Pixel Layer: 0.1130ms
- Smart Object: 0.1090ms
3. getDescriptorSync: 0.5023ms per call (5.78x slower)
- Group Folder: 0.2630ms
- Pixel Layer: 0.5870ms
- Smart Object: 0.6570ms
4. Native Photoshop API: 0.6293ms per call (7.24x slower)
- Group Folder: 0.7420ms
- Pixel Layer: 0.5700ms
- Smart Object: 0.5760ms
Key Insights:
- getPropertySync is consistently fastest - winning in all 3 tests for single property access
- getPropertiesSync is only ~25% slower - excellent choice when you need 2-3 properties
- getDescriptorSync performance varies widely (0.26ms to 0.66ms) depending on layer complexity - slower for complex layers with more properties
- Native Photoshop API is surprisingly slow - averaging 7.24x slower than getPropertySync for the same single property access
Recommendation: Use getPropertySync for single properties, and getPropertiesSync when you need 2-4 properties. Only use getDescriptorSync when you need many properties (5+) to justify the performance cost.