Nowadays self driving cars rely on many different sensors to percept the surrounding environment. The most relevant one is the LiDAR, which is exploited for mapping, localization, obstacle detection and so on. All those application can use clustering techniques in order to achieve better results. There exist several state of the art algorithm for clustering, for example K-Means, Hierarchical and DBSCAN, however none of them are compliant to real time requirements. This latter aspect is fundamental for autonomous vehicles, which can be seen as real time systems that need to respect deadlines. Our solution is an optimized clustering algorithm, which exploits parallelism and a clever point selection to massively drop computation times. This solution allows us to perform clustering online while fulfilling our real time needs.