1
0
Files
electrum/electrum
наб 1ae2503014 custom_model: open-code QtCore.QAbstractItemModel.hasIndex()
The implementation is just
	bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent) const
	{
	    if (row < 0 || column < 0)
	        return false;
	    return row < rowCount(parent) && column < columnCount(parent);
	}
and yet it features as the most prominent part of the profile,
encompassing up to 25% of refresh()

Open-coding it makes refresh() 40% faster. Measurements from between
after wallet.get_full_history() and return from refresh()

Before:
	1.8637257907539606
	1.8563996930606663
	1.7696567592211068
	1.8933695629239082

After:
	1.3133591176010668
	1.3686819169670343
	1.2470976510085166
	1.2455544411204755
2025-07-01 03:32:43 +02:00
..
2024-09-18 15:48:38 +00:00
2025-06-12 21:02:58 +02:00
2024-05-30 13:08:13 +00:00
2025-05-26 15:31:08 +00:00
2025-05-28 10:42:59 +02:00
2025-02-19 14:29:02 +01:00
2025-04-02 16:21:59 +00:00
2025-06-26 14:10:18 +00:00
2025-06-29 22:25:56 +00:00
2025-04-23 16:09:31 +02:00
2024-11-29 17:09:29 +08:00
2024-04-24 14:14:31 +00:00
2024-05-20 16:57:11 +02:00
2023-12-04 14:15:39 +08:00
2025-04-23 16:09:31 +02:00
2025-06-26 14:10:18 +00:00
2025-06-13 16:50:58 +00:00
2025-06-29 22:25:56 +00:00
2025-05-28 10:46:00 +02:00
2025-04-23 16:09:31 +02:00