Content-based publish/subscribe systems are widely used in many fields. Event matching is the core component to achieve fine-grained content-based data distribution. Many efficient algorithms have been proposed to improve event matching performance. However, in large-scale content-based publish/subscribe systems, event matching is still the performance bottleneck of the entire system due to the need to perform a lot of operations, such as additions, comparisons and bitmarkings. In this paper, we explore to convert various nonlogical operations into efficient logical ones, and propose a bitsetbased optimization paradigm (BOP) for matching algorithms. On the one hand, BOP can eliminate expensive operations in the matching process, greatly improving matching performance. On the other hand, BOP can stabilize the performance of matching algorithms, ensuring the quality of service of data distribution. We apply BOP to optimize two existing matching algorithms, namely TAMA and REIN. The experimental results show that BOP shortens the matching time of TAMA and REIN by more than 60%. In addition, the performance of optimized versions is more stable than the original matching algorithms.