At the second stage — the gatekeeping step — the trial
judge undertakes a cost-benefit analysis. The judge balances on
the one hand the potential risks, and on the other the potential
benefits of admitting the evidence. The judge does this in order to
decide where the balance settles — whether the potential benefits
justify the risks: Mohan, at p. 21 S.C.R.; White Burgess, at para.
24; Bingley, at para. 16. This exercise is best considered as an
application of the general exclusionary rule: Mohan, at p. 21
S.C.R.; Bingley, at para. 16; Abbey ’09, at para. 76.
 Absent an error of law or of principle, or a material misapprehension of the evidence, a trial judge’s decision applying the
cost-benefit analysis at the gatekeeper stage is entitled to deference on appeal: Abbey ’09, at para. 97; see, also, R. v. D. (D.),
 2 S.C.R. 275,  S.C.J. No. 44, 2000 SCC 43, at para.
13; R. v. Bonisteel,  B.C.J. No. 1705, 2008 BCCA 344, 236
C.C.C. (3d) 170, at para. 70.
 Two brief points about the introduction of defence evidence round out this discussion about governing principles.
 In connection with defence evidence, we recognize that
a trial judge has a residual discretion to relax the strictness of
admissibility rules where it is necessary to do so to prevent a miscarriage of justice and where the danger against which the rule
aims to safeguard does not exist: R. v. Williams (1985), 50 O.R.
(2d) 321, 18 C.C.C. (3d) 356 (C.A.), at pp. 372, 378 C.C.C., leave to
appeal to S.C.C. refused (1985), 50 O.R. (2d) 321n,  1 S.C.R.
xiv,  S.C.C.A. No. 168; R. v. Folland (1999), 43 O.R. (3d)
290,  O.J. No. 143, 132 C.C.C. (3d) 14 (C.A.), at para. 48;
R. v. Caesar,  O.J. No. 4007, 2016 ONCA 599, 339 C.C.C.
(3d) 354, at paras. 68-69. On the other hand, this discretion does
not permit an abandonment of all conditions precedent to admissibility when the defence tenders the evidence: R. v. Kimberley
(2001), 56 O.R. (3d) 18,  O.J. No. 3603, 157 C.C.C. (3d)
129 (C.A.), at paras. 80-81, leave to appeal refused  S.C.C.A.
 A final point concerns the basis upon which a trial judge
may exclude defence evidence where its prejudicial effect exceeds
its probative value. Defence evidence may only be excluded on this
basis where the prejudicial effect of the evidence substantially outweighs its probative value: R. v. Seaboyer; R. v. Gayme, 
2 S.C.R. 577,  S.C.J. No. 62, at p. 611 S.C.R.
The principles applied
 As I will explain, I would not give effect to this ground