Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2011-02-22 13:27:54

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,238
Website

Real time of performance

1. In file functions.php delete

//
// Return current timestamp (with microseconds) as a float
//
function get_microtime()
{
    list($usec, $sec) = explode(' ', microtime());
    return ((float)$usec + (float)$sec);
}

2. In file common.php delete

// Record the start time (will be used to calculate the generation time for the page)
$pun_start = get_microtime();

and replace

if (!defined('PUN_ROOT'))
    exit('The constant PUN_ROOT must be defined and point to a valid FluxBB installation root directory.');

->

if (!defined('PUN_ROOT'))
    exit('The constant PUN_ROOT must be defined and point to a valid FluxBB installation root directory.');

//
// Return current timestamp (with microseconds) as a float
//
function get_microtime()
{
    list($usec, $sec) = explode(' ', microtime());
    return ((float)$usec + (float)$sec);
}

// Record the start time (will be used to calculate the generation time for the page)
$pun_start = get_microtime();

wink

Offline

#2 2011-02-22 13:34:49

gerald
Member
Registered: 2011-02-20
Posts: 81

Re: Real time of performance

or, say you're only supporting php5, and use pass true to the function! wink


Sorry for my poor English, I'm English.

Offline

#3 2011-02-22 13:40:43

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,238
Website

Re: Real time of performance

gerald wrote:

or, say you're only supporting php5, and use pass true to the function! wink

At what here php5?
I suggest to transfer a function call get_microtime () to the beginning of a carried out script!

Offline

#4 2011-02-22 14:05:44

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,672
Website

Re: Real time of performance

I'm not sure I understand the point of this change, Visman.
Are you saying that we're currently measuring at the wrong place?


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#5 2011-02-22 14:17:51

Reines
Administrator
From: Scotland
Registered: 2008-05-11
Posts: 3,197
Website

Re: Real time of performance

Franz wrote:

I'm not sure I understand the point of this change, Visman.
Are you saying that we're currently measuring at the wrong place?

Yes, though only very slightly - at the moment we load the functions, utf8 library, and strip out bad utf8 characters/unregister globals before starting the timer.

Offline

#6 2011-02-22 14:55:09

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,238
Website

Re: Real time of performance

The first column:

Reines wrote:

at the moment we load the functions, utf8 library, and strip out bad utf8 characters/unregister globals before starting the timer.

The second column: a current variant.
The third column: the sum.
The fourth column: an error.

0.006    0.046    0.052    11%
0.006    0.027    0.033    18%
0.006    0.089    0.095    06%
0.007    0.017    0.024    29%
0.006    0.009    0.015    40%
0.007    0.009    0.016    43%
0.006    0.006    0.012    50%
0.006    0.007    0.013    46%
0.006    0.196    0.202    03%

See __http://forum.alltes.ru/fluxbb14test/index.php

common.php

...
if (!defined('PUN_ROOT'))
    exit('The constant PUN_ROOT must be defined and point to a valid FluxBB installation root directory.');

function get_microtime2()
{
    list($usec, $sec) = explode(' ', microtime());
    return ((float)$usec + (float)$sec);
}
$pun_start2 = get_microtime2();

// Define the version and database revision that this code was written for
define('FORUM_VERSION', '1.4.4');

define('FORUM_VER_REVISION', 37);    // номер сборки - Visman

define('PUN_DEBUG', 1);
//define('PUN_SHOW_QUERIES', 1);

define('FORUM_DB_REVISION', 10);
define('FORUM_SI_REVISION', 2);
define('FORUM_PARSER_REVISION', 2);

// Block prefetch requests
if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
{
    header('HTTP/1.1 403 Prefetching Forbidden');

    // Send no-cache headers
    header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
    header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
    header('Cache-Control: post-check=0, pre-check=0', false);
    header('Pragma: no-cache'); // For HTTP/1.0 compatibility

    exit;
}

// Attempt to load the configuration file config.php
if (file_exists(PUN_ROOT.'include/config.php'))
    require PUN_ROOT.'include/config.php';

// If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
if (defined('FORUM'))
    define('PUN', FORUM);

// Load the functions script
require PUN_ROOT.'include/functions.php';

// Load UTF-8 functions
require PUN_ROOT.'include/utf8/utf8.php';

// Strip out "bad" UTF-8 characters
forum_remove_bad_characters();

// Reverse the effect of register_globals
forum_unregister_globals();

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
{
    header('Location: install.php');
    exit;
}

echo sprintf('%.3f', get_microtime2() - $pun_start2);
// Record the start time (will be used to calculate the generation time for the page)
$pun_start = get_microtime();


...

Last edited by Visman (2011-02-22 15:05:45)

Offline

#7 2011-02-22 14:59:49

Reines
Administrator
From: Scotland
Registered: 2008-05-11
Posts: 3,197
Website

Re: Real time of performance

I've created a ticket to remind us to look at this.

Offline

#8 2011-02-22 15:05:28

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,238
Website

Re: Real time of performance

Reines wrote:

I've created a ticket to remind us to look at this.

Ok.
Example at myself from forum I will remove after a while wink

Last edited by Visman (2011-02-22 15:06:18)

Offline

#9 2011-03-17 18:01:19

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,672
Website

Re: Real time of performance

I would like to note that we're not lying about the generation time. I would suppose this was just forgotten about when adding the utf8 library and some other things, which should have been done after starting the timer.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#10 2012-10-23 00:19:18

hydn
Member
Registered: 2012-10-06
Posts: 22

Re: Real time of performance

Is this change included in 1.5.0? Or should I do it?

Offline

#11 2012-10-23 14:14:34

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,672
Website

Re: Real time of performance

It will be fixed in the 2.0 branch.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#12 2015-10-29 06:32:16

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,238
Website

Re: Real time of performance

Super time for

$db_type = 'mysqli_innodb';

b3413b542b0f87c59a6d63fc6b3632ad.png

Offline

#13 2016-10-17 07:27:32

artoodetoo
Member
From: Far-Far-Away
Registered: 2008-05-11
Posts: 221

Re: Real time of performance

Super time

Ahaha! Visman, I love your posts.
Franz, as far as v2 is fantastic, can you please include this issue to 1.5 roadmap?
Thanks.

Last edited by artoodetoo (2016-10-17 07:27:46)


I'm not a fan of FluxBB way anymore.

Offline

Board footer

Powered by FluxBB