I think you guys are missing a serious point... when the Granit was made... in the Early 1980s... which you might not remember, but I certainly do.
I had a book on computers and it said beware of people trying to sell you a 64K computer, because you will never type that much in a week. 32K computers are fine.
Now let me clarify... back then there were no computer shops, there were radio and electronic shops, but they didn't sell computer software till later on.
You got computer software in a book shop... and it was in computer magazines that listed the programs, which you bought and took home and typed out.
Floppy drives were too expensive and hard drives were simply not an option.
In fact by the time the IBM PC came out the 3.5 in floppy was brand new technology... which is why they are the A: drive, because the older 5 1/4 in drive were much larger physically but with the same or less capacity, so the 5 1/4 drive became the B: for all those people who had lots of the old 5 1/4 disks for previous computers.
The Hard Drives came much later.
I remember getting a tape drive... which was basically an audio cassette tape player that could be connected up to the computer. You typed out the program and then saved it to tape... it sounded like that screech you heard with the old dial up internet connections and I guess they were the same thing really.
Once you had saved it onto tape and recorded the position you could later on position the tape in the right place and press play and then press start on the computer and it would upload the software so you didn't have to type it all out again every time you wanted to play... Amazing technology.
Anyway... a modern missile with all sorts of two way datalinks, a high resolution radar and modern electronics and a vew thousand million lines of code today will likely be even more smart and tricky and capable...
The Oniks is a very long and relatively slim aerodynamic weapon that uses a ramjet propulsion system instead of the turbojet of the Granit, so I would rather suspect that the reduction in weight is largely due to the removal of an engine that weighs about 1 ton and its replacement by an hollow tube with a few moving bits and fuel lines that is a ramjet.
The advantage of the Oniks of course is that a much wider range of platforms can now carry it, unlike the Granit which was carried by only the largest vessels in the Russian fleet. Now even corvettes carry UKSK launchers...