Christ is nowhere pictured as pitiless as in this Gospel.
It's a lesson, indeed, recorded for our learning and comfort, teaching us that Christ is pleased at heart when we persist in prayer and do not give up.
[On calling her a dog] If he had spoken in this manner to me, I would have been scared off... I would have been frightened to death.
Faith takes Christ captive in his word, when he's angriest, and makes out of his cruel words a comforting inversion, as we see here. You say, the woman responds, that I am a dog. Let it be, I will be gladly be a dog; now give me the consideration you give a dog. Thus she catches Christ with his own words, and he is happy to be caught.
He let himself be made captive, and must comply. Be sure of this: that's what he most deeply desires.
You, however, cling firmly to the hope that I will help you and you don't let go of me.
We see here why the Lord presented himself so unyielding and refused to hear her, not because he wanted to present an unfriendly image as not wanting to help her, but rather that her faith might be so evident.
Thus he gives her not merely a dog's rights, but is constrained to give her what she petitions for, healing her daughter, and places her among the descendants of Abraham. Her faith brings her to such a state of grace that she is no longer a dog or a Gentile, but is welcomed as a beloved daughter and a blessed woman.
If God had answered Joseph sooner and rescued him, then no doubt Jacob, his father, would have been happy but Joseph would have remained a sheepherder. But because God's answer was long delayed, he became ruler of Egypt and the greatest among his brethren; and God through him accomplished much good in the secular realm as well as in the church.
"Whatsoever you ask the Father in my name, he will give it you." Because the Word is true, his promise will not fail.
We will in the end find that God will do far more for us than we asked for, just as is the case with this woman.
Our Lord God thus wishes to teach us that it is not always good to be heard immediately.
The "yes" is deep in his heart, in keeping with Christ's promise "And whatsoever ye shall ask in my name, that will I do, that the Father may be glorified in the Son."
So, in the case of this woman, she cries and implores, and will not let the "yes" word be plucked from her heart - that Christ the Lord is friendly and will help.