1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

323 Commits

Author SHA1 Message Date
6806086bf1 builtin: zero out internal map/array pointers on m.free(), to reduce the work for the GC mark phase for non escaping maps/arrays, used in hot loops (#18415) 2023-06-14 15:00:36 +03:00
9d0a1d8496 builtin: speed up string methods with vmemcpy instead of for loop for copying data (#18211) 2023-05-19 21:24:23 +03:00
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
f9c186a400 builtin: correct a small documentation mistake (#17935) 2023-04-11 12:37:14 +02:00
467a1b4435 fmt: remove redundant parenthesis in the complex infix expr (#17873) 2023-04-04 13:47:48 +03:00
6756d28595 all: 2023 copyright 2023-03-28 22:55:57 +02:00
3793bf1c99 builtin: optimise the common case of s.contains("x") add s.contains_byte(x) (#17702) 2023-03-19 01:10:13 +03:00
f02b423f80 builtin: string test refactor, string functions inlining (#17598) 2023-03-11 20:44:45 +02:00
9fa49da9d5 builtin: add rsplit functions (#17577) 2023-03-11 00:07:02 +01:00
17000ef7b6 checker: check option fn returning error (fix #17423) (#17438) 2023-03-02 15:49:50 +02:00
17d65db828 builtin: add string.trim_indent()` method (#17099) 2023-01-24 21:41:25 +02:00
5cd074a49e builtin: improve multi-platform portability for string.split_into_lines() (#17078) 2023-01-24 10:02:25 +02:00
eb88f7e255 builtin: fix bug with string.split_into_lines, when lines have extra CR's at their end (#16620) 2022-12-09 09:15:50 +02:00
017ace6ea7 vfmt: change all '$expr' to '${expr}' (#16428) 2022-11-15 16:53:13 +03:00
9edb48571f pref,cgen: support -no-bounds-checking, instead of -d no_bounds_checking, and make it enable direct_array_access for all fns/methods. 2022-10-30 14:39:45 +02:00
l-m
a139bed785 builtin: add string.trim_indexes method, that can be used in string.trim, but also separately from it (#16144) 2022-10-22 12:56:05 +03:00
f6844e9766 all: change optional to result of io (#16075) 2022-10-16 09:28:57 +03:00
fc8e3d0971 builtin,strconv: speedup str.int() conversions (without -prod) 2022-09-08 11:28:19 +03:00
4c0339242a doc: fix example comment for string.strip_margin() 2022-08-14 08:06:52 +03:00
6e8350a9c9 fmt: fix interface method with fntype argument (#15280) 2022-07-30 14:29:41 +03:00
l-m
10f3c9f127 builtin: add string.replace_char and string.normalize_tabs (#15239) 2022-07-27 22:04:39 +03:00
l-m
ed8c63cc0b builtin: add a contains_only method on string (#14830) 2022-06-23 01:41:42 +03:00
02c8a6057c builtin.string: new fn (s string) is_ascii() bool (#14418) 2022-05-17 08:01:03 +03:00
a91226c376 docs: cleanup (#14327) 2022-05-07 20:18:42 +03:00
9fde5b067b docs: add missing function names in the builtin example doc comments (#14318) 2022-05-05 17:22:25 +03:00
995485c649 builtin: add string.len_utf8() method (#14208) 2022-04-29 10:23:57 +03:00
1533b77404 builtin: remove unnecessary casts for defunct small unsigned warning (#14108) 2022-04-20 21:47:09 +03:00
fbb9e65c0f all: ~500 more byte=>u8 2022-04-15 18:25:45 +03:00
d4a0d6f73c all: byte => u8 2022-04-15 14:58:56 +03:00
014c3c97f0 all: byte => u8 2022-04-15 14:45:52 +03:00
c780de6282 checker: disallow 'small_unsigned == signed' (#13967) 2022-04-12 19:37:30 +03:00
2cd9c91e98 vdoc: highlight terminal examples for -comments -color (#13937) 2022-04-04 18:13:24 +03:00
d10135e2c4 vdoc: HTML highlight generic function as function, not name (#13923) 2022-04-03 23:41:02 +03:00
42f92db0ab v.doc: parse multi-line examples (so they get highlighted) (#13894) 2022-04-02 18:29:12 +03:00
36ec47cd20 all: replace "NB:" with "Note:" (docs/comments) 2022-03-06 20:01:22 +03:00
7f29418c63 strconv: change atof64 to return an error, if the parsed value is not a valid number (#13424) 2022-02-10 13:27:32 +02:00
727c9fb4a1 all: add string range OrExpr (#13189) 2022-01-17 13:03:10 +03:00
9329b6c8c8 builtin: add more documentation (#13160) 2022-01-14 17:27:38 +02:00
70aedaf184 builtin: add a string.parse_int/2 method (wrapping strconv.parse_int/3) (#13164) 2022-01-14 00:31:11 +02:00
d3489d4246 builtin: s.trim_prefix/1 -> s.trim_string_left/1, s.trim_suffix/1 -> s.trim_string_right/1 2022-01-05 12:49:22 +02:00
59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
278c08704c all: support slices with negative indexes #[start..end] (gated arrays) (#12914) 2021-12-22 16:34:02 +03:00
f81654e3a7 builtin: add s.match_glob(wildcard_pattern) 2021-12-20 14:17:08 +02:00
6ff953d936 preludes,builder,cgen: add support for VTEST_RUNNER=tap and -test-runner tap (#12523) 2021-12-16 15:59:46 +02:00
81a1490e31 builtin: add string.split_any/1 (#12720) 2021-12-04 20:13:40 +02:00
c4363bc78b builtin: explain and better organise the different cstring_to_vstring/tos/tos_clone/vstring family of conversion functions 2021-12-02 15:46:53 +02:00
80242c8041 builtin,ast: apply small performance improvements, suggested by hotspot 2021-11-07 13:30:44 +02:00
b86c79329b os, builtin: reduce leaks without -autofree 2021-10-29 15:49:30 +03:00
8014235e0e scanner: speed up text_scan by using a specialised keywords matcher, instead of a generic V map of keywords 2021-10-28 15:41:13 +03:00
Ken
a17b943e87 builtin: add method byte() for string (#11998) 2021-09-28 10:08:10 +03:00