php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81590 trader_max and trader_min are performing very slow
Submitted: 2021-11-04 13:52 UTC Modified: 2021-12-01 13:26 UTC
From: marcus dot ruhnau at gmail dot com Assigned:
Status: Open Package: PECL (PECL)
PHP Version: 8.0.12 OS: CENTOS 7
Private report: No CVE-ID: None
 [2021-11-04 13:52 UTC] marcus dot ruhnau at gmail dot com
Description:
------------
I tried to do multiple calculations on AAPL chart (closeprice) and always tried to get the last 50 bars. I took nearly 5 seconds for the calculation. The other functions in trader extention are much, much faster.

Just wanted to get a range (Max and Min) from if a stock price is stable

Test script:
---------------
in a very simple for loop of the array data 

I have data from 1980

$maximum = trader_max($highing,50)[$i];
$minimum = trader_min($lowing,50)[$i];

Actual result:
--------------
The result is correct, but the time required is too long

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-01 13:26 UTC] cmb@php.net
-Package: Trader +Package: *General Issues
 [2021-12-01 13:26 UTC] cmb@php.net
You might be better off to report that at
<https://github.com/php/pecl-math-trader/issues>.
 [2021-12-01 13:26 UTC] cmb@php.net
-Package: *General Issues +Package: PECL
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 08 21:01:27 2024 UTC