1
0
Fork
You've already forked swap_test
0
Test of several memory swap algorithms
  • C 83%
  • Shell 17%
Find a file
2026年05月23日 08:59:26 +03:00
readme.md Init 2026年05月23日 08:59:26 +03:00
report.md Init 2026年05月23日 08:59:26 +03:00
report_inline.md Init 2026年05月23日 08:59:26 +03:00
swap_test.c Init 2026年05月23日 08:59:26 +03:00
swap_test.sh Init 2026年05月23日 08:59:26 +03:00

Swap algorithms test

Trying to find out which algirithm for memory swapping in c is the fastest.

Tested: xor swap algorithm and temporary variable algorithm in 3 slightly different variants.

For the results see report.md and report_inline.md for result with inlining.

To run your test use script swap_test.sh. INLINE variable controlls whether to inline algorithms.

In summary tmp3 algorithm inlined seems the best option.