aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2019-02-21Merge branch 'maint'Hans Bolinder
* maint: stdlib: Fix a bug in the Erlang Pretty Printer
2019-02-18stdlib: Fix a bug in the Erlang Pretty PrinterHans Bolinder
Long atom names in combination with <c><<>></c> could cause a crash.
2019-02-18Merge branch 'maint'Raimo Niskanen
* maint: Updated OTP version Prepare release
2019-02-18Merge branch 'maint-21' into maintRaimo Niskanen
* maint-21: Updated OTP version Prepare release
2019-02-18Merge branch 'maint'Hans Bolinder
* maint: Update primary bootstrap stdlib: Optimize formatted printing of terms Conflicts: bootstrap/lib/stdlib/ebin/io_lib.beam bootstrap/lib/stdlib/ebin/io_lib_format.beam bootstrap/lib/stdlib/ebin/io_lib_pretty.beam
2019-02-18Merge branch 'hasse/stdlib/optimize_pretty_print/ERIERL-306/OTP-15573' into ↵Hans Bolinder
maint * hasse/stdlib/optimize_pretty_print/ERIERL-306/OTP-15573: Update primary bootstrap stdlib: Optimize formatted printing of terms
2019-02-15Merge branch 'maint'Sverker Eriksson
2019-02-15Merge PR-2139 from sverker/ets-doc-partially-bound-key/OTP-15545Sverker Eriksson
Add ETS docs about partially bound key traversal
2019-02-15Prepare releaseErlang/OTP
2019-02-14Merge branch 'maint'Kjell Winblad
2019-02-14Merge pull request #2118 from kjellwinblad/fix_valgrind_problem_bignum OTP-15583Kjell Winblad
Fix bug in binary:encode_unsigned causing a read of uninitialized memory
2019-02-14stdlib: Optimize formatted printing of termsHans Bolinder
Try calling iolist_size() before calling string:length(). The reason is that calls to string:length/1 are slow when the argument is not a list of integers (or contains UNICODE).
2019-02-12Merge branch 'maint'Hans Bolinder
* maint: Optimize calendar:gregorian_days_to_date/1
2019-02-12Merge branch 'FNickRU/stdlib/optimize_calendar/PR-2121/OTP-15572' into maintHans Bolinder
* FNickRU/stdlib/optimize_calendar/PR-2121/OTP-15572: Optimize calendar:gregorian_days_to_date/1
2019-02-11beam_ssa_type: Propagate the 'none' type from callsBjörn Gustavsson
Consider this pseudo code: f(...) -> Val = case Expr of ... -> ... ; ... -> ... ; ... -> my_abort(something_went_wrong) end, %% Here follows code that uses Val. . . . my_abort(Reason) -> throw({error,Reason}). The first two clauses in the case will probably provide some information about the type of the variable `Var`, information that would be useful for optimizing the code that follows the case. However, the third clause would ruin everything. The call to `my_abort/1` could return anything, and thus `Val` could also have any type. 294d66a295f6 introduced module-level type analysis, which will in general keep track of the return type of a local function call. However, it does not improve the optimization for this specific function. When a function never returns, that is, when its type is `none`, it does not propagate the `none` type, but instead pretends that the return type is `any`. This commit extends the handling of functions that don't return to properly handle the `none` type. Any instructions that directly follows the function that does not return will be discarded, and the call will be rewritten to a tail-recursive call. For this specific example, it means that the type for `Val` deduced from the first two clauses will be retained and can be used for optimizing the code after the case.
2019-02-08stdlib: Add ETS docs about partially bound key traversalSverker Eriksson
2019-02-05Merge branch 'maint'Ingela Anderton Andin
Conflicts: lib/ssl/doc/src/ssl.xml lib/ssl/src/ssl.erl lib/ssl/src/ssl_cipher_format.erl lib/ssl/src/tls_handshake.erl
2019-02-05ssl: Use specs to generate type documentationIngela Anderton Andin
2019-01-31Optimize calendar:gregorian_days_to_date/1Stanislav Mayorov
This patch improves the performance of calendar:gregorian_days_to_date/1 by changing the algorithm for finding the year to log-logarithmic. The old implementation has linear complexity, which makes function too slow for large values. For example: There is an API that allows you to create events for future dates. There are users of this API who, for some reasons, choose dates very far in the future. In such conditions, function works very slow. New implementation based on interpolation search, takes 1 or 2 iterations at most cases and free from such a flaw. A unit test was also developed to illustrate the speed of a function at large values.
2019-01-30Fix bug in binary:encode_unsigned causing a read of uninitialized memoryKjell Winblad
The bug could be seen by running the test that is added by this commit in a valgrind enabled emulator. Co-authored-by: John Högberg <[email protected]>
2019-01-24stdlib: Add ets doc note about subtle iteration odditiesSverker Eriksson
as it has been made more relevant with the introduction of write_concurrency for ordered_set.
2019-01-24Merge branch 'maint'Sverker Eriksson
2019-01-24Merge PR-2103 from sverker/ets-iteration-doc/OTP-15545Sverker Eriksson
Clarify ETS docs about table iterations
2019-01-24stdlib: Clarify ets docs about table iterationsSverker Eriksson
2019-01-22Merge branch 'maint'Sverker Eriksson
2019-01-22Merge branch 'sverker/fix-since-clauses/OTP-15460' into maintSverker Eriksson
* sverker/fix-since-clauses/OTP-15460: Fix "since" for all multi clause functions
2019-01-21Merge branch 'raimo/stdlib/gen_statem-optimization/OTP-15452'Raimo Niskanen
* raimo/stdlib/gen_statem-optimization/OTP-15452: correct: Work around a compiler mis-optimization
2019-01-21correct: Work around a compiler mis-optimizationRaimo Niskanen
This was not a compiler optimization that misfired, rather that the code neede separate case clauses for when the timer was running and not, so to not call erlang:cancel_timer/1 nor maps:remove/2 in the case clause where only a map update was needed before recursion. See the comment in loop_timouts_cancel/13
2019-01-18Merge branch 'raimo/stdlib/gen_statem-optimization/OTP-15452'Raimo Niskanen
* raimo/stdlib/gen_statem-optimization/OTP-15452: Write some more comments in the engine loop Work around a compiler mis-optimization Move out helper functions to engine loop Handle #trans_opts{} fields in parse_actions() arguments Optimize gen_statem engine loop Modify generic_statem_transit benchmark
2019-01-17Write some more comments in the engine loopRaimo Niskanen
2019-01-17Work around a compiler mis-optimizationRaimo Niskanen
The common subexpression optimization accidentally caused unnecessary spilling of live registers. A rather ugly workaround can be found in loop_timeouts_cancel.
2019-01-17Move out helper functions to engine loopRaimo Niskanen
This strategy improves speed benchmarks and reduces the amount of garbage that is produced. More: * Handle transition options as loop function arguments instead of in a record. * Shorten the state_enter loop and make it more efficient by making it more part of the loop and less a loop restart. * Simplify the internal timeout action handling somewhat.
2019-01-16Merge branch 'maint'Hans Bolinder
* maint: Fix erl_parse:af_constraint() Fix erl_parse:af_fun_type() Add literal character to erl_parse:abstract_type/0 type
2019-01-16Merge pull request #2074 from gomoripeti/singleton_char_typeHans Bolinder
Fixes in erl_parse:abstract_type/0 type
2019-01-16Merge branch 'maint'Hans Bolinder
* maint: Fix sorting in lists.xml
2019-01-15Fix "since" for all multi clause functionsSverker Eriksson
This is the result of going through all .xml files with "clause_i" attributes and make sure their "since" versions are correct.
2019-01-15Merge pull request #2069 from zuiderkwast/erl_parse_typesHans Bolinder
Correction of type abstract_expr -> abstract_expr() in erl_parse
2019-01-15Fix sorting in lists.xmljfw7
`search/2` was sorted incorrectly.
2019-01-15Handle #trans_opts{} fields in parse_actions() argumentsRaimo Niskanen
2019-01-14Optimize gen_statem engine loopRaimo Niskanen
* Use synchronolus cancel_timer since that is more efficient than asynchronous when a process cancels its own timer * Restructure the state to have fewer fields by breaking out practically constant fields into a separate loop argument record #params{}, group state and data into one field and dito for timer fields * Optimize engine loop arguments for staying in the loop so the detour to sys:handle_system_message/6 will require packing/unpacking of the sys: state, and of the argument Parent * Avoid double reverse of event queue in many cases * Restructure the state transition to not have duplicate tracks for sys_debug and non-sys_debug cases * Shortcut the empty list case where possible * Loop unroll reversal of up to 2-element lists to avoid calling lists:reverse/2 since an external call spills all live registers to the stack * Bring out the callback mode check to the engine loop
2019-01-14Modify generic_statem_transit benchmarkRaimo Niskanen
Instead of just changing states; also start a state_timeout that gets cancelled by the state change. I think it is important to have efficient timer handling.
2019-01-08Merge branch 'maint'Lars Thorsen
* maint: [xmerl] Fix detect charset crash [cdv] Check only own persistent terms in crashdump_viewer test Fix remote-call error in ms_transform Conflicts: lib/observer/test/crashdump_helper.erl
2019-01-08Merge pull request #2022 from gomoripeti/ms_remote_call_errorSiri Hansen
Fix remote-call error in ms_transform
2018-12-28Fix erl_parse:af_constraint()Péter Gömöri
Add missing list wrapper.
2018-12-28Fix erl_parse:af_fun_type()Péter Gömöri
`af_function_type()` already contains the `{'type', anno(), 'fun', ...}` tuple so it does not have to be wrapped again.
2018-12-27Add literal character to erl_parse:abstract_type/0 typePéter Gömöri
This is allowed since 19.3 (commit 6d238032) and documented since commit 744fb920.
2018-12-22Correction of type abstract_expr -> abstract_expr() in erl_parseViktor Söderqvist
2018-12-18Make all compiler options work in the option listBjörn Gustavsson
Before OTP 22, the option `{nowarn_deprecated_function,MFAs}` was only recognized when given in the file with the attribute `-compile()`. (The option `{nowarn_unused_function,FAs}` was incorrectly documented to only work in a file, but it also worked when given in the option list.) Starting from OTP 22, all options that can be given in the file can also be given in the option list.
2018-12-17Merge branch 'raimo/stdlib/sys-log-of-gen-in-terminate-report/OTP-15381'Raimo Niskanen
* raimo/stdlib/sys-log-of-gen-in-terminate-report/OTP-15381: sys:log timeout 0 events Filter gen_server State in crash sys:log Fix statement duplication Document system_events better Adjust sys:log(N, get) to documentation Unify system_events in gen_* Log code change Use from/1 type check Limit more error_logger terms Add client stacktrace Print sys:log in error report Optimize sys:handle_debug/4 Optimize sys:log Fix sys:log functionality Conflicts: lib/stdlib/doc/src/sys.xml
2018-12-14Merge branch 'maint'Lukas Larsson