Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7D774200BDB for ; Mon, 12 Dec 2016 15:54:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7C20C160B0D; Mon, 12 Dec 2016 14:54:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C669B160B35 for ; Mon, 12 Dec 2016 15:53:59 +0100 (CET) Received: (qmail 86551 invoked by uid 500); 12 Dec 2016 14:53:58 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 86266 invoked by uid 99); 12 Dec 2016 14:53:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2016 14:53:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9F4542C03DF for ; Mon, 12 Dec 2016 14:53:58 +0000 (UTC) Date: Mon, 12 Dec 2016 14:53:58 +0000 (UTC) From: "Robert Stupp (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13034) Move to FastThreadLocalThread and FastThreadLocal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Dec 2016 14:54:00 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13034?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Stupp updated CASSANDRA-13034: ------------------------------------- Fix Version/s: 3.x Status: Patch Available (was: Open) ||cassandra-3.X|[branch|https://github.com/apache/cassandra/compare/cassand= ra-3.X...snazy:13034-fast-thread-local-thread-3.X]|[testall|http://cassci.d= atastax.com/view/Dev/view/snazy/job/snazy-13034-fast-thread-local-thread-3.= X-testall/lastSuccessfulBuild/]|[dtest|http://cassci.datastax.com/view/Dev/= view/snazy/job/snazy-13034-fast-thread-local-thread-3.X-dtest/lastSuccessfu= lBuild/] ||trunk|[branch|https://github.com/apache/cassandra/compare/trunk...snazy:1= 3034-fast-thread-local-thread-trunk]|[testall|http://cassci.datastax.com/vi= ew/Dev/view/snazy/job/snazy-13034-fast-thread-local-thread-trunk-testall/la= stSuccessfulBuild/]|[dtest|http://cassci.datastax.com/view/Dev/view/snazy/j= ob/snazy-13034-fast-thread-local-thread-trunk-dtest/lastSuccessfulBuild/] > Move to FastThreadLocalThread and FastThreadLocal > ------------------------------------------------- > > Key: CASSANDRA-13034 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1303= 4 > Project: Cassandra > Issue Type: Bug > Reporter: Robert Stupp > Assignee: Robert Stupp > Fix For: 3.x > > > (Supersedes/includes CASSANDRA-13033 for 3.X & trunk) > We still use {{ThreadLocal}} in a couple of places, so I was curious how = much faster {{FastThreadLocal}} is compared to {{ThreadLocal}}. A micro ben= ch tells, that {{FastThreadLocal}} has a runtime of ~2.7ns and {{ThreadLoca= l}} of ~4.7ns - about 2ns slower (EDIT: subtracted baseline). > However, looking at the implementations it seems that {{ThreadLocal}}=C2= =A0has more dependent pointer gets than {{FastThreadLocal}}. This (CPU cach= e misses) is not reflected in the artificial benchmark below. > The patch migrates all {{Thread}} instances (except a few in tests) and a= ll {{ThreadLocal}} instances. > {code:title=3DFastThreadLocalBench with 4 threads on 4 core CPU} > [java] FastThreadLocalBench.baseline 2 avgt 5 = 3.023 =C2=B1 0.081 ns/op > [java] FastThreadLocalBench.fastThreadLocal 2 avgt 5 = 5.610 =C2=B1 0.154 ns/op > [java] FastThreadLocalBench.fastThreadLocal 4 avgt 5 = 5.653 =C2=B1 0.042 ns/op > [java] FastThreadLocalBench.fastThreadLocal 8 avgt 5 = 5.763 =C2=B1 0.588 ns/op > [java] FastThreadLocalBench.fastThreadLocal 12 avgt 5 = 5.673 =C2=B1 0.117 ns/op > [java] FastThreadLocalBench.threadLocal 2 avgt 5 = 7.708 =C2=B1 0.723 ns/op > [java] FastThreadLocalBench.threadLocal 4 avgt 5 = 7.604 =C2=B1 0.059 ns/op > [java] FastThreadLocalBench.threadLocal 8 avgt 5 = 7.629 =C2=B1 0.080 ns/op > [java] FastThreadLocalBench.threadLocal 12 avgt 5 = 7.858 =C2=B1 0.483 ns/op > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)