The invention proposes a narrow-linewidth and high-performance tunable optical detector based on a non-periodic sub-wavelength grating, and relates to the technical field of photoelectron. The high-performance optical detector comprises a filtering cavity bottom lens (DBR), a filtering cavity, a filtering cavity top lens (DBR), an absorption cavity and a non-periodic sub-wavelength grating oblique reflection mirror from bottom to top. In the optical detector, the optical cavity length is changed by electric tuning or thermal tuning to achieve a selective tuning function of wavelength; and the non-periodic sub-wavelength grating inclined reflection mirror is used for achieving oblique reflection on incident light at different angles for many times, so that the incident light can be repeatedly absorbed by an absorption layer, and the high-speed and high-quantum efficiency performance of a device is achieved. The optical detector has the characteristics of narrow linewidth, high quantum efficiency, high frequency response bandwidth and the like, is easy to integrate and is tunable, and can be widely applied to the field of optical communication and optical signal processing.