How can I estimate the difference in performance of a HashMap lookup vs List iteration in Kotlin?

I am working on an application that needs to map pdf documents to corresponding json data files (see: Kotlin data structure for efficient lookup of nested data for more details). In trying to implement a solution, I encountered a more broad question about how to estimate the expected performance of a search function.

Let’s suppose I have a nested data structure (see below). For each of my incoming pdfs, I want to find the corresponding data object that matches certain parameters. There are two potential approaches here. The first is to simply use the data as-is, iterating down through each item until a match is found. The other option is to convert the data into an indexed data structure like a HashMap with the fields I want to match against as keys.

The first approach is going to take longer (on average) to find a match. The second approach is going to be more efficient per search but requires the initial overhead of iterating through the entire data structure once to build the map.

I know the exact answer is going to depend on the total size of the dataset, how deeply it is nested, and how many searches need to be done. However, I feel like it should be possible to get at least a rough estimate of which approach is better for a given data set. Is there a technique or rule of thumb for determining when it is worth the initial overhead to construct an indexed data structure?

For reference, here is an example of the class structure of the deserialized data.

internal data class Idoc(@SerializedName("FileId") val fileId: String, @SerializedName("Student") val students: List<Student>)

internal data class Student(@SerializedName("Id") val id: String,
                            @SerializedName("SchoolId") val schoolId: String,
                            @SerializedName("Name") val name: String,
                            @SerializedName("Documents") val documents: List<Document>)

//Although owners is structured as a list, there will only ever be one Owner per Document      
internal data class Document(
    @SerializedName("Year") val documentYear: String,
    @SerializedName("Code") val imageCode: String,
    @SerializedName("DocumentOwner") val owners: List<DocumentOwner>,
)

internal data class DocumentOwner(@SerializedName("FirstName") val firstName: String,
                                  @SerializedName("LastName") val lastName: String,
                                  @SerializedName("OwnerType") val type: String)

//Find a document that matches the student id, document image code, and owner type
internal fun lookupDocument(idocs:List<ServiceDocument>,id:String, imageCode:String, owner: IdocsDocumentOwner):ServiceDocument.Document
{
    return idocs.asSequence().flatMap { doc -> doc.idoc.students }.first { student ->
        student.cbfId == id
    }.documents.asSequence().first { doc-> doc.imageCode == imageCode && doc.owners.first().type == owner.ownerType }

}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật