Article View: comp.lang.c++
Article #130Re: “The end of software secrecy is almost upon us"
From: Johann 'Myrkraverk' Oskarsson
Date: Wed, 21 Oct 2026 12:21
Date: Wed, 21 Oct 2026 12:21
42 lines
2846 bytes
2846 bytes
On 10/21/2026 9:30 AM, Lawrence D’Oliveiro wrote:
> On Tue, 20 Oct 2026 17:15:28 -0000 (UTC), Thomas Koenig wrote:
>
>> But the attitude of not caring about speed can have grave results
>> when the inefficiencies pile up.
>
> That’s not usually how code works, though. Execution time tends to
> follow a Pareto distribution -- spend your effort on the 10% of the
> code where 90% of the time is being spent, and that gives significant
> improvements without having to mess around with the other 90% of the
> code.
This is true of code. Yet, you can math yourself to a better solution.
The /obvious/ example everyone here knows is sum of integers, as
int sumint( int a ) {
int value = 0 ;
for ( int i = 1 ; i <= a ; i++ )
value += i ;
return value ;
}
whereas a mathematician might code it as
int sumint( int a ) { return a * ( a + 1 ) / 2 ; }
which is much faster for a large a.
The point I'm making here is that if you myopically focus too much on
the hot code, you might miss an obvious mathematical optimization.
I added sci.math in case the wizards there want to add more obvious ex-
amples I may not be aware of.
Best wishes, and happy optimizations!
--
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social
Technical Details
Message-ID:
<z72CS.536278$FEvb.199923@fx12.ams4>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer05.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx12.ams4.POSTED!not-for-mailReferences:
<11amvre$15far$1@dont-email.me> <11b5tdb$2cs5l$1@dont-email.me> <11b64cp$end$1@panix2.panix.com> <11b64hj$2faos$1@dont-email.me> <11b679m$6dl$1@panix2.panix.com> <11b6vc4$2npqv$1@dont-email.me> <11b87jg$37b7t$1@dont-email.me> <11b94k2$3hdo3$3@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer05.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx12.ams4.POSTED!not-for-mail MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: “The end of software secrecy is almost upon us" Newsgroups: comp.lang.fortran,comp.lang.c++,alt.comp.lang.rust,alt.folklore.computers,sci.math References: <11amvre$15far$1@dont-email.me> <11b5tdb$2cs5l$1@dont-email.me> <11b64cp$end$1@panix2.panix.com> <11b64hj$2faos$1@dont-email.me> <11b679m$6dl$1@panix2.panix.com> <11b6vc4$2npqv$1@dont-email.me> <11b87jg$37b7t$1@dont-email.me> <11b94k2$3hdo3$3@dont-email.me> Content-Language: en-US From: Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> Organization: Watcom Pro Ltd. In-Reply-To: <11b94k2$3hdo3$3@dont-email.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Lines: 42 Message-ID: <z72CS.536278$FEvb.199923@fx12.ams4> X-Complaints-To: abuse@easynews.com X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly. Date: Wed, 21 Oct 2026 20:21:49 +0800 X-Received-Bytes: 2702