Opened 11 years ago

Last modified 11 years ago

#2023 closed defect

[PATCH] Const arguments — at Version 1

Reported by: tuan kuranes Owned by:
Priority: Nice to Have Milestone:
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by tuan kuranes)

  • Passing larger than 4-byte values by reference to avoid copy-on-move and temporary objects. ("PVS studio" can pinpoint/list all those automatically)
  • const size_t* const is but a way to point for aliasing and therefore "restrict" optimisations and use. (themself leading to potential openmp "optimisations spot")
  • "int getStuff(const size_t arg)" is more developper safeguard and code documentation than real perf. (preventing people using args as local vars and easing code reading, by pointing possible optimisation when code evolves)
  • inlines are added and tested using profiling results (with very sleepy profiler).

Change History (2)

by tuan kuranes, 11 years ago

Attachment: const.patch added

patch

comment:1 by tuan kuranes, 11 years ago

Description: modified (diff)
Summary: Const arguments[PATCH] Const arguments
Note: See TracTickets for help on using tickets.