That's the really weird thing about Core i7 mobile processors. They are also 1 socket, 2 cores, 4 logical processors. Just slightly faster base/turbo clocks than the i5. I dislike the naming. I only recently realized my work laptop is a U series, which explains why my 8 year old desktop (AMD quad core) is much faster at compiling the same projects...
My laptop with U-series i3 builds C++ just as fast as my 3 years old quad core desktop i5.
The reason is eDRAM i.e. large L4 cache in the mobile CPU. Some workloads (compiling C++ appears to be one of them) like lower RAM latency even more than extra CPU cores.
I'm sure the Core i7 are something like the 7500U (i.e. dual core, four threads) - is your Core i5 dual core, dual threads?