You can define and use mappings in memory in solidity using this library. Don't trifle with writing to storage when you need a mapping, use this memory library instead.
Read/write to the memory map is cheaper in gas than the analogue in storage. In best case read/write are O(log n).
See tests for example usage.
Not audited. Use at your own risk.
Support my work on this library by donating ETH or other coins to
0x1331DA733F329F7918e38Bc13148832D146e5adE