From 554d48465f31b0e073f2c53a09ed9851f8b3e692 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Wed, 7 Feb 2024 17:15:16 +0000 Subject: Pass functors as rvalues when possible On local compiles I saw that DeleteAllImpureWhich was the third most time consuming method, using pprofs sorting in bottom-up. By passing the functor it uses as rvalue, the method speeds up ~10% and it drops from the third most time consuming to the fourth. The other modified methods in the CL are not showing up in the pprof profile that I took, but changing them to use rvalues shouldn't affect them negatively. Test: Locally compile, take a trace, and observe time spent Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I6c363d5601fd4865f4e7881e64b883bd6bbedb69 --- compiler/optimizing/stack_map_stream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/optimizing/stack_map_stream.h') diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h index 8c7b1c01a7..a3daa29b4e 100644 --- a/compiler/optimizing/stack_map_stream.h +++ b/compiler/optimizing/stack_map_stream.h @@ -110,7 +110,7 @@ class StackMapStream : public DeletableArenaObject { // Invokes the callback with pointer of each BitTableBuilder field. template - void ForEachBitTable(Callback callback) { + void ForEachBitTable(Callback&& callback) { size_t index = 0; callback(index++, &stack_maps_); callback(index++, ®ister_masks_); -- cgit v1.2.3-59-g8ed1b