Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] CI Session is to slow for complex calculation
#1

[eluser]goFrendiAsgard[/eluser]
Hi dudes, I've a problem.

I make an artificial neural network program with CodeIgniter. You can get the source-code from https://github.com/goFrendiAsgard/No-CMS. Once you've install it on your server you can choose CMS-Management | Module Management and install artificial_intelligence module.

Basically I have 2 things to do there:
1. Do the neural network process.
2. Let the user see the progress.

Since the neural network process can be very long, I add these codes:
Code:
set_time_limit(0);                   // ignore php timeout
ignore_user_abort(true);             // keep on going even if user pulls the plug*
while (ob_get_level())
    ob_end_clean();                  // remove output buffers
ob_implicit_flush(true);             // output stuff directly
To be honnest I don't really understand what the third line means to, but the first 2 lines are used to set php timeout into infinite, and ignore client abort.

When I start the process and ask for the progress report (I check the progress every 1/5 second by using javascript's setInterval):
Code:
setInterval(updateInfo,200);

I use CI Session to save the neural network state. and I consider it to slow, do anyone has solution to make CI Session faster.

I've also try to use native PHP session, it is faster, but I cannot read it when neural-network proceed
#2

[eluser]goFrendiAsgard[/eluser]
I use text file instead, and seems to be fine. Slower than php native session, but accessible through different process (e.g : using ajax)




Theme © iAndrew 2016 - Forum software by © MyBB