Description

Alembic Geometry Cache import waits ~50 ms per frame with every thread asleep (FAbcFile::ProcessFrames)

Importing an Alembic file as a Geometry Cache takes about 50 ms per frame no matter how small the mesh is. A 100-vertex, 128-frame file (173 KB) takes 6.0 s to import; the same import takes 0.05 s when the editor is started with -noperfthreads. During those 6 s the process uses 0.15 s of CPU.

The time goes into FEvent::Wait(100) timeouts in the multi-threaded branch of FAbcFile::ProcessFrames: the reader threads hand over the turn to write the next frame through one shared auto-reset event, and the wake-up often goes to a thread that cannot use it.

ANALYSIS
Engine/Plugins/Importers/AlembicImporter/Source/AlembicLibrary/Private/AbcFile.cpp, FAbcFile::ProcessFrames (line 562), called for geometry caches from AbcImporter.cpp:462.
Unless bSingleThreaded is set (lines 565-566), frames are read by NumWorkerThreads = Clamp(GetNumWorkerThreads(), 1, MaxNumberOfResidentSamples) bodies of a ParallelFor (line 597; MaxNumberOfResidentSamples is 8, AbcObject.h:23). Body k reads frames k, k + N, k + 2N... and the frames are written strictly in order:
 // Read frame data into memory
  ReadFrame(FrameIndex, InFlags, ThreadIndex);
 // Wait until it's our turn to process this frame.
  while (WriteFrameIndex < FrameIndex)
  

{     FrameWrittenEvent->Wait(100);         // line 615   }

  

{     FScopeLock WriteLock(&Mutex);     InCallback(FrameIndex, this);     ++WriteFrameIndex;     FrameWrittenEvent->Trigger();         // line 627   }

FrameWrittenEvent comes from FPlatformProcess::GetSynchEventFromPool() (line 589), whose bIsManualReset parameter defaults to false, so it is an auto-reset event: one Trigger() lets exactly one Wait() return (PThreadEvent.h:129-150).

Up to seven bodies wait on that one event, each for a different value of WriteFrameIndex. Nothing makes the trigger reach the body that owns the next frame. When another body takes it, it sees it is not its turn and waits again; the trigger is gone, and the body that could write stays in Wait(100) until its timeout expires. Each misdirected trigger costs up to 100 ms with every thread asleep. The timeout is what keeps the loop from hanging.

This reading comes from the source and matches the measurements above. We did not capture thread stacks, and -noperfthreads turns off other threading as well, so it is not a perfectly isolated control.

IMPACT ON PRODUCTION DATA
Character caches from a shot, 104 frames each, imported headless the same way (Geometry Cache through UAssetImportTask), seconds per import:
  Cache    Vertices .abc size Default -noperfthreads
  Character A   4.8k  0.33 MB   5.2      0.37
  Character B   6.5k  0.50 MB   6.4      0.55
  Character C   5.6k  0.92 MB   3.8      0.75
  Character D    35k   4.1 MB   12.8       8.8
  Character E    35k   70 MB   11.8      44.9

In the interactive editor the 21 caches of that shot took 169 s to import; the 17 light ones (A to C are three of them) took 99 s, 5.8 s each.

Reading in parallel does pay off for a heavy cache (E), so -noperfthreads is not a workaround, and the import settings offer no way to choose the single-threaded branch: UAbcImportSettings::NumThreads is not a property and every import overwrites it with the number of cores (AlembicImportFactory.cpp:178-185, AbcImporter.cpp:136).

Steps to Reproduce

In the attached zip file:

  • abc_import_stall_repro.py
  • abc/ (7 synthetic Alembic files, 8.6 MB in total)
  • make_test_alembics.py (how the files were written)
  • blank_project/AbcStallRepro.uproject (an empty project with the Python Editor Script Plugin and the Alembic Importer enabled).
  1. Run the script headless:
    UnrealEditor-Cmd "<folder>/blank_project/AbcStallRepro.uproject" -run=pythonscript -script="<folder>/abc_import_stall_repro.py"
  2. Run it again adding -noperfthreads.

The script imports each file three times as a Geometry Cache with the default UAbcImportSettings through UAssetImportTask, and prints the median wall-clock time of the import call and the CPU time the process used meanwhile. The second run also prints both modes side by side. Nothing is saved.

Each file holds one PolyMesh, a grid whose points change on every frame, at 24 fps.

ACTUAL RESULT

Seconds per import, median of three:
File Vertices Frames Default Default -noperfthreads
wall CPU wall
grid009_f008.abc 100 8 0.21 0.01 0.01
grid009_f016.abc 100 16 0.62 0.02 0.01
grid009_f032.abc 100 32 1.43 0.04 0.02
grid009_f064.abc 100 64 3.05 0.08 0.03
grid009_f128.abc 100 128 6.00 0.15 0.05
grid032_f128.abc 1,089 128 6.07 0.69 0.59
grid064_f128.abc 4,225 128 6.66 2.70 2.53

  • The default time follows the number of frames (45 to 52 ms per frame from 32 frames up) and barely changes between 100 and 4,225 vertices.
  • The individual imports of the 100-vertex files land on multiples of 0.1 s: 0.11, 0.21, 0.21 (8 frames); 0.71, 0.61, 0.62 (16); 1.43, 1.53, 1.43 (32); 3.05, 2.85, 3.25 (64); 6.40, 5.59, 6.00 (128).
  • While grid009_f128.abc was importing, "top -H" over 5 s showed all 57 threads of the process sleeping, with 2.6 % of one core used in total.
  • With -noperfthreads wall time and CPU time are equal in every row.

The numbers were taken with -nullrhi -unattended and an in-memory DDC.

EXPECTED RESULT
The import of a small cache takes about as long as the work it does: tens of milliseconds for the 100-vertex files, not seconds.

ENVIRONMENT

  • Unreal Engine 5.8.3, CL 58210709 (++UE5+Release-5.8), installed build, stock Alembic Importer plugin
  • Linux (Oracle Linux Server 9.6, kernel 5.14), 30 logical cores
  • Not tested on Windows or macOS
  • The same loop is in the 5.3.2 source of the plugin (read only, not measured there

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-417489 in the post.

0
Login to Vote

Fixed
ComponentUE - VEI - Open File Formats
Affects Versions5.8
Target Fix45.00
Fix Commit61122459
CreatedNov 24, 2026
ResolvedNov 27, 2026
UpdatedDec 4, 2026
View Jira Issue