Git Product home page Git Product logo

Comments (28)

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 17-Mar-2010 7:31pm

[http://www.spec.org] — probably we should go this way, somehow...

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 20-Apr-2010 7:36am

Adrian, this is rather tricky and very important task, but I think we can do it together, using the PDD concept. Let me know if it's possible to do in 3 hours. If yes, let's start.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 21-Apr-2010 2:02pm

If we want to do real benchmark to estimate for example CPU GigaFlops, we must have to do it in C or Asembler language to reduce impact of intermediary layers. For our application it isn't good solution, so I think we should use some simple benchmark, which can be easy repeatable and measurable.

I have created example how it can look:

function getPerformanceIndicator()
{
    /**
     * 4.85s take completion of this task on HostGator server,
     * this is our reference server which have performance indicator = 1
     */
    $estimatedTime = 4.85;

    $c = 0;
    $startTime = microtime(true);
    for ($i = 1; $i <= 10000000; $i++) {
        $c += sqrt($i);
    }
    $totalTime = microtime(true) - $startTime;
    return sprintf('%3f', (1 / $totalTime) * $estimatedTime);
}

What you think about this idea?

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 22-Apr-2010 7:56am

With this approach you will calculate current performance of the system, not the performance of the CPU. In other words, if the server is loaded now with applications — the performance will be lower. Which doesn't indicate the real performance of the server.

With this assertion we should be able to calculate the performance of the platform, as it is, without applications.

See #15 — this where we should validate the load rate of the server.

What do you think?

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 22-Apr-2010 8:15am

I think that benchmark results should be repeatable so need to be executed with minimum server load. I don't know benchmark which results won't be affected when some other process use many CPU time. Maybe somebody else will know how implement this independence.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 22-Apr-2010 8:21am

Maybe this information is available from Unix system files in /dev/...? We can implement this feature as platform-dependent..

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 22-Apr-2010 9:33am

Yes, if situation look in this way we can use

/proc/cpuinfo

and we have there bogomips which tell us directly about CPU speed without load, because this benchamrk is performed during OS booting.

http://en.wikipedia.org/wiki/BogoMips

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 22-Apr-2010 7:54pm

Yes, looks like a good solution. Any ideas how to get the same measure in Windows?

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 23-Apr-2010 7:17am

We can use COM + WMI to get CPU clock. After that as we see on website mentioned above when we multiply this value by 2.00, we will get approximate BogoMips value for most of current CPU-s in usage.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 23-Apr-2010 7:46am

Agree, please go ahead and implement this. Thanks

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 23-Apr-2010 6:06pm

Done in r444. Please review.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 23-Apr-2010 8:02pm

Looks good, but would be much better to have static factory in phpRack_Adapters_Cpu::factory(), which would return an instance of phpRack_Adapters_Cpu_Abstract.

Then we will implement phpRack_Adapters_Cpu_Linux and phpRack_Adapters_Cpu_Windows.

I'm sure you agree.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 23-Apr-2010 9:01pm

Yes, very good hint. Thanks! Done in r446. Please review.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 24-Apr-2010 3:59am

In [447]:

#CommitTicketReference repository="" revision="447"
refs #17 - partially implemented

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 24-Apr-2010 3:59am

In [448]:

#CommitTicketReference repository="" revision="448"
refs #17 - branch closed

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 24-Apr-2010 4:01am

In [449]:

#CommitTicketReference repository="" revision="449"
refs #17 - puzzles added, related to MacOS platform

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 24-Apr-2010 8:08am

Puzzles resolved and added in r451. Please review.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 25-Apr-2010 7:32am

In [453]:

#CommitTicketReference repository="" revision="453"
refs #17 - most of puzzles resolved and a few new added, branch merged into trunk

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 25-Apr-2010 7:32am

In [454]:

#CommitTicketReference repository="" revision="454"
refs #17 - branch closed

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 25-Apr-2010 8:19am

In [455]:

#CommitTicketReference repository="" revision="455"
refs #17 - small grammar mistakes fixed

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 26-Apr-2010 3:35pm

I have added exception for unknown operating systems in r466 so as I see my part of this ticket is finished.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 26-Apr-2010 4:51pm

In [467]:

#CommitTicketReference repository="" revision="467"
refs #17 - implemented and merged into trunk

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 26-Apr-2010 4:51pm

In [468]:

#CommitTicketReference repository="" revision="468"
closes #17 - branch closed

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 26-Apr-2010 5:09pm

Agree, but we need to do something with @todo tags related to mac os in phpRack_Adapters_Cpu_Darwin. This is the information I have in my computer:

$ system_profiler SPHardwareDataType -xml

returns:

#!xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <dict>
        <key>_dataType</key>
        <string>SPHardwareDataType</string>
        <key>_detailLevel</key>
        <string>-2</string>
        <key>_items</key>
        <array>
            <dict>
                <key>MMM_entry</key>
                <dict>
                    <key>MMM_state</key>
                    <string>MMM_enabled</string>
                </dict>
                <key>SMC_version_system</key>
                <string>1.33f8</string>
                <key>_name</key>
                <string>hardware_overview</string>
                <key>boot_rom_version</key>
                <string>MBP51.007E.B05</string>
                <key>bus_speed</key>
                <string>1.07 GHz</string>
                <key>cpu_type</key>
                <string>Intel Core 2 Duo</string>
                <key>current_processor_speed</key>
                <string>2.53 GHz</string>
                <key>l2_cache</key>
                <string>6 MB</string>
                <key>machine_model</key>
                <string>MacBookPro5,1</string>
                <key>machine_name</key>
                <string>MacBook Pro</string>
                <key>number_processors</key>
                <integer>2</integer>
                <key>packages</key>
                <integer>1</integer>
                <key>physical_memory</key>
                <string>4 GB</string>
            </dict>
        </array>
        <key>_properties</key>
        <dict>
            <key>LOM_revision</key>
            <dict>
                <key>_order</key>
                <string>85</string>
            </dict>
            <key>MMM_state</key>
            <dict>
                <key>_order</key>
                <string>70</string>
            </dict>
            <key>SMC_version_other</key>
            <dict>
                <key>_order</key>
                <string>82</string>
            </dict>
            <key>SMC_version_riser</key>
            <dict>
                <key>_order</key>
                <string>81</string>
            </dict>
            <key>SMC_version_system</key>
            <dict>
                <key>_order</key>
                <string>80</string>
            </dict>
            <key>boot_rom_release_date</key>
            <dict>
                <key>_order</key>
                <string>52</string>
            </dict>
            <key>boot_rom_vendor</key>
            <dict>
                <key>_order</key>
                <string>50</string>
            </dict>
            <key>boot_rom_version</key>
            <dict>
                <key>_order</key>
                <string>51</string>
            </dict>
            <key>bus_speed</key>
            <dict>
                <key>_order</key>
                <string>45</string>
            </dict>
            <key>cores_per_package</key>
            <dict>
                <key>_order</key>
                <string>24</string>
            </dict>
            <key>cpu_interconnect_speed</key>
            <dict>
                <key>_order</key>
                <string>46</string>
            </dict>
            <key>cpu_type</key>
            <dict>
                <key>_order</key>
                <string>15</string>
            </dict>
            <key>current_processor_speed</key>
            <dict>
                <key>_order</key>
                <string>17</string>
            </dict>
            <key>l2_cache</key>
            <dict>
                <key>_order</key>
                <string>26</string>
            </dict>
            <key>l2_cache_core</key>
            <dict>
                <key>_order</key>
                <string>26</string>
            </dict>
            <key>l2_cache_share</key>
            <dict>
                <key>_order</key>
                <string>26</string>
            </dict>
            <key>l2_cache_size</key>
            <dict>
                <key>_order</key>
                <string>26</string>
            </dict>
            <key>l3_cache</key>
            <dict>
                <key>_order</key>
                <string>27</string>
            </dict>
            <key>l3_cache_processor</key>
            <dict>
                <key>_order</key>
                <string>27</string>
            </dict>
            <key>l3_cache_size</key>
            <dict>
                <key>_order</key>
                <string>27</string>
            </dict>
            <key>machine_model</key>
            <dict>
                <key>_order</key>
                <string>11</string>
            </dict>
            <key>machine_name</key>
            <dict>
                <key>_order</key>
                <string>10</string>
            </dict>
            <key>maximum_processor_speed</key>
            <dict>
                <key>_order</key>
                <string>19</string>
            </dict>
            <key>minimum_processor_speed</key>
            <dict>
                <key>_order</key>
                <string>18</string>
            </dict>
            <key>number_cpus</key>
            <dict>
                <key>_order</key>
                <string>20</string>
            </dict>
            <key>number_processors</key>
            <dict>
                <key>_order</key>
                <string>22</string>
            </dict>
            <key>packages</key>
            <dict>
                <key>_order</key>
                <string>20</string>
            </dict>
            <key>physical_memory</key>
            <dict>
                <key>_order</key>
                <string>40</string>
            </dict>
            <key>platform_cpu_features</key>
            <dict>
                <key>_order</key>
                <string>30</string>
            </dict>
            <key>platform_cpu_htt</key>
            <dict>
                <key>_order</key>
                <string>28</string>
            </dict>
            <key>platform_cpu_vendor</key>
            <dict>
                <key>_order</key>
                <string>12</string>
            </dict>
            <key>platform_manufacturer</key>
            <dict>
                <key>_order</key>
                <string>4</string>
            </dict>
            <key>platform_product_name</key>
            <dict>
                <key>_order</key>
                <string>2</string>
            </dict>
            <key>platform_version</key>
            <dict>
                <key>_order</key>
                <string>6</string>
            </dict>
            <key>volumes_anonymous</key>
            <dict>
                <key>_detailLevel</key>
                <string>-1</string>
                <key>_maxDetailLevel</key>
                <string>-1</string>
            </dict>
        </dict>
        <key>_timeStamp</key>
        <date>2010-04-26T17:07:10Z</date>
        <key>_versionInfo</key>
        <dict>
            <key>com.apple.SystemProfiler.SPPlatformReporter</key>
            <string>1401</string>
        </dict>
    </dict>
</array>
</plist>

Can you convert this information into bogomips somehow?

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 26-Apr-2010 5:23pm

Yes, we have there what we need

<key>current_processor_speed</key>
<string>2.53 GHz</string>

So we must parse this output and after use similar method like we have for Windows.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 26-Apr-2010 5:53pm

In [470]:

#CommitTicketReference repository="" revision="470"
refs #17 - CPU frequency calculator implemented for Mac OS (Darwin)

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by yegor256 on 26-Apr-2010 5:55pm

please, review, and reopen the ticket if I implemented it wrong.

from phprack.

yegor256 avatar yegor256 commented on August 15, 2024

migrated from Trac, where originally posted by netcoderpl on 26-Apr-2010 8:40pm

It was correctly implemented. Ticket is closed.

from phprack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.