Skip to content

Instantly share code, notes, and snippets.

Madusudanan.B.N Madusudanan

Block or report user

Report or block Madusudanan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Madusudanan
Madusudanan / RunExample.class
Created Oct 5, 2017
Scala pattern matching decompiled - 3
View RunExample.class
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
import RunExample.delayedInit.body;
import scala.App;
import scala.Function0;
import scala.App.class;
@Madusudanan
Madusudanan / RunExample.class
Created Oct 5, 2017
Scala pattern matching decompiled - 2
View RunExample.class
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
import RunExample.delayedInit.body;
import scala.App;
import scala.Function0;
import scala.App.class;
@Madusudanan
Madusudanan / RunExample.class
Last active Oct 5, 2017
Scala pattern matching decompiled - 1
View RunExample.class
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
import RunExample.delayedInit.body;
import scala.App;
import scala.Function0;
import scala.Predef.;
import scala.collection.mutable.ListBuffer;
@Madusudanan
Madusudanan / ComplexNumber.java
Created Apr 27, 2017
Complex number case class decompiled
View ComplexNumber.java
public class ComplexNumber implements scala.Product,scala.Serializable {
public static scala.Option<scala.Tuple2<java.lang.Object, java.lang.Object>> unapply(ComplexNumber);
Code:
0: getstatic #20 // Field ComplexNumber$.MODULE$:LComplexNumber$;
3: aload_0
4: invokevirtual #22 // Method ComplexNumber$.unapply:(LComplexNumber;)Lscala/Option;
7: areturn
public static ComplexNumber apply(double, double);
Code:
View CaseObjectDemo.java
public final class CaseObjectDemo {
public static java.lang.String toString();
Code:
0: getstatic #16 // Field CaseObjectDemo$.MODULE$:LCaseObjectDemo$;
3: invokevirtual #18 // Method CaseObjectDemo$.toString:()Ljava/lang/String;
6: areturn
public static int hashCode();
Code:
0: getstatic #16 // Field CaseObjectDemo$.MODULE$:LCaseObjectDemo$;
@Madusudanan
Madusudanan / Book_Decoded.java
Created Dec 3, 2016
A scala case class decompiled using javap
View Book_Decoded.java
public class Book implements scala.Product,scala.Serializable {
public static scala.Option<scala.Tuple3<java.lang.Object, java.lang.String, java.lang.Object>> unapply(Book);
Code:
0: getstatic #20 // Field Book$.MODULE$:LBook$;
3: aload_0
4: invokevirtual #22 // Method Book$.unapply:(LBook;)Lscala/Option;
7: areturn
public static Book apply(int, java.lang.String, long);
Code:
View pg_buffercache.sql
SELECT c.relname,count(*) AS buffers
FROM pg_class c INNER JOIN pg_buffercache b
ON b.relfilenode=c.relfilenode INNER JOIN pg_database d
ON (b.reldatabase=d.oid AND d.datname=current_database())
GROUP BY c.relname
ORDER BY 2 DESC LIMIT 100;
View pg_stat.sql
SELECT
(total_time / 1000 / 60)::decimal as total_minutes,
(total_time/calls)::decimal as average_time,
query
FROM pg_stat_statements
ORDER BY 1 DESC
LIMIT 100;
View pg_plan_seq_2
performance_test=# explain (analyze,buffers) select count(*) from users;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------
Aggregate (cost=48214.95..48214.96 rows=1 width=0) (actual time=426.385..426.385 rows=1 loops=1)
Buffers: shared hit=32 read=35683
-> Seq Scan on users (cost=0.00..45714.96 rows=999996 width=0) (actual time=0.036..285.363 rows=1000000 loops=1)
Buffers: shared hit=32 read=35683
Planning time: 0.048 ms
Execution time: 426.431 ms
@Madusudanan
Madusudanan / pg_plan_seq_1
Last active May 10, 2016
Postgres Query plan for a sequential scan #1
View pg_plan_seq_1
performance_test=# explain (analyze,buffers) select count(*) from users;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------
Aggregate (cost=48214.95..48214.96 rows=1 width=0) (actual time=3874.445..3874.445 rows=1 loops=1)
Buffers: shared read=35715
-> Seq Scan on users (cost=0.00..45714.96 rows=999996 width=0) (actual time=6.024..3526.606 rows=1000000 loops=1)
Buffers: shared read=35715
Planning time: 0.114 ms
Execution time: 3874.509 ms
You can’t perform that action at this time.