I think both are very close. I would say that f is faster, because r.a is loaded only once. However, this can increase register pressure... I would say to use whichever is more easy to use a a given context, and to tune specifically the code if this is the bottleneck: this is very unlikely to be the performance bottleneck, and there won't be a big performance improvement anyway... -- JH Le 15/09/2013 12:30, José Romildo Malaquias a écrit : > Hello. > > OCaml offers at least two ways of accessing a record field: using the > dot notation, and doing pattern matching. > > Does one of them deliver better performance than the other? > > This may be relevant when a field is accessed multiple times. > > For instance: > > type trec = { a : int; mutable b: int } > > let f {a;b} = a * a + b > > let g r = r.a * r.a + r.b > > Which one would be preferred in this case: f or g? > > Romildo >