[Mlir-commits] [mlir] [MLIR] Add a second map for registered OperationName in MLIRContext (NFC) (PR #87170)

Mehdi Amini llvmlistbot at llvm.org
Mon Apr 1 14:28:13 PDT 2024


joker-eph wrote:

> Larger speedup than expected. What is size cost?

Less than the StringMap :)
I looked into removing the StringMap but it's annoyingly used by the C API lookup (queries for "is this op name registered").

The DenseMap storage is a std::pair, so basically 8 bytes for the typeID and the OperationName is also just a 8 bytes pointer to the actual Impl class.
So it's 16B per registered operation, knowing that the map double in size when it fills up to 3/4, and so it is bounded by 16*8N/3 byte per operation (or to be more exact it'll be somewhere between 21B and 42B per registered operation).


https://github.com/llvm/llvm-project/pull/87170


More information about the Mlir-commits mailing list