public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: bleung@chromium.org, groeck@chromium.org,
	chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/7] platform/chrome: Implement quickselect for median calculation
Date: Fri, 10 Nov 2023 13:58:04 +0800	[thread overview]
Message-ID: <ZU3GbHTA3x19h2Zi@google.com> (raw)
In-Reply-To: <20231109185439.1535962-1-visitorckw@gmail.com>

On Fri, Nov 10, 2023 at 02:54:32AM +0800, Kuan-Wei Chiu wrote:
> In addition to the algorithmic improvement, this series includes
> several typo fixes to enhance the overall code quality and maintain
> consistency.

The typo fixes are not necessary to be in the same series.  I would suggest
you separate the typo fixes to "an" (squash them) independent patch.

Please also use more specific prefix (e.g. "platform/chrome: sensorhub: ") to
make the title more clear.

> static int quickselect_test(void)
> {
> 	s64 *arr;
> 	s64 median_old, median_new;
> 	ktime_t start, end;
> 	s64 delta;
> 	const size_t array_length = 1000;
> 	const s64 seed = 1;
> 
> 	arr = kmalloc(array_length * sizeof(s64), GFP_KERNEL);
> 	if (!arr)
> 		return -ENOMEM;
> 
> 	init_array(arr, array_length, seed);
> 	start = ktime_get();
> 	median_old = cros_ec_sensor_ring_median(arr, array_length);
> 	end = ktime_get();
> 	delta = ktime_us_delta(end, start);
> 	printk(KERN_ALERT "time of original function: %lld\n", delta);
> 
> 	init_array(arr, array_length, seed);
> 	start = ktime_get();
> 	median_new = cros_ec_sensor_ring_median_new(arr, array_length);
> 	end = ktime_get();
> 	delta = ktime_us_delta(end, start);
> 	printk(KERN_ALERT "time of new function: %lld\n", delta);
> 
> 	kfree(arr);
> 
> 	/* return 0 on success */
> 	return median_old != median_new;
> }
> 
> /* Result:
>  * time of original function: 897
>  * time of new function: 16
>  */

Could you also run the micro-benchmark for n = 64[2][3]?

[2] https://elixir.bootlin.com/linux/v6.6/source/include/linux/platform_data/cros_ec_sensorhub.h#L64
[3] https://elixir.bootlin.com/linux/v6.6/source/drivers/platform/chrome/cros_ec_sensorhub_ring.c#L154

  parent reply	other threads:[~2023-11-10 19:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 18:54 [PATCH 0/7] platform/chrome: Implement quickselect for median calculation Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 1/7] platform/chrome: Fix typo 'preceeds' in comment Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 2/7] platform/chrome: Fix typo 'perod' " Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 3/7] platform/chrome: Fix typo 'noone' " Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 4/7] platform/chrome: Fix typo 'lantency' " Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 5/7] platform/chrome: Fix typo 'kifo' in commet Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 6/7] platform/chrome: Fix typo 'change' in comment Kuan-Wei Chiu
2023-11-09 18:54 ` [PATCH 7/7] platform/chrome: Implement quickselect for median calculation Kuan-Wei Chiu
2023-11-10  5:57   ` Tzung-Bi Shih
2023-11-10  5:58 ` Tzung-Bi Shih [this message]
2023-11-10 14:52   ` [PATCH 0/7] " Kuan-Wei Chiu
2023-11-10 16:52   ` [PATCH v2] platform/chrome: sensorhub: Fix typos Kuan-Wei Chiu
2023-11-10 18:34     ` Randy Dunlap
2023-11-13  3:23     ` patchwork-bot+chrome-platform
2023-11-14  6:00     ` patchwork-bot+chrome-platform
2023-11-10 16:53   ` [PATCH v2] platform/chrome: sensorhub: Implement quickselect for median calculation Kuan-Wei Chiu
2023-11-13  4:50     ` patchwork-bot+chrome-platform
2023-11-14  6:00     ` patchwork-bot+chrome-platform

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZU3GbHTA3x19h2Zi@google.com \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=visitorckw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox