×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Absolutely agree.
Unless there's a hugely egregious penalty, make it easier for the next person who has to work on it - it might be you!
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Daniel Gross
Sent: Sunday, June 5, 2022 8:57 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Using %scan and %subst vs pointers
Hi,
Am 05.06.2022 um 16:38 schrieb Vinay Gavankar <vinaygav@xxxxxxxxx>:
For a given string (about 300 bytes with 34 fields, which is expected to be
the average), I iterated each of them 10000 times and captured the time
taken by each:
#1 - 70 milli-seconds
#2 - 86 milli-seconds
#3 - 712 milli-seconds
Not sure if my code for #3 is not efficient, but did not expect it to be
that bad. Even though #2 has the simplest code, I would probably go with #1.
For what it's worth - I wouldn't go with 13 lines of code for 16/10000 milli-seconds if I can have 3 lines of really simply and obvious code.
If you think about the 30 minutes that the next guy is trying to understand the code vs. the 1 minute you can parse over 1 billion lines of data, before your code is more efficient ;-)
If the advantage is that small - go with the code that's easier to understand and maintain - the next-poor-guy will thank you.
Just my 2 ct
Regards,
Daniel
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.