+ it's definitely due to the alignment of instructions. This changes everything. The prefetch works as expected and is not the (main) reason for this behavior it seems.
@old_timer Thank you so much for your effort! Sorry, was night time over here. Holds true for different r1. The padding nops are indeed part of the function body, so have to be executed. They are only executed once though (as opposed to the rest which traverses a vast number of loops) so I'd say the nop influence in the prologue can be neglected.
@PeterCordes Aligning that label with .p2align 4 makes it perform worse (see edit) I think we can now agree with prefetch issues due to code size and alignment. Still very weird behavior.
@old_timer check my edits, padding definitely seems to change something! For a weird reason, adding padding also changes the run time of the non-padded function. Plus if I run each one on their own, they both perform well!
Yeah, they are using speculative instruction fetches. Thing is, both of these functions reside in flash and aren't loaded into RAM. Still, there is a discrepancy. For what it's worth, the same thing can be observed with equal machine code functions residing in two different RAM regions, but that's another thing for later ...
Thanks. Will keep that in mind for next time. According to the disassembly, there is no prologue generated anyway and the epilogue branch is redundant, doesn't do anything though (as noted in the code comment)
I route HTTPS requests (port 443) to a port that is listened to by a python server/socket - can I somehow access the "target" IP of the HTTPS request? @Inhale.Py
I'm a total beginner in Python so please bear with me. Following situation: IPTables -> HTTPS request listened to by Python socket. Can I somehow get the original HTTPS request's IP/Domain?
<code>+ (NSDate *)date { return [NSDate dateWithTimeIntervalSince1970:0]; }</code> This, well, returns the date of 1970 (beginning of UNIX-Time). To change the test date, just modify the return-statement. (If I have understood your question correctly)
Here is another possible solution: Create a NSDate category, that overrides + (NSDate *)date with your proposed test-date and only #import this category for testing purposes. Taking this approach, you don't have to change anything in your main code.
Seems dirty, but you could just use your own [NSDate mockDate] everywhere, and for test cases just return your own date. In all other cases it should simply return [NSDate date]