Bitcoin Forum
July 31, 2026, 03:47:50 PM
Welcome,
Guest
. Please
login
or
register
.
News
:
COLDCARD users only: critical vulnerability risks funds stored on COLDCARD devices; immediate action required
Home
Help
Search
Login
Register
More
Bitcoin Forum
>
Bitcoin
>
Mining
>
[PATCH] jsMiner: perf improvement
Pages: [
1
]
« previous topic
next topic »
Print
Author
Topic: [PATCH] jsMiner: perf improvement (Read 2051 times)
mrb
(OP)
Legendary
Activity: 1512
Merit: 1034
[PATCH] jsMiner: perf improvement
May 30, 2011, 10:15:32 PM
Last edit: May 30, 2011, 11:54:58 PM by mrb
#1
I spent 15min, for fun, looking at possible optimizations for
jsMiner
. My patch simply inlines some functions, pre-computes constants, and caches array values, and ends up increasing its performance by ~1.7x under V8 (benchmarked within nodejs 0.1.97) on my Core i3-i380UM (1.33GHz), from 8.3 kHash/s to 13.9 kHsh/s.
This means jsMiner is "only" between 1/38th and 1/59th the performance of cpuminer 1.0.1:
* 'cryptopp' algo: 525 kHash/s
* '4way' algo: 825 kHash/s
See
http://pastie.org/1995279
1bitc0inplz
Member
Activity: 112
Merit: 10
Re: [PATCH] jsMiner: perf improvement
May 30, 2011, 11:07:25 PM
#2
Wow!
Thank you. I have not yet looked at your patch, but that is awesome that you were able to increase the performance like that.
I will look over this patch and post back up... But, I did want to post sooner rather than later to let you know that I saw your message.
Thanks again.
Mine @
http://pool.bitp.it
- No fees, virtually 0 stales, what's not to love!
Chat with us @ #bitp.it on irc.freenode.net
Learn more about our pool @
https://bitcointalk.org/index.php?topic=12181.0
AngelusWebDesign
Sr. Member
Activity: 392
Merit: 250
Re: [PATCH] jsMiner: perf improvement
May 30, 2011, 11:37:35 PM
#3
1bitcoinplz:
Have you looked into various techniques for Javascript optimization? I did a lot of that a few years ago when I wrote a Warcraft II clone that plays in the browser. I wanted to squeeze every CPU cycle I could out of the Javascript engines/CPUs of the time.
I read up on various things you can do -- I think it helped. You can even "compile" your code using a PHP/C/VB.net program to replace constants with actual numbers. That way, your code is readable/understandable, yet you're not using "variables" when you don't have to.
I wrote my own "obfuscator" as well, which reduced the file size and made it hard to follow.
1bitc0inplz
Member
Activity: 112
Merit: 10
Re: [PATCH] jsMiner: perf improvement
May 31, 2011, 06:04:58 AM
#4
I've been looking over the patch. It looks like you found some performance tweaks in the SHA implementation. That is, one area of our code where we just took a literal approach to the algorithm. So, I cannot say I'm surprised it can be cleaned up a bit.
mrb, did you want to setup a pull request on github? I'd like to see about incorporating your changes.
AngelusWebDesign, I was under the impression that browsers like Chrome and Safari did JIT compilation of Javascript... I wonder if inlining constants has as much an effect in those browsers? Either way, I have not looked too much into such techniques, though I should.
On a related note, we have been doing a lot of the backend stuff with node.js, and I must say... the V8 runtime & node.js are purely amazing! The turn around time on HTTP requests is super low, even with high volume. Having used ASP.NET and Rails on numerous other projects I think it'd be safe to say the CPU time and memory footprint of node.js is half of what they normally get.
Mine @
http://pool.bitp.it
- No fees, virtually 0 stales, what's not to love!
Chat with us @ #bitp.it on irc.freenode.net
Learn more about our pool @
https://bitcointalk.org/index.php?topic=12181.0
mrb
(OP)
Legendary
Activity: 1512
Merit: 1034
Re: [PATCH] jsMiner: perf improvement
May 31, 2011, 06:40:26 AM
#5
jsMiner actually performs even faster in Chrome than in node.js!
I am not suprised either by the performance gain I got. Some people in #bitcoin-dev wrongly claimed it was already optimized, when I knew it was not.
Don't have time to set up a pull req., sorry.
Stefan Thomas
Full Member
Activity: 234
Merit: 100
AKA: Justmoon
Re: [PATCH] jsMiner: perf improvement
July 01, 2011, 01:20:46 PM
#6
Would this sha256 function be safe for us to use inside Webcoin? Or is it "mining-specific" in some fashion? I can't see how it would be, just making sure.
Also, do you want to have a go at optimizing Webcoin's
JavaScript ECDSA stuff
as well? It's the bottleneck in Webcoin at the moment. Any speedup to the elliptic curve point multiplication or big integer math would be a godsend.
Twitter:
@justmoon
PGP: D16E 7B04 42B9 F02E 0660 C094 C947 3700 A4B0 8BF3
Pages: [
1
]
Print
Bitcoin Forum
>
Bitcoin
>
Mining
>
[PATCH] jsMiner: perf improvement
« previous topic
next topic »
Jump to:
Please select a destination:
-----------------------------
Bitcoin
-----------------------------
=> Bitcoin Discussion
===> Legal
===> Press
===> Meetups
===> Important Announcements
=> Development & Technical Discussion
===> Wallet software
=====> Electrum
=====> Bitcoin Wallet for Android
=====> BitcoinJ
=====> Armory
=====> Mycelium
=====> Hardware wallets
=> Mining
===> Mining support
===> Pools
===> Mining software (miners)
===> Hardware
=====> Group buys
===> Mining speculation
=> Bitcoin Technical Support
=> Project Development
-----------------------------
Economy
-----------------------------
=> Economics
===> Speculation
=> Marketplace
===> Goods
=====> Computer hardware
=====> Digital goods
=======> Invites & Accounts
=====> Collectibles
===> Services
===> Currency exchange
===> Gambling
=====> Games and rounds
=====> Investor-based games
=====> Gambling discussion
===> Lending
=====> Long-term offers
===> Securities
===> Auctions
===> Service Announcements
=====> Micro Earnings
===> Service Discussion
=====> Web Wallets
=====> Exchanges
=> Trading Discussion
===> Scam Accusations
===> Reputation
-----------------------------
Other
-----------------------------
=> Meta
===> Bitcoin Wiki
=> Politics & Society
=> Beginners & Help
=> Off-topic
=> Serious discussion
===> Ivory Tower
=> Archival
===> New forum software
===> Корзина
===> CPU/GPU Bitcoin mining hardware
===> Chinese students
===> Obsolete (buying)
===> Obsolete (selling)
===> MultiBit
-----------------------------
Alternate cryptocurrencies
-----------------------------
=> Altcoin Discussion
=> Announcements (Altcoins)
===> Tokens (Altcoins)
=> Mining (Altcoins)
===> Pools (Altcoins)
=> Marketplace (Altcoins)
===> Service Announcements (Altcoins)
===> Service Discussion (Altcoins)
===> Bounties (Altcoins)
=> Speculation (Altcoins)
-----------------------------
Local
-----------------------------
=> العربية (Arabic)
===> العملات البديلة (Altcoins)
=====> النقاشات
===> إستفسارات و أسئلة المبتدئين
===> التعدين
===> النقاشات الأخرى
===> منصات التبادل
=> Bahasa Indonesia (Indonesian)
===> Marketplace (Bahasa Indonesia)
===> Mining (Bahasa Indonesia)
===> Altcoins (Bahasa Indonesia)
===> Trading dan Spekulasi
===> Ekonomi, Politik, dan Budaya
===> Topik Lainnya
=> Español (Spanish)
===> Mercado y Economía
=====> Servicios
=====> Trading y especulación
===> Hardware y Minería
===> Esquina Libre
===> Mercadillo
=====> Mexico
=====> Argentina
=====> España
=====> Centroamerica y Caribe
===> Primeros pasos y ayuda
===> Altcoins (criptomonedas alternativas)
=====> Minería de altcoins
=====> Servicios
=====> Tokens (Español)
=> 中文 (Chinese)
===> 跳蚤市场
===> 山寨币
===> 媒体
===> 挖矿
===> 离题万里
=> Hrvatski (Croatian)
===> Trgovina
===> Altcoins (Hrvatski)
=====> Announcements (Hrvatski)
===> Off-topic (Hrvatski)
=> Deutsch (German)
===> Anfänger und Hilfe
===> Mining (Deutsch)
===> Trading und Spekulation
===> Projektentwicklung
===> Off-Topic (Deutsch)
===> Treffen
===> Presse
===> Altcoins (Deutsch)
=====> Announcements (Deutsch)
===> Marktplatz
=====> Auktionen
=====> Suche
=====> Biete
=> Ελληνικά (Greek)
===> Αγορά
===> Mining Discussion (Ελληνικά)
===> Altcoins (Ελληνικά)
=====> Altcoin Announcements (Ελληνικά)
=====> Altcoin Mining (Ελληνικά)
=> עברית (Hebrew)
=> Français
===> Actualité et News
===> Débutants
===> Discussions générales et utilisation du Bitcoin
===> Mining et Hardware
===> Économie et spéculation
===> Place de marché
=====> Échanges
=====> Produits et services
=====> Petites annonces
===> Le Bitcoin et la loi
===> Wiki, documentation et traduction
===> Développement et technique
===> Vos sites et projets
===> Hors-sujet
===> Altcoins (Français)
=====> Annonces
=> India
===> Mining (India)
===> Marketplace (India)
===> Regional Languages (India)
===> Press & News from India
===> Alt Coins (India)
===> Buyer/ Seller Reputations (India)
===> Off-Topic (India)
=> Italiano (Italian)
===> Guide (Italiano)
===> Progetti
===> Discussioni avanzate e sviluppo
===> Trading, analisi e speculazione
===> Mercato
=====> Mercato valute
=====> Beni
=====> Servizi
=====> Esercizi commerciali
=====> Hardware/Mining (Italiano)
=====> Gambling (Italiano)
===> Accuse scam/truffe
===> Mining (Italiano)
===> Alt-Currencies (Italiano)
=====> Annunci
===> Raduni/Meeting (Italiano)
===> Crittografia e decentralizzazione
===> Off-Topic (Italiano)
=> 日本語 (Japanese)
===> アルトコイン
=> Nederlands (Dutch)
===> Markt
===> Gokken/lotterijen
===> Mining (Nederlands)
===> Beurzen
===> Alt Coins (Nederlands)
===> Off-topic (Nederlands)
===> Meetings (Nederlands)
=> Nigeria (Naija)
===> Politics and society (Naija)
===> Off-topic (Naija)
=> 한국어 (Korean)
===> 대체코인 Alt Coins (한국어)
=> Pilipinas
===> Altcoins (Pilipinas)
=====> Altcoin Announcements (Pilipinas)
===> Pamilihan
===> Others (Pilipinas)
=> Polski
===> Tablica ogłoszeń
===> Alternatywne kryptowaluty
=====> Nowe kryptowaluty i tokeny
=====> Tablica ogłoszeń (altcoiny)
=> Português (Portuguese)
===> Primeiros Passos (Iniciantes)
===> Economia & Mercado
===> Mineração em Geral
===> Desenvolvimento & Discussões Técnicas
===> Criptomoedas Alternativas
===> Brasil
===> Portugal
=> Русский (Russian)
===> Новички
===> Cepвиcы
=====> Барахолка
=====> Обменники
===> Идеи
===> Кодеры
===> Майнеры
===> Политика
===> Трейдеры
===> Альтернативные криптовалюты
=====> Токены
=====> Бayнти и aиpдpoпы
===> Хайпы
===> Работа
===> Разное
===> Oбcyждeниe Bitcoin
=====> Новости
=====> Юристы
=> Română (Romanian)
===> Anunturi importante
===> Offtopic
===> Market
=====> Discutii Servicii
===> Minerit
===> Tutoriale
===> Bine ai venit!
===> Presa
===> Altcoins (Monede Alternative)
=====> Anunturi Monede Alternative
=> Skandinavisk
=> Türkçe (Turkish)
===> Bitcoin Haberleri
===> Pazar Alanı
===> Madencilik
===> Ekonomi
===> Servisler
=====> Fonlar
===> Proje Geliştirme
===> Alternatif Kripto-Paralar
=====> Madencilik (Alternatif Kripto-Paralar)
=====> Duyurular (Alternatif Kripto-Paralar)
===> Konu Dışı
===> Yeni Başlayanlar & Yardım
===> Buluşmalar
=> Other languages/locations
Loading...