datasheet should say everything you need about interrupt latency.
If memory serves me right, when an interrupt condition arises the current instruction finishes excecution,
it is then followed by a NOP, while the current value of the program counter is pushed onto the stack
and then the instruction at address 04h is excecuted.
i bet that the reason you are seeing a lot of latency is because the compiler is performing context saving (and then restoring) in software.
it should be obvious once you look at the disassembly listing file
i don't know about CCS but there is a way in XC8 to "zero" the latency that doesn't involve programming all the ISR in assembly: ISR is just another function placed at a specific address, then you create a section containing only asm("GOTO xxxx"); with the function address and tell the linker to place this section at 04h
unfortunately i don't remember the correct keywords to search for this, i'll look if i still have a project where i used this method
so, i found this in a project with a PIC18, but you should get the idea..
/* Interrupt Vector Relocation */
#asm
GLOBAL _intHroutine ;
GLOBAL _intLroutine ;
#endasm
void intHroutine() @0x008 {
asm("GOTO 0x808");
}
void intLroutine() @0x018 {
asm("GOTO 0x818");
}
/* =========================== */
i used this in a bootloader (which used no interrupts) to relocate the interrupt vector.. the application would start at address 800h and by doing this the PIC interrupt vector was just a goto to the application interrupt vector, otherwise it would have been surrounded that pointless context saving