[SR-12716] The "let-accepting" withUnsafeBytes(of: _:) added by SE-0205 is sometimes much slower than the var-taking old version #55161
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
performance
Environment
Default toolchain of Xcode 11.4.1
macOS 10.15.4
Additional Detail from JIRA
md5: 1a81c1cec9ebced6640e3ddcf5790c34
Issue Description:
Compiling (release build / -O) and running the following program will print:
Note that `new` is slower than `old`.
The `new` function is using the let-taking variant of `withUnsafeBytes`, added in SE-0205.
I guess this is not expected behavior (the slow down as compared with the old var-taking `withUnsafeBytes`)?
(If `_E.lut` is smaller, eg only two `UInt64` values, they will be equally fast.)
Context: https://forums.swift.org/t/optimal-way-to-create-a-static-lookup-table/36011/10
The text was updated successfully, but these errors were encountered: