From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A1F083858D20 for ; Mon, 1 Apr 2024 13:12:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A1F083858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A1F083858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711977169; cv=none; b=I3XYHC4GDa52wFoYf6hIkGFyAZOeDuBhexVaPF65984cbvsAb0u9m5O8Xxw3Y4DxTMJGt5fbTe/VkSKgbAfvXlLmZcnH/Q3LU9vF0XXxHzPMbJOdcJig9BqdIcVi9k9lVvdz5wz4O1koTVrh+RL8wzQfrXS34BbNHnIbFREJ2oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711977169; c=relaxed/simple; bh=RDdSY0Xx6N31YOHKqcorzZ8dPTjfmHTTHjs0CCBsDT0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DiLTutNjewZm6ZJfwWgpMpIWEiONB3ggqq2Zpx9+RsL32WtT/fCqPt7DzS5sdmjnV/B1ZFaKtIyZ1hfRGtEzq23s41gVuoje+97iMWV1zFNSUUekonwqNExp3X3fQ8lErJwTdVV+gLaMpR56312VOIlNKl3BzyXPUrAUnpx6azE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711977167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Jw6sLJ/qEOrFrEkn9AysEXC5/RnHvyty2nRMBHlRkcY=; b=KTOOMukBwB7EzcR+KLCllG4+XsTcV5ZkAPL62sKif2NmE32yIeysJwv4xEKsTcXB7TDUDV sCrwpIMRd+/M8qagZ9RWeTS9faZZPYLBtxfGpLGOpYIcoMbBTbdVSXPEO6F7DP0986f/3f k8+W4ejWSbhrBw14i1BHpmH+UWI3Q1k= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-OUrM-wDeMKKgr2P-KQISOA-1; Mon, 01 Apr 2024 09:12:44 -0400 X-MC-Unique: OUrM-wDeMKKgr2P-KQISOA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D5323C0CEE3; Mon, 1 Apr 2024 13:12:43 +0000 (UTC) Received: from oldenburg3.str.redhat.com (unknown [10.39.192.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB9F91121313; Mon, 1 Apr 2024 13:12:42 +0000 (UTC) From: Florian Weimer To: abush wang Cc: abushwang via Libc-alpha , adhemerval.zanella@linaro.org Subject: Re: [PATCH] stdlib: reorganize stdlib Makefile routines by functionality References: Date: Mon, 01 Apr 2024 15:12:37 +0200 In-Reply-To: (abush wang's message of "Mon, 1 Apr 2024 19:47:29 +0800") Message-ID: <87plv91b22.fsf@oldenburg3.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * abush wang: > This is test: > ``` > uint64_t getnsecs() { > uint32_t lo, hi; > __asm__ __volatile__ ( > "rdtsc" : "=a"(lo), "=d"(hi) > ); > return ((uint64_t)hi << 32) | lo; > } > > int main() { > const int num_iterations = 1; > uint64_t start, end, total_time = 0; > > start = getnsecs(); > for (int i = 0; i < num_iterations; i++) { > (void) lrand48(); > } > end = getnsecs(); > total_time += (end - start); > > printf("Average time for lrand48: %lu cycles\n", total_time / num_iterations); > return 0; > } > ``` > before: > Average time for lrand48: 21418 cycles > > after: > Average time for lrand48: 9892 cycles Do you see this on x86-64? So this isn't a displacement range issue? It could be that this is a random performance change due to code alignment, and not actually caused by the direct call distance. Thanks, Florian