You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some code. If I #[inline(always)] it, performance is fantastic (4,000,000 operations/sec)
Drawback: the code silently corrupts itself. I don't know exactly what it is but, when I #[inline(never)], the problem goes away but performance goes down to 500,000 operations/second
Is this normal even outside of this Rust compiler or is it a side effect of using the Rust compiler? Could it be detected?
If the compiler knows the maximum registers per thread is ~256 (or whatever) and with all this inlined code it surpasses 256 and something will get corrupted, could it fail so the user it not left running code that they don't realize is actually incorrect until much later?
I can provide more if desired. It is ed25519 code.
If I put no inline marker, it'll do the same behavior #[inline(always)] JIT wise I guess, which means "silent corruption" in my case.
I had to know ahead of time this code needs to not be inlined. Is there a #[volatile] or something I should be putting? Device fence mark? Thread sync?
The text was updated successfully, but these errors were encountered:
I have some code. If I
#[inline(always)]
it, performance is fantastic (4,000,000 operations/sec)Drawback: the code silently corrupts itself. I don't know exactly what it is but, when I
#[inline(never)]
, the problem goes away but performance goes down to 500,000 operations/secondIs this normal even outside of this Rust compiler or is it a side effect of using the Rust compiler? Could it be detected?
If the compiler knows the maximum registers per thread is ~256 (or whatever) and with all this inlined code it surpasses 256 and something will get corrupted, could it fail so the user it not left running code that they don't realize is actually incorrect until much later?
I can provide more if desired. It is
ed25519
code.If I put no inline marker, it'll do the same behavior
#[inline(always)]
JIT wise I guess, which means "silent corruption" in my case.I had to know ahead of time this code needs to not be inlined. Is there a
#[volatile]
or something I should be putting? Device fence mark? Thread sync?The text was updated successfully, but these errors were encountered: