Austin Heller on Nostr: I'm so confused why my #rust function takes so long to return. I have an ...
I'm so confused why my #rust function takes so long to return. I have an Instance::now() before the call, I have an Instance::now() in the very start of the method, it does a lot of stuff, I println the method's Instance elapsed.as_micros(), return the Result<Vec<T>> with one small item in it, and finally println the outer Instance elapsed.as_micros(). I'm seeing an extra 7,000 microseconds between both of them. Why??
#rustlang
Any suggestions on how to do proper performance tuning with Rust would be appreciated.
Published at
2024-01-05 01:06:34Event JSON
{
"id": "02a69d9a3c8687c8a40f6b744e0b61f93d9bca6e25f68fc03349dfb2dbedd994",
"pubkey": "a5386d19eba6aee42b9283bc23debde449aa89e9774f0c9d11c59f30380da8b1",
"created_at": 1704416794,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"t",
"rustlang"
],
[
"proxy",
"https://universeodon.com/users/livingcoder/statuses/111700659030708559",
"activitypub"
]
],
"content": "I'm so confused why my #rust function takes so long to return. I have an Instance::now() before the call, I have an Instance::now() in the very start of the method, it does a lot of stuff, I println the method's Instance elapsed.as_micros(), return the Result\u003cVec\u003cT\u003e\u003e with one small item in it, and finally println the outer Instance elapsed.as_micros(). I'm seeing an extra 7,000 microseconds between both of them. Why??\n#rustlang \n\nAny suggestions on how to do proper performance tuning with Rust would be appreciated.",
"sig": "cde7ba9d883b5b0ceb91f456684c3d537681cc60d39a342fa3ca3f9de4d25ffbbe1a65efaf648a4fb5c3d0b1d80480902386e7b31127b0f4246f2bc1541683f0"
}