Some real data behind this approach. FIRST APPROACH. found foreach element
$bean = R::dispense('bean'); $bean->title = "hello"; R::store("bean");
time spent on 5660 lines = 43 s on my mac
SECOND APPROACH.
$beans=array(); $beans[]=R::dispense('bean'); $beans[]=R::dispense('bean'); $beans[0]->title='Hello World!'; $beans[1]->title='Hello World!1'; R::storeAll($beans);
For 5660 lines, 46 s. In the store all the time. Thus, it takes an age to store these beans.
THIRD APPROACH
$beans=R::dispense('bean',5560); for loop $bean[$i]->title = "hello world"; end for R::storeAll($beans);
For 5660 lines, 45 s. Result. None of these approaches are faster.: (RedBean Transactions doesn't seem to do it faster or
From the creator of RedBean fooobar.com/questions/1438467 / ... Bulk insert is not supported, use pure sql.
FOURTH APPROACH
for the R :: exec loop ("insert into the bean (name) the values ββ(1, 'hello world')"); end for
for 5660 lines 7.3s <----- WOW (please, I do not do some things before, so all these results are -4.3 seconds.)
source share