Awaiting feedback DirectoryIterator significant performance degradation compared to native functions

Painbaker

Well-known member
Affected version
2.3.4
Having hundreds of installed add-ons on causes progressive performance degradation not related to add-ons code.

I did some debugging and bottleneck profiling and found that the root cause of the problem was DirectoryIterator which is used when traversing addon files in performance-critical places like XF\AddOn\Manager, XF\DevelopmentOutput\DevelopmentOutput and XF\Cli\Runner

Even though an NVMe 1.4 drive is used with high iops, SPL functions has slower execution compared to native readdir/opendir functions:

1735817244278.webp
1735817255080.webp
 
I assume this is a somewhat rare side effect of having over 600 add-ons on one XF install for development purposes?

In that context, I agree a 600% speed increase might be useful, but I would expect this change would likely be saving milliseconds for most customers, rather than seconds.
 
Is the DirectoryIterator called at any point during an end-user operation such as browsing the forum? Or is it only during admin/developer operations such as managing addons or running CLI tasks?
 
Back
Top Bottom