I don’t want to speculate, given the minmal amount of information provided. But I would suggest you add the const qualifier to all pointers to read-only memory, and furthermore add restrict if pointers are for non-overlapping and non-aliases memory objects.
Assuming both table are read-only, you would wind up with
So I made some other tests, and I think the speed loss come from the size of the code. Indeed, if I comment around 30 useless lines in my code and delete one parameter of my function, I earn some execution time.
By the way, is there a limit in the size of the parameter of the function to not lost time. I mean does the copy of all data needed for the function (parameters, function address) are made in the same time according to the size of the bus? (I don’t know if I am clear, I tried my best !).