Skip to content

Instantly share code, notes, and snippets.

View pivovarit's full-sized avatar

Grzegorz Piwowarek pivovarit

View GitHub Profile

Questions to discuss within a team

  • Why do you need it? What problem you are solving? Is it right tool for the job? Why it is worth it? (Wrong answers: sexiness, just trying new things)
  • Will it help to deliver project faster or make it more maintainable or with better quality? 
  • Why you cannot solve it using existing stack?
  • How popular it is? Is it backed by big companies? Is it easy to find people using that? How many questions on stack overflow? How many people has it in CV on LinkedIn? etc.
  • If you want to use it because of better performance. Do you really need that performance? Can you show the data that it can confirm better performance?
  • How mature is it?
  • Is there someone else in a Company using it - how does their use case and findings compare to your use case?
  • Is it easy to find help? Or you will be learning it by your own?
  • Is There A Learning Curve? Is it easy to learn? Is your team able to specify lerning curve?

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

@yyx990803
yyx990803 / starcounter.js
Last active January 16, 2025 09:39
Count your total stars!
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
@ms-tg
ms-tg / jdk8_optional_monad_laws.java
Created November 11, 2013 21:14
Does JDK8's Optional class satisfy the Monad laws? Yes, it does.
/**
* ```
* Does JDK8's Optional class satisfy the Monad laws?
* =================================================
* 1. Left identity: true
* 2. Right identity: true
* 3. Associativity: true
*
* Yes, it does.
* ```
@jboner
jboner / latency.txt
Last active April 25, 2025 21:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
Hi David,
I came across your profile online and wanted to reach out about Development
Opportunities here at Groupon. The company is growing, and we're always
looking for folks with solid skills that can make positive contribution to
our continued success. Any chance you'd be open to a quick conversation
about opportunities, or for any possible networking potential? If so, let me
know when you're free and we can set up a time to chat. Also, if you are
interested, it would be great if you could forward a current resume over
that I can take a look at. I look forward to hearing back from you! Please
let me know if you have any questions.