Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Hertz constants in my code

37 views
Skip to first unread message

Scott Lurndal

unread,
Oct 24, 2016, 2:01:05 PM10/24/16
to
"micha...@gmail.com" <c1234...@gmail.com> writes:
>When I see timing in programs such as hertz, how do I interpret them.

https://en.wikipedia.org/wiki/Hertz
Message has been deleted

Christian Gollwitzer

unread,
Oct 24, 2016, 3:00:13 PM10/24/16
to
Am 24.10.16 um 20:11 schrieb c1234...@gmail.com:
> On Monday, October 24, 2016 at 2:01:05 PM UTC-4, Scott Lurndal
> wrote:
>> "micha...@gmail.com" <micha...@gmail.com> writes:
>>> When I see timing in programs such as hertz, how do I interpret
>>> them.
>>
>> https://en.wikipedia.org/wiki/Hertz
>
> But what does CPU time have to do with my code, instructions per
> second that is. Sure, my CPU can read and process a certain number of
> instructions, but I think the various HERTZ constants in my code
> means something else. What's the truth?

How should we know? Unless you show "those various HERTZ constants in
your code", how do you think we could understand what they are doing?

Christian

Scott Lurndal

unread,
Oct 24, 2016, 3:05:54 PM10/24/16
to
c1234...@gmail.com writes:
>On Monday, October 24, 2016 at 2:01:05 PM UTC-4, Scott Lurndal wrote:
>> "micha...@gmail.com" <micha...@gmail.com> writes:
>> >When I see timing in programs such as hertz, how do I interpret them.
>>
>> https://en.wikipedia.org/wiki/Hertz
>
>But what does CPU time have to do with my code, instructions per second that is. Sure, my CPU can read and process a certain number of instructions, but I think the various HERTZ constants in my code means something else. What's the truth?

You've neither described the hardware platform or the application,
so we'd simply be guessing.

Ask whomever wrote the code what their intent was.

In Unixland, HERTZ is the frequency of the system clock, as visible
to applications - traditionally, it has been set to 100, which
implies a resolution of 10 milliseconds.

With linux, the value of HERTZ (or HZ) is a kernel configuration parameter
(unless you're using a tickless kernel).

When looking at CPU performance, IPC (instructions per cycle) is the
interesting metric. Given that and the cycle time, one can derive
the mean instructions-per-second count. Note that IPC is workload
dependent (e.g. most modern microprocessors can execute two 64-bit
additions per cycle, but it may take 6+ cycles to execute an integer
divide instruction).

Melzzzzz

unread,
Oct 24, 2016, 4:14:15 PM10/24/16
to
On Mon, 24 Oct 2016 11:11:00 -0700 (PDT)
c1234...@gmail.com wrote:

> On Monday, October 24, 2016 at 2:01:05 PM UTC-4, Scott Lurndal wrote:
> > "micha...@gmail.com" <micha...@gmail.com> writes:
> > >When I see timing in programs such as hertz, how do I interpret
> > >them.
> >
> > https://en.wikipedia.org/wiki/Hertz
>
> But what does CPU time have to do with my code, instructions per
> second that is. Sure, my CPU can read and process a certain number of
> instructions, but I think the various HERTZ constants in my code
> means something else. What's the truth?
>
> Michael

CPU/MEMORY clock rate is in HERTZ.


--
press any key to continue or any other to quit

Vir Campestris

unread,
Oct 24, 2016, 4:21:14 PM10/24/16
to
On 24/10/2016 20:05, Scott Lurndal wrote:
> When looking at CPU performance, IPC (instructions per cycle) is the
> interesting metric. Given that and the cycle time, one can derive
> the mean instructions-per-second count.

Only if the architectures are the same.

Different architectures require different numbers of instructions to do
the same work. Traditionally CISC architectures run fewer instructions
that each do more work compared to RISC.

Andy

Gareth Owen

unread,
Oct 25, 2016, 12:57:03 AM10/25/16
to
sc...@slp53.sl.home (Scott Lurndal) writes:

> c1234...@gmail.com writes:
>>On Monday, October 24, 2016 at 2:01:05 PM UTC-4, Scott Lurndal wrote:
>>> "micha...@gmail.com" <micha...@gmail.com> writes:
>>> >When I see timing in programs such as hertz, how do I interpret them.
>>>
>>> https://en.wikipedia.org/wiki/Hertz
>>
>>But what does CPU time have to do with my code, instructions per
>> second that is. Sure, my CPU can read and process a certain number
>> of instructions, but I think the various HERTZ constants in my code
>> means something else. What's the truth?
>
> You've neither described the hardware platform or the application,
> so we'd simply be guessing.

Yeah, but Everybody Hertz.

David Brown

unread,
Oct 25, 2016, 3:12:09 AM10/25/16
to
Only sometimes.

David Brown

unread,
Oct 25, 2016, 3:16:07 AM10/25/16
to
The IPC for "big" cpus is so dependent on workload and circumstances
that it is meaningless by itself. Who cares if the processor can do 2
additions per clock cycle if it needs to wait 200 clock cycles for the
operands from main memory? You have to long at long-term averages of
performance at real tasks to have any sort of measurement of the speed
of a processor.

It is not for nothing that the processor measurements the Linux kernel
does at bootup are given in units of "BogoMips".


0 new messages