-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
During the design phase of JIT Hardware Intrinsics compiler bits one inefficient, temporary algorithm was allowed to be used for searching for intrinsics function names/ids. The naive search algorithm currently used works in O(n) time for each intrinsic imported, while it is possible to do this search in O(1) with very low constant overhead. Usually, this problem is hitting particularly hard in functions that use multiple intrinsics instructions since the search time is equal to t = number_of_intrinsics_used * O(n). This is particularly exacerbated in applications that require fast startup time: cloud lambda functions, command-line tools i.e. PowerShell Core.
The function implementing an algorithm which slipped to the release is the following:
and the algorithm used:
Previously discussed solutions included using a hashtable or/and creating fast binary preselection due to the fixed nature of search terms.
@AndyAyersMS @CarolEidt @fiigii @tannergooding
category:implementation
theme:vector-codegen
skill-level:beginner
cost:small
impact:medium