Who better to answer this question than the legendary former World Champion and master of opening preparation Garry Kasparov himself? I quote
In June 2005 in New York I gave a special training session to a group
of the leading young players in the United States. I had asked them
each to bring two of their games for us to review, one win and one
loss. A talented twelve-year-old raced through the opening moves of
his loss, eager to get to the point where he thought he'd gone wrong.
I stopped him and asked why he had played a certain pawn push in the
sharp opening variation. His answer didn't surprise me: "That's what
Vallejo played!" Of course I also knew that the Spanish Grandmaster
had employed this move in a recent game, but I also knew that if this
youngster didn't understand the motive behind the move, he was already
headed for trouble.
This boy's response took me back to my own sessions with Botvinnik
thirty years earlier. On more than one occasion he chided me for
committing this same sin of blind emulation. The great teacher
insisted that his students recognize the rationale behind every move.
As a result, all of us learned to become great skeptics, even of the
moves of the best players. We would discover a powerful idea behind
each Grandmaster move, but we also found improvements. We studied, we
questioned, we grappled with the idea behind a series of moves, and
eventually we could build our understanding and create more and better
strategies.
For players who depend on memorization, the opening ends when their
memory runs out of moves and they have to start thinking for
themselves. A rote opening might carry you to move five, or even move
thirty, but this practice always inhibits your development as a
player. It is one thing for a world-class player to rely on
memorization; he already knows all of the whys behind the moves. For
your own development it's far more important to think for yourself
from the very start.
--- Garry Kasparov, How Life Imitates Chess (emphasis mine)
Following Garry Kasparov's advice, I myself do not recommend memorization of opening moves. If you really want to improve your game, you must understand (rather than memorize) why a certain move is played and only then play it.
Should I do memorizing to saved time in middle game?
No! Instead, you should study the openings more and understand why certain moves are played. When you understand these moves, the result is that you often automatically remember them because you have found the rationale behind them. The focus should be on understanding and not on memorization.
Great players have fallen prey to blind memorization, including legends like Viswanathan Anand himself. Consider the game where he lost in just 6 moves (!!!) because he blindly memorized a line played earlier by a grandmaster.
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]
[Event "Blind memorization makes Anand lose in 6 moves"]
[White "Zapata"]
[Black "Anand"]
1. e4 e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nf3 Nxe4 5. Nc3 Bf5?? 6. Qe2! 1-0
Or consider his loss in the first game in his World Championship match with Topalov where he "forgot" his preparation and blundered and lost the game.
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]
[Event "Anand forgets his preparation and blunders"]
[White "Topalov"]
[Black "Anand"]
[Result "1-0"]
1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bc4 c5 8.
Ne2 Nc6 9. Be3 O-O 10. O-O Na5 11. Bd3 b6 12. Qd2 e5 13. Bh6 cxd4 14. Bxg7 Kxg7
15. cxd4 exd4 16. Rac1 Qd6 17. f4 f6 18. f5 Qe5 19. Nf4 g5 20. Nh5+ Kg8 21. h4
h6 22. hxg5 hxg5 23. Rf3 Kf7?? ({not thinking objectively and trying to repeat moves from memory}) 24. Nxf6 Kxf6 25. Rh3 Rg8 26. Rh6+ Kf7 27. Rh7+
Ke8 28. Rcc7 Kd8 29. Bb5 Qxe4 30. Rxc8+ 1-0
Now to redeem Anand a bit, I must mention his smashing win against Bologan, where Bologan blindly copied a line that had been played by other grandmasters before and got smashed by Anand's stunning novelty.
[FEN ""]
[Event "Bologan merely copies known opening moves and Anand punishes him"]
[White "Anand"]
[Black "Bologan"]
[Result "1-0"]
1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nd7 5. Ng5 Ngf6 6. Bd3 e6 7. N1f3 Bd6 8.
Qe2 h6 9. Ne4 Nxe4 10. Qxe4 Qc7 11. O-O b6 12. Qg4 g5 13. Qh3 Rg8 14. Re1!! Bf8
15. Qf5 Bg7 16. h4 Kf8 17. Qh3 Rh8 18. hxg5 hxg5 19. Qg4 c5 20. Bxg5 cxd4 21.
Rad1 Bb7 22. Rxe6 fxe6 23. Be7+ Kxe7 24. Qxg7+ Kd6 25. Nxd4 Qc5 26. Bf5 Qe5 27.
Nf3+ Qd5 28. Qg3+ Ke7 29. Rxd5 Bxd5 30. Qg5+ Kd6 31. Qf4+ Ke7 32. Be4 Rh5 33.
Nh4 Rg8 34. Ng6+ Kd8 35. Qf7 Re8 36. Bd3 1-0
Even after this game, I checked a database and found that many strong players unaware of this novelty also lost their games in this variation in the same manner.
Moral of the story - do not merely copy the moves of grandmasters or just memorize them. Analyze them and understand them and see if they can be improved.