Drinking alcohol however led to worse scores.
In the study 165 children aged 4 watched multiple moving dots on a computer screen and were asked to state the main direction in which they were moving.
It is a measure of visual discrimination in the brain called global motion perception.
Arijit Chakraborty of the University of Auckland likened the test to identifying a single moving car at a busy intersection.
He and his co-researchers found the scores were markedly better in those whose mothers used cannabis in pregnancy than in offspring of those who didn’t use it in pregnancy.
The more frequently the mothers smoked and the larger the quantities – the greater the benefit.
Children of mothers who drank in pregnancy performed worse than those whose mothers did not drink – although none of the children in the study had been diagnosed with fetal alcohol syndrome.
The more the mothers drank – the greater the visual impairment.