Having done both, if you are tall, avoid the 747 UD. There are lower deck seats that have a few extra inches of room that make all the difference.
I am 6'3" and have flow the EWR-NRT route as well and had a great sleep, 747 UD SFO-HKG was not good at all for sleeping, (lower deck was though)
My spouse did love the UD 747 though, as she is short
Guess it depends on you're height!!