search

Home  >  Q&A  >  body text

ios The time it takes to call a function in a for loop is gradually reduced

The following is the code and time-consuming screenshot

I call a C language function in a for loop. It takes a long time at first, then it decreases with each call, and finally stabilizes within a small range.
How to explain this situation? Is it optimization of the iOS platform or something else?
Thank you very much~

巴扎黑巴扎黑2749 days ago595

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-17 10:08:20

    It should be related to method caching. You can understand this process from objc_msgSendmessage distribution.

    reply
    0
  • Cancelreply