Skip to content

Instantly share code, notes, and snippets.

View mgaudet's full-sized avatar

Matthew Gaudet mgaudet

View GitHub Profile
matthew@ZenTower:~/unified-git$ time git gc
Enumerating objects: 26048854, done.
Counting objects: 100% (26048854/26048854), done.
Delta compression using up to 64 threads
Compressing objects: 100% (10307736/10307736), done.
Writing objects: 100% (26048854/26048854), done.
Total 26048854 (delta 15565600), reused 25346912 (delta 14917729), pack-reused 0
Enumerating cruft objects: 27, done.
Traversing cruft objects: 656, done.
Counting objects: 100% (27/27), done.
@mgaudet
mgaudet / test.html
Created September 4, 2024 20:00
Microbenchmark for testing wrapper allocation and local alloc sites: https://bugzilla.mozilla.org/show_bug.cgi?id=1892764
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Div Allocation Timer</title>
</head>
<body>
<h1>Div Allocation Timer</h1>
<p>Click the button below to allocate 1000000 div elements and measure the time taken.</p>
<button onclick="measureAllocationTime()">Allocate Divs</button>
@mgaudet
mgaudet / displayDemo.asm
Created November 8, 2022 04:36
displaydemo.asm
#-------------------------------------------------------------------------------
# MultiTimer Common File
#
# Author: Zachary Selk
# Date: Jul 18, 2019
#-------------------------------------------------------------------------------
.data
.align 2
DISPLAY_CONTROL: .word 0xFFFF0008
DISPLAY_DATA: .word 0xFFFF000C
$ ../../../mach run run.js # Interpreter, CacheIR, Baseline, Ion: 34252 (3.5x)
$ ../../../mach run --no-ion run.js # Interpreter, CacheIR, Baseline: 9887 (2.0x)
$ ../../../mach run --no-ion --no-baseline --cache-ir-stubs=on run.js # Interpreter, CacheIR: 4890 (6.6x)
$ ../../../mach run --no-ion --no-baseline --cache-ir-stubs=off run.js # Interpreter: 739
MOZCONFIG:
ac_add_options --enable-application=js
ac_add_options --enable-optimize
@mgaudet
mgaudet / Example.md
Created May 22, 2020 21:12
Used Name tracker example

Example 2: Shadowing and closing over.

Remember: Pairs are (ScriptNum, ScopeNum)

// Script 1
// Scope 1
var x = 1;                              // Declared(1) = [x];
function f() // Script 2
{ // Scope 2
@mgaudet
mgaudet / FunctionAllocations.md
Created May 24, 2019 18:39
Where are Functions allocated before the function boxes

FunctionNode* Parser<FullParseHandler, Unit>::standaloneFunction

  • Has a Function argument, Called from
  • FunctionNode* frontend::StandaloneFunctionCompiler<Unit>::parse which has a function argument, called from
  • static bool CompileStandaloneFunction which has a function argument. Called from
    • bool frontend::CompileStandaloneGenerator
    • bool frontend::CompileStandaloneAsyncFunction
    • bool frontend::CompileStandaloneAsyncGenerator
      • All of the above CompileStandAlones, plus the below CompileStandAloneFunction are called from CreateDynamicFunction: the function is allocated there. The above three are -only- called from CreateDynamicFunction.
  • bool frontend::CompileStandaloneFunction which has a function argument. Called from
0x2b872bbb5456: testl %edx, %edx ; branchTest32 (the test)
0x2b872bbb5458: jne 0x2b872bbb546d ; branchTest32 (the jump to true)
0x2b872bbb545e: movabsq $0x37c1c9d258a0, %rax ; movPtr
0x2b872bbb5468: jmp 0x2b872bbb5477 ; jump done
true: 0x2b872bbb546d: movabsq $0x37c1c9d27480, %rax ; movPtr
done: 0x2b872bbb5477: <unrelated instruction>
@mgaudet
mgaudet / Verbose.log
Created December 15, 2017 15:07
Gathering a Testarossa Verbose Log
$ java -Xjit:traceIlGen,log=logFile,verbose -version
#INFO: _______________________________________
#INFO: Version Information:
#INFO: JIT Level - 292f272
#INFO: JVM Level - 20171027_36
#INFO: GC Level - 292f272
#INFO:
#INFO: Processor Information:
#INFO: Platform Info:X86 Intel P6
@mgaudet
mgaudet / Verbose.log
Created December 15, 2017 15:05
Gathering a Testarossa Verbose Log
$ java -Xjit:traceIlGen,log=logFile,verbose -version
#INFO: _______________________________________
#INFO: Version Information:
#INFO: JIT Level - 292f272
#INFO: JVM Level - 20171027_36
#INFO: GC Level - 292f272
#INFO:
#INFO: Processor Information:
#INFO: Platform Info:X86 Intel P6