1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Petr Makhnev a39c26507c
builtin: speed up string concatenation and repeat() method with vmemcpy instead of for loop for copying data (#18206)
These changes almost do not speed up the program with the `-prod` flag,
since modern С compilers can do such optimization on their own, but in
normal mode, the performance gain is from 1.6 (concatenation) to 1.8 (repeat) times.

Concatenation:
Old (`for` loop):
Time (mean):          3.699 s +- 0.071 s  [User: 3.629 s, System: 0.069 s]
Range (min ... max):  3.548 s ... 3.741 s  10 runs

New (vmemcpy):
Time (mean):          2.305 s +- 0.065 s  [User: 2.263 s, System: 0.041 s]
Range (min ... max):  2.172 s ... 2.355 s  10 runs

`vmemcpy version` ran 1.60 +- 0.05 times faster than 'for loop version'
2023-05-19 16:18:23 +03:00
..
2023-05-04 21:23:02 +03:00
2023-05-02 16:41:32 +02:00
2023-05-18 11:31:53 +02:00
2023-05-06 14:59:06 +03:00
2023-05-01 00:58:10 +03:00
2023-05-18 11:30:49 +02:00

vlib Documentation

vlib is the term for all modules included by default with V and maintained as part of the V source code repository.

Some included modules depend on third party libraries, and these are kept separate in the thirdparty directory at the root level of the source repository.