Welcome!
Experience and thousands of posts here say what made your 2015 slow is the storage if you did not up-order to a Fusion drive or factory SSD at the time of purchase. The base mech hard drive in 2012-2019 21.5-inch models could do data transfers no faster than ~80 MB/sec when new. The previous 21.5-inch 2011 iMacs' base drive is demonstrably about 30% FASTER than HDD storage in 21.5-inch iMacs made over the next eight years. Minimalist design dictate that the thin-case iMac 21.5 models have laptop-class HDDs running at half the SATA drive bus speed of the computer's logic board.
All current iMacs have solid-date storage on the system chip, typically with data transfer scores over 3200 MB/sec.
The MacTracker database (free in the Mac App Store) has benchmark test results for many Mac models. This is your 2015 model compared to the current M4 iMac:
Re the 10-core issue: note that the increase in overall benchmark performance between the 8- and 10-core models is just under 7 percent. I have no way to tell the effect of a small increase on your computing requirements. If you have pro apps that you know will benefit from the higher core count, by all mean go for that option after making informed decisions; contact the App developer for their recommendation.
My preference in a tight money situation is usually to opt for additional storage; like RAM, internal storage cannot be increased once the computer goes on the assembly line. Following massive changes in Mac memory management in 2013, most Macs do surprisingly well with minimum RAM.
Even SSDs can slow if they get too full, so I like big storage (and I cannot lie). The are several open discussions here this week where users let a Mac'sSSD get over 90% full and the performance slowed dramatically.